Skip to content

Commit

Permalink
Add basic Runtime API page (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanthomasdev authored Apr 9, 2024
1 parent d579cc9 commit e9ba810
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/content/docs/reference/renderer.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Renderer
title: Renderer API
description: An reference of all available Lunaria renderer configuration options.
sidebar:
order: 1
order: 2
---

Lunaria allows for slotting and overriding content into your generated dashboard. This reference covers all the available renderer options.
Expand Down
31 changes: 31 additions & 0 deletions docs/src/content/docs/reference/runtime.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Runtime API
description: An reference of all available Lunaria runtime functions.
sidebar:
order: 1
---

Lunaria can also be used outside of its build process, allowing for integrations and other use cases through its available runtime functions.

:::caution
Lunaria exports more runtime functions than currently documented. Their behavior, as well as support is not guaranteed during early access.
:::

## `lunaria()`

The `lunaria()` function is a way to get Lunaria's localization status during runtime. It will validate the configuration, clone your git history (if used in a shallow repository), and return a Promise of your localization status array.

```ts title="example-usage.ts"
import { lunaria } from '@lunariajs/core';

const config = {
// your Lunaria configuration
// ...
};

const status = await lunaria(config);
```

:::tip
You can see an example of how this function is used in the [Astro Docs' Translation Tuesday Bot](https://github.com/withastro/docs/blob/main/scripts/tuesday-bot.ts#L10).
:::

0 comments on commit e9ba810

Please sign in to comment.