[FEATURE] Link the reStructuredText source from the HTML head - #1401
Closed
linawolf wants to merge 1 commit into
Closed
[FEATURE] Link the reStructuredText source from the HTML head#1401linawolf wants to merge 1 commit into
linawolf wants to merge 1 commit into
Conversation
Tools that read our documentation programmatically - AI assistants above
all - want the content without the surrounding HTML. Until every page is
rendered to Markdown as well, the reStructuredText source we already copy
into `_sources/` is the only machine-friendly form we offer, and nothing
in the page points at it: it is reachable only through the "View source"
entry in the options menu.
Emit it as an alternate representation in the `<head>`:
<link href="_sources/index.rst.txt" rel="alternate"
title="reStructuredText source" type="text/x-rst">
The link reuses the `copy_sources` setting and the same `copyDownload()`
call as the "View source" button, so it appears exactly where the `.txt`
file is actually written. A single-page render has no single source file,
so `sourceFilename()` is empty there and no link is emitted.
`text/x-rst` is the type docutils and PyPI use for reStructuredText;
there is no IANA-registered type for it.
Part of: #1400
Member
Author
|
We wont do it, the Rest is missing to much information to really recommend it instead we will render to markdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[FEATURE] Link the reStructuredText source from the HTML head
Tools that read our documentation programmatically - AI assistants above
all - want the content without the surrounding HTML. Until every page is
rendered to Markdown as well, the reStructuredText source we already copy
into
_sources/is the only machine-friendly form we offer, and nothingin the page points at it: it is reachable only through the "View source"
entry in the options menu.
Emit it as an alternate representation in the
<head>:The link reuses the
copy_sourcessetting and the samecopyDownload()call as the "View source" button, so it appears exactly where the
.txtfile is actually written. A single-page render has no single source file,
so
sourceFilename()is empty there and no link is emitted.text/x-rstis the type docutils and PyPI use for reStructuredText;there is no IANA-registered type for it.
Part of: #1400