python / python/docs-community

Enhancing the switchers setup

Ouverte
#4 13 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

discussion
Langage dominant
Makefile
Étoiles
55
Forks
26
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par l’API versions.js proposée à la racine et par le code du switcher de docsbuild-scripts build_docs.py référencé dans l’issue ; comparez les approches liées et le workflow existant d’artefacts GitHub Action. Done doit être une configuration du switcher décidée et testable localement, mais l’issue ne définit ni implémentation spécifique ni critères d’acceptation.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
github-actions, javascript, python
Domaine
documentation, tooling
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.