Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Proposal: display multiple versions of docs

未關閉
#1,289 16 則留言 14 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 2 天內回覆

@anikethsaha 已經在處理了。

開始於 2020年7月27日。

評估

這個 Issue 還沒有評估資料。

描述

enhancement pinned

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

image

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.

  • Configuration
...
$docsify = {
  version : {
   // none I guess
 }
}
...

We can either make it to the navbar.

  • cli command
docsify version <version> <path? = '.'>

This will do the following work in sequence

  1. it will create a version with name <version> in <path>
  2. check for the navbar markdown content i.e _navbar.md
  3. if present, good to go. If not present, ask whether the CLI can create a new one or not. If the CLI is answered with no. Stop the operation
  4. Update the _navbar.md by pretending the content with creating a new list versions. First, it will check whether versions 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 the version list heading. (probably use remark)
  5. it will copy-paste every files/folder present in the current directory from where this command is being run i.e process.cwd()
    to that folder i.e <path>/<version>
  6. Done

Documentation

Create a versioning page in main docs. Create CLI command docs in the docsify-cli and either embed or do the remote rendering in the main docs in order to always show the latest docs

Drawbacks

Few cons or drawbacks

  • it mandates the use of _navbar.md
  • cant be customizable.
  • <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

  • do we want this on the sidebar? I tried but it was not looking good.

Help Needed

  • Please provide some ( edge ) cases where this might break.
  • Provide some suggestions to refine the proposal.
  • At last, anyone wants to implement/take this ?

Frequently Asked Questions

N/A

Related Discussions

Forgot the repo + issue. But I did notice few issues and requests for this.

主要語言
JavaScript
星號
31.5k
分支
5.8k
平均合併
2 天 14 小時
30 天內合併 PR
5

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

docsifyjs/docsify 的其他 Issue

查看 docsifyjs/docsify 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。