From: Jonathan Corbet <corbet@lwn.net>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: linux-doc@vger.kernel.org,
Federico Vaga <federico.vaga@vaga.pv.it>,
Akira Yokosawa <akiyks@gmail.com>,
Carlos Bilbao <carlos.bilbao@amd.com>,
Alex Shi <alexs@kernel.org>, Yanteng Si <siyanteng@loongson.cn>,
Hu Haowen <src.res.211@gmail.com>,
linux-kernel@vger.kernel.org,
Vegard Nossum <vegard.nossum@oracle.com>
Subject: Re: [PATCH] docs: translations: add translations links when they exist
Date: Fri, 17 Nov 2023 13:54:29 -0700 [thread overview]
Message-ID: <87cyw885iy.fsf@meer.lwn.net> (raw)
In-Reply-To: <20231028162931.261843-1-vegard.nossum@oracle.com>
Vegard Nossum <vegard.nossum@oracle.com> writes:
> Add a new Sphinx extension that knows about the translations of kernel
> documentation and can insert links to the translations at the top of
> the document.
>
> It basically works like this:
>
> 1. Register a new node type, LanguagesNode.
>
> 2. Register a new transform, TranslationsTransform, that inserts a new
> LanguageNode at the top of every document. The LanguageNode contains
> "pending references" to translations of the document. The key here
> is that these are pending (i.e. unresolved) references that may or
> may not actually exist.
>
> 3. Register a 'doctree-resolved' event that iterates over all the
> LanguageNode nodes. Any unresolved references are filtered out; the
> list of resolved references is passed to the 'translations.html'
> template and rendered as an HTML node (if HTML output is selected).
>
> Testing: make htmldocs with v7.3.0.
>
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
> Documentation/conf.py | 2 +-
> Documentation/sphinx-static/custom.css | 8 ++
> .../sphinx/templates/translations.html | 12 +++
> Documentation/sphinx/translations.py | 96 +++++++++++++++++++
> 4 files changed, 117 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/sphinx/templates/translations.html
> create mode 100644 Documentation/sphinx/translations.py
OK, this does seem to work.
The naming of the translations definitely needs to change; if we put out
something with "Taiwanese" in it, experience tells me, there will be
objections - and that's not what the translation was called when it was
added.
I'm unsure about putting the languages in the top bar like that; it will
already become pretty wide with the relabeled translations, and may not
look great on a small-screen device. Perhaps a pulldown would be
better?
The build problem reported by Akira definitely needs to be fixed as
well.
Thanks,
jon
prev parent reply other threads:[~2023-11-17 20:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 16:29 [PATCH] docs: translations: add translations links when they exist Vegard Nossum
2023-10-28 18:51 ` Vegard Nossum
2023-11-03 2:00 ` Yanteng Si
2023-10-30 11:30 ` Federico Vaga
2023-10-30 17:11 ` Jani Nikula
2023-11-01 14:56 ` Akira Yokosawa
2023-11-02 11:07 ` Vegard Nossum
2023-11-03 0:09 ` Akira Yokosawa
2023-11-17 20:54 ` Jonathan Corbet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87cyw885iy.fsf@meer.lwn.net \
--to=corbet@lwn.net \
--cc=akiyks@gmail.com \
--cc=alexs@kernel.org \
--cc=carlos.bilbao@amd.com \
--cc=federico.vaga@vaga.pv.it \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=siyanteng@loongson.cn \
--cc=src.res.211@gmail.com \
--cc=vegard.nossum@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox