https://github.com/geopjr/vitepressify
💎🖖 Convert Crystal docs into VitePress
https://github.com/geopjr/vitepressify
crystal docs documentation vitepress
Last synced: 6 months ago
JSON representation
💎🖖 Convert Crystal docs into VitePress
- Host: GitHub
- URL: https://github.com/geopjr/vitepressify
- Owner: GeopJr
- License: bsd-2-clause
- Created: 2022-09-09T23:50:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-13T03:36:27.000Z (about 3 years ago)
- Last Synced: 2024-10-29T07:24:25.765Z (over 1 year ago)
- Topics: crystal, docs, documentation, vitepress
- Language: Crystal
- Homepage:
- Size: 24.4 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
vitepressify
Convert Crystal docs into VitePress
## What is vitepressify?
Crystal docs are awesome, but sometimes you need more control over them.
vitepressify generates a VitePress project with pages from your local or remote Crystal docs.
- It automatically generates markdown pages and sidebars.
- It provides a table of contents.
- It can update an already made project with more versions or other shards.
- It automatically handles loading sidebars and cases where navbar has 1 vs more items, without the need to overwrite any configs.
- It comes with a purple accent.
## Installation
### Pre-built
You can download one of the statically-linked pre-built binaries from the [releases page](https://github.com/GeopJr/vitepressify/releases/latest).
They are built & published by our lovely [actions](https://github.com/GeopJr/vitepressify/actions/workflows/release.yml).
### Building
#### Dependencies
- `crystal` - `1.7.3`
#### Manually
`$ shards build --production --no-debug --release`
## Usage
```
Vitepressify v1.0.0
Usage:
vitepressify [arguments]
Examples:
vitepressify -i ./docs/index.json
vitepressify -i https://crystal-lang.org/api/1.5.0/ -t 1.5.0
vitepressify -i https://geopjr.github.io/gettext.cr/index.json -u ./vitepressify-docs
Arguments:
-i INDEX, --index=INDEX index.json location. Can be either a local path or a url (e.g. https://libadwaita.geopjr.dev/docs/). Default: ./docs/index.json
-t TAG, --tag=TAG Current release/tag (e.g. 1.0.0). Default: main
-u FOLDER, --update=FOLDER Instead of generating a new project, it attempts to update the one at FOLDER.
-l, --license Show the LICENSE
-h, --help Show this help
```
## Example
If you wanted for example to build a VitePress project using the Crystal API docs from 1.4.0 to 1.5.1, all you have to do is:
- Generate the initial project, using the link to the 1.5.1 docs with the tag of `1.5.1`.
```bash
$ vitepressify -i https://crystal-lang.org/api/1.5.1/ -t 1.5.1
```
This will generate the project in a random named folder, for example `vitepress-ujqywe`.
- Now we just tell `vitepressify` to update that folder with the other versions:
```bash
$ vitepressify -i https://crystal-lang.org/api/1.5.0/ -t 1.5.0 -u ./vitepress-ujqywe/
$ vitepressify -i https://crystal-lang.org/api/1.4.1/ -t 1.4.1 -u ./vitepress-ujqywe/
$ vitepressify -i https://crystal-lang.org/api/1.4.0/ -t 1.4.0 -u ./vitepress-ujqywe/
```
- And we are done!
## Contributing
1. Read the [Code of Conduct](./CODE_OF_CONDUCT.md)
2. Fork it ()
3. Create your feature branch (`git checkout -b my-new-feature`)
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request
## Sponsors
[](https://github.com/sponsors/GeopJr)