Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): move to vitepress #5785

Merged
merged 5 commits into from Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .github/workflows/format-workflow.yml
Expand Up @@ -40,3 +40,26 @@ jobs:
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
pattern: docs/[a-z][a-z][a-z]?-[A-Z][A-Z]?/.*

# Vitepress build
vitepress:
name: Vitepress [Build]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: docs/package-lock.json

- name: Setup | Install dependencies
run: npm install
working-directory: docs

- name: Build | Build docs site
run: npm run build
working-directory: docs
6 changes: 3 additions & 3 deletions .github/workflows/publish-docs.yml
Expand Up @@ -10,9 +10,9 @@ jobs:
uses: actions/checkout@v4

- name: Setup | Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: 'npm'
cache-dependency-path: docs/package-lock.json

Expand All @@ -27,7 +27,7 @@ jobs:
- name: Publish
uses: netlify/actions/cli@master
with:
args: deploy --prod --dir=docs/.vuepress/dist
args: deploy --prod --dir=docs/.vitepress/dist
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -215,9 +215,9 @@ jobs:
xcrun notarytool store-credentials "$KEYCHAIN_ENTRY" --team-id "$APPLEID_TEAMID" --apple-id "$APPLEID_USERNAME" --password "$APPLEID_PASSWORD" --keychain "$KEYCHAIN_PATH"

- name: Setup | Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Notarize | Build docs
run: |
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -27,7 +27,8 @@ Cargo.lock

# Compiled files for documentation
docs/node_modules
docs/.vuepress/dist/
docs/.vitepress/dist/
docs/.vitepress/cache/

# Ignore pkg files within the install directory
install/**/*.pkg
install/**/*.pkg
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -251,7 +251,7 @@ Changes to documentation can be viewed in a rendered state from the GitHub PR pa
(go to the CI section at the bottom of the page and look for "deploy preview", then
click on "details"). If you want to view changes locally as well, follow these steps.

After cloning the project, you can do the following to run the VuePress website on your local machine:
After cloning the project, you can do the following to run the VitePress website on your local machine:

1. `cd` into the `/docs` directory.
2. Install the project dependencies:
Expand All @@ -266,7 +266,7 @@ After cloning the project, you can do the following to run the VuePress website
npm run dev
```

Once setup is complete, you can refer to VuePress documentation on the actual implementation here: <https://vuepress.vuejs.org/guide/>.
Once setup is complete, you can refer to VitePress documentation on the actual implementation here: <https://vitepress.dev/guide/getting-started>.

## Git/GitHub workflow

Expand All @@ -292,7 +292,7 @@ everyone remember what they are. Don't worry: most of them are quite simple!
appropriate--this is a bare minimum).
- [ ] Add the variable to the appropriate location in the "Default Prompt
Format" section of the documentation
- [ ] Add an appropriate choice of options to each preset in `docs/.vuepress/public/presets/toml`
- [ ] Add an appropriate choice of options to each preset in `docs/public/presets/toml`
- [ ] Update the config file schema by running `cargo run --features config-schema -- config-schema > .github/config-schema.json`
- [ ] Create configs structs/traits in `src/configs/<module>.rs` and add the
following:
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Expand Up @@ -19,8 +19,8 @@ fn main() -> SdResult<()> {
}

fn gen_presets_hook(mut file: &File) -> SdResult<()> {
println!("cargo:rerun-if-changed=docs/.vuepress/public/presets/toml");
let paths = fs::read_dir("docs/.vuepress/public/presets/toml")?;
println!("cargo:rerun-if-changed=docs/public/presets/toml");
let paths = fs::read_dir("docs/public/presets/toml")?;
let mut sortedpaths = paths.collect::<io::Result<Vec<_>>>()?;
sortedpaths.sort_by_key(std::fs::DirEntry::path);

Expand Down