Improve this documentation
The site is built with VitePress from the docs/ directory of the LIVR repository. For a small fix, use the "Edit this page on GitHub" link at the bottom of any page.
To run the site locally:
- Fork and clone koorchik/LIVR.
- Install dependencies (Node.js 20 or newer):
npm install - Start the dev server:
npm run docs:dev - Open
http://localhost:5173/and edit the files indocs/. The page reloads on save. - Check the production build:
npm run docs:build - Open a pull request.
The site is deployed automatically from the master branch.
Useful details
The sidebar and the navigation are configured in
docs/.vitepress/config.mts.A fenced code block with the
livrlanguage becomes an editable live example:md```livr // rules { name: 'required' } // input { name: '' } ```An optional
// aliasessection takes a list of aliases.Every rule has its own page,
docs/validation-rules/<rule>.md:- the first paragraph after the title is the summary shown on the rules overview;
- the
Error codes:line lists the codes, so the overview can be filtered by them; - the frontmatter sets the group, the short syntax for the overview and the live example;
<RuleSandbox />renders the live example together with the rule's test suite cases.
The groups and the order of the rules are set in
docs/data/rule-groups.json. To add a rule, create its page and add it to a group.<TestCases suite="aliases" />shows the alias cases of the test suite.The list of implementations is generated from
docs/data/implementations.json. After changing it, runnpm run readmeto update the repository README.Set
LIVR_DOCS_OFFLINE=1to build the site without fetching package versions and repository activity.