-
Notifications
You must be signed in to change notification settings - Fork 12
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
test versioning #38
test versioning #38
Conversation
// const dataHost = 'https://github.com/LuxDL/DocumenterVitepress.jl/blob/gh-pages/' | ||
// const dataUrl = `${dataHost}/versions.js` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use this instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way it's synced with versions.js
for all items. See e.g. https://geo.makie.org/versions.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 , how? the issue is getting that list automatically? maybe from the Julia side then, read, parse and include? no idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could get the list by e.g.:
const dataHost = 'https://luxdl.github.io/DocumenterVitepress.jl'
const dataUrl = `${dataHost}/versions.js`
see e.g. https://luxdl.github.io/DocumenterVitepress.jl/versions.js
but I'm not sure how the list would be constructed - or how it should be structured!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the template:
versions = [
{text: 'stable', link: '/v0.0.3/',},
{text: 'dev', link: '/dev/',},
{text: 'v0.0.3', link: '/v0.0.3/'}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just remembered that I once added some version support for the mkdocs build (via mike), where I hooked into Documenter.HTMLWriter.generate_version_file
: https://github.com/thofma/Hecke.jl/blob/master/docs/make.jl#L26-L52. I don't know where that list comes from, but it seemed to work well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could work as a first pass. My issue with it is that it creates a static version selector, meaning that people on docs of v0.4 could not access v0.6 through the selector.
If possible, the best thing to do is probably to somehow access versions.js
in the browser and generate a selector on the client side...
@@ -39,10 +40,12 @@ export default defineConfig({ | |||
{ text: 'Getting Started', link: '/getting_started' }, | |||
{ text: 'Markdown', link: '/markdown-examples' }, | |||
{ text: 'Code', link: '/code_example' }, | |||
{ text: 'API', link: '/api' } | |||
{ text: 'API', link: '/api' }, | |||
{ text: 'versions', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ text: 'versions', | |
{ text: 'REPLACE_ME_DOCUMENTER_VITEPRESS', |
and then we add the current version (be it dev, preview, or v*) to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm... note that the items
part is the thing that needs to be replaced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you had some code in the component to make items dynamic?
Code can be run client-side by wrapping it in a client-only div as in https://vitepress.dev/reference/runtime-api#clientonly |
I finally figured out how Documenter does this - it injects into So at least we know what they do. We could probably build a Vue component from this, I think. |
We could include the Documenter version JS as a local script, then deploy a version selector based on that...probably wrapped in a ClientOnly block. |
new solution, WIP, #178 |
test button