Commit help_sections data file

The help_sections.rs file was added to the tarball only as a quick hack.
There is a cyclic dependency between docs and fish:

"fish_indent" via "crates/build-man-pages" depends on "doc_src/".
So every "touch doc_src/foo.rst && ninja -Cbuild sphinx-docs"
re-builds fish.

In future "fish_indent" should not depend on "crates/build-man-pages".
Until then, a following commit wants to break this cyclic dependency
in a different way: we won't embed man pages (matching historical
behavior), which means that CMake builds won't need to run
sphinx-build.

But sphinx-build is also used for extracting help sections.

Also, the fix for #12082 will use help sections elsewhere in the code.

Prepare to remove the dependency on doc_src by committing the help
sections (we already do elsewhere).
This commit is contained in:
Johannes Altmanninger
2025-11-20 10:34:17 +01:00
parent 95aeb16ca2
commit 0c67d0565a
22 changed files with 357 additions and 83 deletions

View File

@@ -31,7 +31,6 @@ Synopsis
status build-info
status get-file FILE
status list-files [PATH ...]
status help-sections
status terminal
status test-terminal-feature FEATURE
@@ -124,13 +123,6 @@ The following operations (subcommands) are available:
This lists the files embedded in the fish binary at compile time. Only files where the path starts with the optional *FILE* argument are shown.
Returns 0 if something was printed, 1 otherwise.
**help-sections**
NOTE: this subcommand is intended for fish's internal use.
List section arguments for the :doc:`help <help>` command.
If you have the latest version of fish, these URL fragments are valid on `<https://fishshell.com/docs/current/>`__.
Always returns 0.
.. _status-terminal:
**terminal**

View File

@@ -74,9 +74,7 @@ def extract_sections(app, env):
f"Unsupported characters in section path: {section}"
)
help_sections = "".join(f"{section}\n" for section in sections)
Path(output_file).write_text(
f"""pub static HELP_SECTIONS: &str = "{help_sections}";"""
)
Path(output_file).write_text(help_sections)
def remove_fish_indent_lexer(app):
@@ -99,7 +97,7 @@ def setup(app):
app.add_config_value("issue_url", default=None, rebuild="html")
app.add_config_value(
"fish_help_sections_output",
default=os.environ.get("FISH_SPHINX_HELP_SECTIONS_OUTPUT", ""),
default="",
rebuild="man",
types=str,
)