Add singlerst builder

This commit is contained in:
Jared Dillard
2025-12-01 13:51:26 -08:00
parent 543efabebb
commit dc9f16d454
6 changed files with 31 additions and 28 deletions
+4 -1
View File
@@ -11,4 +11,7 @@ build:
- cmake --workflow --preset documentation-workflow
# Copy built documentation to Read the Docs output directory
- mkdir -p $READTHEDOCS_OUTPUT/html
- cp -r build/* $READTHEDOCS_OUTPUT/html/
- cp -r build/html/* $READTHEDOCS_OUTPUT/html/
- cp -r build/markdown/* $READTHEDOCS_OUTPUT/html/
- cp -r build/rst/* $READTHEDOCS_OUTPUT/html/
- cp build/singlerst/index.rst $READTHEDOCS_OUTPUT/html/llms-full.txt
+7 -1
View File
@@ -27,11 +27,17 @@
"configurePreset": "documentation",
"targets": ["rst"]
},
{
"name": "singlerst",
"displayName": "Build Single reStructuredText Documentation",
"configurePreset": "documentation",
"targets": ["singlerst"]
},
{
"name": "docs-parallel",
"displayName": "Build HTML and Markdown in parallel",
"configurePreset": "documentation",
"targets": ["html", "markdown", "rst"]
"targets": ["html", "markdown", "rst", "singlerst"]
}
],
"workflowPresets": [
@@ -1,4 +1,7 @@
# SetupSphinx.cmake - Find Sphinx for CI environments
# Sphinx related utilities
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
set(SPHINX_BUILD ${CMAKE_BINARY_DIR})
# Function to find Sphinx in the system
function(setup_sphinx_environment)
@@ -15,3 +18,11 @@ function(setup_sphinx_environment)
# Export to parent scope
set(SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE}" PARENT_SCOPE)
endfunction()
# Function to add a Sphinx builder target
function(add_sphinx_builder builder_name)
add_custom_target(${builder_name}
COMMAND ${SPHINX_EXECUTABLE} -b ${builder_name} ${SPHINX_SOURCE} ${SPHINX_BUILD}/${builder_name}
VERBATIM
)
endfunction()
+6 -24
View File
@@ -1,27 +1,9 @@
# Find Sphinx
include(SetupSphinx)
include(SphinxUtils)
setup_sphinx_environment()
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
set(SPHINX_BUILD ${CMAKE_BINARY_DIR})
# Build HTML documentation
add_custom_target(html
COMMAND ${SPHINX_EXECUTABLE} -b html ${SPHINX_SOURCE} ${SPHINX_BUILD}
COMMENT "Building HTML documentation"
VERBATIM
)
# Build markdown documentation
add_custom_target(markdown
COMMAND ${SPHINX_EXECUTABLE} -b markdown ${SPHINX_SOURCE} ${SPHINX_BUILD}
COMMENT "Building Markdown documentation"
VERBATIM
)
# Build reStructuredText documentation
add_custom_target(rst
COMMAND ${SPHINX_EXECUTABLE} -b rst ${SPHINX_SOURCE} ${SPHINX_BUILD}
COMMENT "Building reStructuredText documentation"
VERBATIM
)
# Add builder targets
add_sphinx_builder(html)
add_sphinx_builder(markdown)
add_sphinx_builder(rst)
add_sphinx_builder(singlerst)
+1 -1
View File
@@ -5,4 +5,4 @@ sphinx
sphinx-llms-txt
sphinxext-opengraph
sphinx-markdown-builder
sphinxcontrib-restbuilder
sphinxcontrib-restbuilder @ git+https://github.com/jdillard/restbuilder.git@feature/singlerst-builder
+1
View File
@@ -17,6 +17,7 @@ copyright = "Jared Dillard"
author = "Jared Dillard"
llms_txt_uri_template = "{base_url}{docname}.md"
llms_txt_full_file = False
llms_txt_code_files = ["+:../../sphinx_llms_txt/*.py"]
llms_txt_summary = """
A Sphinx extension that generates a summary llms.txt file,written in Markdown,