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

Include current CLI version in generated docs page #279

Merged
merged 2 commits into from
May 16, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/platform-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ jobs:
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"

(cd docs; npm pkg set version=$TAG_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a frontend developer, i approve this message 🤝

./docs/src/docs/cli/generate.sh > /dev/null
git add --all
git commit -m "docs: update CLI documentation for ${{ github.ref_name }}"
Expand Down
15 changes: 15 additions & 0 deletions docs/.vitepress/theme/components/VersionInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup lang="ts">
import { version } from '../../../package.json'
</script>

<template>
<div class="flex justify-between items-center">
<h1 id="kit-cli-reference" tabindex="-1">
Kit CLI Reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these changes are good to me, but in the future, and for a bigger reusability, we want this line to be a <slot /> so we can pass any title content that we want, and therefor, reuse it from anyplace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to do something like that, but I couldn't figure out a good way to parameterize the id/anchor bits -- if you've got tips I'm happy to fix it 👍

TBH I copied the anchor from what Vite autogens for a markdown # 🙂

<a class="header-anchor" href="#kit-cli-reference" aria-label="Permalink to &quot;Kit CLI Reference&quot;">​</a>
</h1>
<div class="text-gray-05 text-med font-mono">
{{version}}
</div>
</div>
</template>
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "v0.2.4",
"peerDependencies": {
"vue": "^3.4"
},
Expand All @@ -20,4 +21,4 @@
"sitemap": "^7.1.1",
"vue3-marquee": "^4.2.0"
}
}
}
6 changes: 5 additions & 1 deletion docs/src/docs/cli/cli-reference.header
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
outline: 2
title: "Kit CLI Reference"
---
# Kit CLI Reference
<script setup>
import VersionInfo from '@theme/components/VersionInfo.vue'
</script>

<VersionInfo />
7 changes: 6 additions & 1 deletion docs/src/docs/cli/cli-reference.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
outline: 2
title: "Kit CLI Reference"
---
# Kit CLI Reference
<script setup>
import VersionInfo from '@theme/components/VersionInfo.vue'
</script>

<VersionInfo />

## kit dev

Expand Down