Add singlerst builder
This commit is contained in:
+4
-1
@@ -11,4 +11,7 @@ build:
|
|||||||
- cmake --workflow --preset documentation-workflow
|
- cmake --workflow --preset documentation-workflow
|
||||||
# Copy built documentation to Read the Docs output directory
|
# Copy built documentation to Read the Docs output directory
|
||||||
- mkdir -p $READTHEDOCS_OUTPUT/html
|
- 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
@@ -27,11 +27,17 @@
|
|||||||
"configurePreset": "documentation",
|
"configurePreset": "documentation",
|
||||||
"targets": ["rst"]
|
"targets": ["rst"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "singlerst",
|
||||||
|
"displayName": "Build Single reStructuredText Documentation",
|
||||||
|
"configurePreset": "documentation",
|
||||||
|
"targets": ["singlerst"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"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", "rst"]
|
"targets": ["html", "markdown", "rst", "singlerst"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"workflowPresets": [
|
"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 to find Sphinx in the system
|
||||||
function(setup_sphinx_environment)
|
function(setup_sphinx_environment)
|
||||||
@@ -15,3 +18,11 @@ function(setup_sphinx_environment)
|
|||||||
# Export to parent scope
|
# Export to parent scope
|
||||||
set(SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE}" PARENT_SCOPE)
|
set(SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE}" PARENT_SCOPE)
|
||||||
endfunction()
|
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
@@ -1,27 +1,9 @@
|
|||||||
# Find Sphinx
|
# Find Sphinx
|
||||||
include(SetupSphinx)
|
include(SphinxUtils)
|
||||||
setup_sphinx_environment()
|
setup_sphinx_environment()
|
||||||
|
|
||||||
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
|
# Add builder targets
|
||||||
set(SPHINX_BUILD ${CMAKE_BINARY_DIR})
|
add_sphinx_builder(html)
|
||||||
|
add_sphinx_builder(markdown)
|
||||||
# Build HTML documentation
|
add_sphinx_builder(rst)
|
||||||
add_custom_target(html
|
add_sphinx_builder(singlerst)
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ sphinx
|
|||||||
sphinx-llms-txt
|
sphinx-llms-txt
|
||||||
sphinxext-opengraph
|
sphinxext-opengraph
|
||||||
sphinx-markdown-builder
|
sphinx-markdown-builder
|
||||||
sphinxcontrib-restbuilder
|
sphinxcontrib-restbuilder @ git+https://github.com/jdillard/restbuilder.git@feature/singlerst-builder
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ 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_full_file = False
|
||||||
llms_txt_code_files = ["+:../../sphinx_llms_txt/*.py"]
|
llms_txt_code_files = ["+:../../sphinx_llms_txt/*.py"]
|
||||||
llms_txt_summary = """
|
llms_txt_summary = """
|
||||||
A Sphinx extension that generates a summary llms.txt file,written in Markdown,
|
A Sphinx extension that generates a summary llms.txt file,written in Markdown,
|
||||||
|
|||||||
Reference in New Issue
Block a user