-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d579cc9
commit e9ba810
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). | ||
::: |