python / python/docs-community

Enhancing the switchers setup

Đang mở
#4 13 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

discussion
Ngôn ngữ chính
Makefile
Star
55
Fork
26
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với API versions.js được đề xuất ở cấp root và mã switcher trong docsbuild-scripts build_docs.py được tham chiếu trong issue; so sánh các cách tiếp cận được liên kết và workflow artifact GitHub Action hiện có. Done nên là một thiết lập switcher đã được quyết định và có thể kiểm thử cục bộ, nhưng issue không xác định một triển khai cụ thể hoặc tiêu chí chấp nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github-actions, javascript, python
Lĩnh vực
documentation, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.