[docs] Add restbuilder builder for single page .rst builds (#53)
This commit is contained in:
+7
-1
@@ -21,11 +21,17 @@
|
|||||||
"configurePreset": "documentation",
|
"configurePreset": "documentation",
|
||||||
"targets": ["markdown"]
|
"targets": ["markdown"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "rst",
|
||||||
|
"displayName": "Build reStructuredText Documentation",
|
||||||
|
"configurePreset": "documentation",
|
||||||
|
"targets": ["rst"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "docs-parallel",
|
"name": "docs-parallel",
|
||||||
"displayName": "Build HTML and Markdown in parallel",
|
"displayName": "Build HTML and Markdown in parallel",
|
||||||
"configurePreset": "documentation",
|
"configurePreset": "documentation",
|
||||||
"targets": ["html", "markdown"]
|
"targets": ["html", "markdown", "rst"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"workflowPresets": [
|
"workflowPresets": [
|
||||||
|
|||||||
@@ -18,3 +18,10 @@ add_custom_target(markdown
|
|||||||
COMMENT "Building Markdown documentation"
|
COMMENT "Building Markdown documentation"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Build reStructuredText documentation
|
||||||
|
add_custom_target(rst
|
||||||
|
COMMAND ${SPHINX_EXECUTABLE} -b rst ${SPHINX_SOURCE} ${SPHINX_BUILD}
|
||||||
|
COMMENT "Building reStructuredText documentation"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ sphinx
|
|||||||
sphinx-llms-txt
|
sphinx-llms-txt
|
||||||
sphinxext-opengraph
|
sphinxext-opengraph
|
||||||
sphinx-markdown-builder
|
sphinx-markdown-builder
|
||||||
|
sphinxcontrib-restbuilder
|
||||||
|
|||||||
@@ -293,8 +293,8 @@ Your URI template can use the following variables:
|
|||||||
- ``{sourcelink_suffix}`` - The suffix from ``html_sourcelink_suffix`` configuration (e.g., ``.txt``)
|
- ``{sourcelink_suffix}`` - The suffix from ``html_sourcelink_suffix`` configuration (e.g., ``.txt``)
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Instead of using the default of linking to ``_sources``, you can generate Markdown files from your documentation and link to those in ``llms.txt``.
|
Instead of using the default of linking to ``_sources``, you can generate Markdown and/or reStructuredText files from your documentation and link to those in ``llms.txt``.
|
||||||
See this package's `CMake setup <https://github.com/jdillard/sphinx-llms-txt>`_ for an example of building both HTML and Markdown in parallel.
|
See this package's `CMake setup <https://github.com/jdillard/sphinx-llms-txt>`_ for an example of building both HTML and Markdown and/or reStructuredText in parallel.
|
||||||
Note that ``_sources`` is still needed for ``llms-full.txt`` at this time.
|
Note that ``_sources`` is still needed for ``llms-full.txt`` at this time.
|
||||||
|
|
||||||
.. _integration_examples:
|
.. _integration_examples:
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import subprocess
|
|||||||
project = "sphinx-llms-txt"
|
project = "sphinx-llms-txt"
|
||||||
copyright = "Jared Dillard"
|
copyright = "Jared Dillard"
|
||||||
author = "Jared Dillard"
|
author = "Jared Dillard"
|
||||||
|
|
||||||
llms_txt_uri_template = "{base_url}{docname}.md"
|
llms_txt_uri_template = "{base_url}{docname}.md"
|
||||||
llms_txt_code_files = ["+:../../sphinx_llms_txt/*.py"]
|
llms_txt_code_files = ["+:../../sphinx_llms_txt/*.py"]
|
||||||
llms_txt_summary = """
|
llms_txt_summary = """
|
||||||
@@ -22,6 +23,9 @@ A Sphinx extension that generates a summary llms.txt file,written in Markdown,
|
|||||||
and a single combined documentation llms-full.txt file, written in reStructuredText.
|
and a single combined documentation llms-full.txt file, written in reStructuredText.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# This doesn't seem to be supported
|
||||||
|
# rst_file_suffix = ".html.rst"
|
||||||
|
|
||||||
# check if the current commit is tagged as a release (vX.Y.Z)
|
# check if the current commit is tagged as a release (vX.Y.Z)
|
||||||
try:
|
try:
|
||||||
GIT_TAG_OUTPUT = subprocess.check_output(["git", "tag", "--points-at", "HEAD"])
|
GIT_TAG_OUTPUT = subprocess.check_output(["git", "tag", "--points-at", "HEAD"])
|
||||||
@@ -50,6 +54,7 @@ extensions = [
|
|||||||
"sphinx.ext.intersphinx",
|
"sphinx.ext.intersphinx",
|
||||||
"sphinx_contributors",
|
"sphinx_contributors",
|
||||||
"sphinx_llms_txt",
|
"sphinx_llms_txt",
|
||||||
|
"sphinxcontrib.restbuilder",
|
||||||
]
|
]
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
|
|||||||
Reference in New Issue
Block a user