python / python/docs-community

Enhancing the switchers setup

未关闭
#4 13 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

discussion
主要语言
Makefile
星标
55
派生
26
PR 合并指标
30 天内没有已合并 PR

描述

Currently the contributions to python-docs-theme are made hard because of the language and version switchers.

I made review a bit easier by adding a github action to build the doc and provide it as a built artifact, so reviewers can just download and test locally.

But still the enhancement of the doc is made hard, for example https://github.com/python/python-docs-theme/pull/46 has been slowed down because of this (sry @obulat).

Solution 1

I once had an idea to enhance the situation: we could provide an "API" on the form of a simple .js file at the root of docs.python.org listing the available versions and languages.

pros:

  • It removes the switchers ugly hack in docsbuild-scripts.
  • It make the theme easy to test locally: just drop a versions.js at the root with some sample data.
  • A project using our theme with no need for switchers will not use a version.js file and have no switchers.
  • A project using our theme with the need for switchers could set them up easily (add a version.js file).

cons:

  • This is already the case, but we should be aware of the SEO penality that we could have if we redrow the page after load to render the switchers.
  • The impementation will probably be tied to our specific hiearchy: /{LANG}/{VERSION}/ with the language being optional, defaulting to english.
  • It may not follow the current state of the art of doing this, as I did not reviewd how other themes do this, how readthedocs does it, how for example https://docs.djangoproject.com/en/3.1/ does it.

Other ideas, and feedback welcome.

cc @pradyunsg @obulat

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从提议的根级 versions.js API 和 issue 中引用的 docsbuild-scripts build_docs.py switcher 代码开始;比较链接中的方法和现有的 GitHub Action artifact workflow。Done 应该是一个已确定且可在本地测试的 switcher 设置,但 issue 没有定义具体的实现或验收标准。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, javascript, python
领域
documentation, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。