-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Proposal: display multiple versions of docs #1289
Comments
First off: I think this would be a great addition and really helpful, especially if using something like semantic-release to auto create versions and package the correct docs with it. One potentiell issue I see would be the linking of source files as examples. When using a git tag as the version there should be some kind of variable or variable replacement that allows to reference the correct file from the rev that is the version. Here is an example: I have an embedded code fragment I want to display in my docs and use the following syntax to embed it: [filename](../src/app/js/example.js ':include :type=code :fragment=demo') What would this display after the cli version command copied all of the files? Always the master branch? Will it be copied as well? If yes, where? One solution to this (I can think of) would be to add a ref tag to the embed snippet that defaults to master, but also takes a variable that can be resolved to the current version. [filename](_media/example.js ':include :type=code :fragment=demo :rev=$version') What do you think? |
I am not planning of using tags for versioning instead, using folder structure. So whenever versioning is being done, you will a new folder named |
Hi, in my opinion there should still be an option to convert git tags to docsify versions. In the long run, you could for example provide a GitHub action that updates the versions with docsify-cli on every tag pushed to GitHub. There could also be a dev version, which contains the documentation of the current master branch. The steps that would be necessary for this:
Creating a GitHub action would be easy with this functionality and would automatically list each pushed tag as a new version in the documentation, which would eliminate the struggle to update the docs versions manually. |
@anikethsaha While a nice solution, that would create quite a large impact on repo size over time. Tools that use |
@MarvinJWendt Github action sounds great helper. Can you guys create a polished proposal for your solution? I would love to read them and we might change this proposal to the new one if that fits well. You can comment here with the above template. |
I have no idea if this is feasible. Design (not so detailed)My initial thoughts were that given we have the Repo URL and the filepath within a given folder that we could fetch the files via The complexity is how Docsify would reload to re-render these files while keeping the configuration of the user's selection. Perhaps via query params or localstorage. So for a homepage we would get:
Perhaps this can be taken care of with the existing The actual list of versions would need to be populated by performing a fetch to the listed The value I (and others in my circles) get from Docsify is the fact it doesn't require a redeploy each time docs change. It's all client-side and set and forget. If we can provide versioning support in the same way that would be ideal IMO. Other
|
Hi, Maybe we could just create a branch (called "docs"), containing a docs/version-xx.xx directory, including only documentation in html format ? (not markdown) |
Any developments on this proposal? |
Hi everyone, thanks for the amazing tool. Any progress on this proposal? This feature would be really useful. |
I second @Piotr1215 and @FaultyFunctions |
I second @Piotr1215 and @FaultyFunctions. Versioning is something a lot of people need. Would be great to see progress. |
Is it something like this? The source sode -> https://github.com/keiyin-wong/docsify-version-plugin The docsify demo code -> https://github.com/keiyin-wong/docsify-version-plugin-doc-example |
@keiyin-wong that's very good! |
Isn’t there still no progress on the proposal made four years ago? Version management is all too common for product documentation |
@Niceies Feel free to make a PR. 😄 |
请问到如今2024年,你的文档编写的方式迁移到别处了么? |
versioning
Summary
Support for creating docs for different versions.
Motivation
Versioning support in a documentation generator is quite helping as it helps in supporting separating the docs for different versions. Helps is covering breaking changes. Improves readability.
There are other documentation generators that support this like docusaurus, gitbook etc.
Detailed Design
This will mainly require to make changes in the
docsify-cli
repo. I don't think we need any changes in the core.We have great support for having navbar We will make use of that.
We can either make it to the navbar.
This will do the following work in sequence
<version>
in<path>
_navbar.md
CLI
can create a new one or not. If theCLI
is answered withno
. Stop the operation_navbar.md
by pretending the content with creating a new listversions
. First, it will check whetherversions
are present as list heading or not. and inside that, append the list with the<version>
. Use the AST for the markdown content in order to prepend, append, and check for theversion
list heading. (probably useremark
)process.cwd()
to that folder i.e
<path>/<version>
Documentation
Create a
versioning
page in main docs. Create CLI command docs in thedocsify-cli
and either embed or do the remote rendering in the main docs in order to always show the latest docsDrawbacks
Few cons or drawbacks
_navbar.md
<please comment if you find any>
Backwards Compatibility Analysis
Not required. As it will need changes in the cli not in the core.
Alternatives
Manually copy-pasting the files/folder and changing the
_navbar.md
Open Questions
Help Needed
Frequently Asked Questions
N/A
Related Discussions
Forgot the repo + issue. But I did notice few issues and requests for this.
The text was updated successfully, but these errors were encountered: