Skip to content

Commit 8129422

Browse files
Add info on generating docs in .txt format (#12194)
Closes #12161 <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--12194.org.readthedocs.build/12194/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--12194.org.readthedocs.build/12194/ <!-- readthedocs-preview dev end --> --------- Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
1 parent e82423b commit 8129422

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/user/build-customization.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,3 +601,39 @@ Here is an example configuration file:
601601
build:
602602
html:
603603
- asciidoctor -D $READTHEDOCS_OUTPUT/html index.asciidoc
604+
605+
Generate text format with Sphinx
606+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
607+
608+
There might be various reasons why would you want to generate your
609+
documentation in `text` format (secondary to `html`). One of such reasons
610+
would be generating LLM friendly documentation.
611+
612+
See the following example for how to add generation of additional `text`
613+
format to your existing documentation. Deviations from standard build
614+
configuration are highlighted/emphasized:
615+
616+
.. code-block:: yaml
617+
:caption: .readthedocs.yaml
618+
:emphasize-lines: 14-
619+
620+
version: 2
621+
622+
sphinx:
623+
configuration: docs/conf.py
624+
625+
python:
626+
install:
627+
- requirements: docs/requirements.txt
628+
629+
build:
630+
os: ubuntu-22.04
631+
tools:
632+
python: "3.12"
633+
jobs:
634+
post_build:
635+
- mkdir -p $READTHEDOCS_OUTPUT/html/
636+
- sphinx-build -n -b text docs $READTHEDOCS_OUTPUT/html/
637+
638+
The generated ``.txt`` files will be placed in the `html` directory, together
639+
with ``.html`` files.

0 commit comments

Comments
 (0)