sphinx-external-toc-strict


Namesphinx-external-toc-strict JSON
Version 1.1.7 PyPI version JSON
download
home_pageNone
SummaryA sphinx extension that allows the site-map to be defined in a single YAML file.
upload_time2024-04-19 06:51:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
license Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS
keywords sphinx extension toc strictyaml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
.. For details: https://github.com/msftcangoblowm/sphinx-external-toc-strict/blob/master/NOTICE.txt

sphinx-external-toc-strict
===========================

A sphinx extension that allows the documentation site-map (a.k.a Table of Contents) to be defined external to the documentation files.

|  |last-commit| |codecov| |license|
|  |test-status| |quality-status| |docs|
|  |kit| |versions| |black|
|  |stars| |mastodon-msftcangoblowm|

In normal Sphinx documentation, the documentation site-map is defined
*via* a bottom-up approach - adding
`toctree directives <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-of-contents>`_
within pages of the documentation.

This extension facilitates a **top-down** approach to defining the
site-map structure, within a single YAML file.

.. image:: https://raw.githubusercontent.com/msftcangoblowm/sphinx-external-toc-strict/main/docs/_static/toc-graphic.png
   :alt: ToC graphic
   :width: 1770px
   :height: 908px

It also allows for documents not specified in the ToC to be auto-excluded.

.. PYVERSIONS

* Python 3.9 through 3.12, and 3.13.0a3 and up.

**New in 1.1.x:**

fork project; drop pyyaml support transition to strictyaml; use both markdown and restructuredtext;
code manual; semantic versioning; badges;

This is a fork
---------------

sphinx-external-toc-strict is a fork of sphinx-external-toc

.. csv-table:: Comparison
   :header: "Matric", "TOC", "TOC-Strict"
   :widths: auto

   "yaml package", `pyyaml / yaml <https://hitchdev.com/strictyaml/why-not/>`_, `strictyaml / ruemel.yaml <https://hitchdev.com/strictyaml/why/>`_
   ".hidden.files.rst", "Yes", "No"
   "docs theme", `sphinx-book-theme <https://sphinx-book-theme.readthedocs.io/en/latest>`_, `alabaster <https://alabaster.readthedocs.io/en/latest/>`_
   "markdown support", "Yes", "Yes"
   "both", `No <https://github.com/executablebooks/sphinx-external-toc/#development-notes>`_, "Yes, root doc must be ``index.rst``"
   "dump yaml", "use yaml.dump", "[package].parsing_strictyaml.dump_yaml"
   "static type checking", "patchy", "Yes (99%)"
   "coverage", "patchy", "maximium"
   "in-code manual", "No", "Yes"

The core API should be compatible. To avoid confusion, on the command line, rather than ``sphinx-etoc``, use ``sphinx-etoc-strict``

The author of sphinx-external-toc `[source ToC] <https://pypi.org/project/sphinx_external_toc/>`_ is Chris Sewell

The author of sphinx-external-toc-strict `[source ToC-strict] <https://pypi.org/project/sphinx-external-toc-strict/>`_ is Dave Faulkmore

User Guide
------------

Sphinx Configuration
^^^^^^^^^^^^^^^^^^^^^

Add to your ``conf.py``:

.. code:: python

    source_suffix = [".md", ".rst"]
    extensions = ["sphinx_external_toc_strict", "myst-parser"]
    external_toc_path = "_toc.yml"  # optional, default: _toc.yml
    external_toc_exclude_missing = True

Or to your ``pyproject.toml``:

.. code:: text

   [tool.sphinx-pyproject]
   source_suffix = [".md", ".rst"]
   extensions = [
       "sphinx.ext.autodoc",
       "sphinx.ext.autosectionlabel",
       "sphinx.ext.todo",
       "sphinx.ext.doctest",
       "sphinx_paramlinks",
       "sphinx.ext.intersphinx",
       "sphinx.ext.extlinks",
       "sphinx_external_toc_strict",
       "myst_parser",
   ]
   external_toc_path = "_toc.yml"  # optional, default: _toc.yml
   external_toc_exclude_missing = true
   myst_enable_extensions = ["colon_fence", "html_image"]


Note the ``external_toc_path`` is always read as a Unix path, and can
either be specified relative to the source directory (recommended) or
as an absolute path.

Basic Structure
^^^^^^^^^^^^^^^^

A minimal ToC defines the top level ``root`` key, for a single root document file:

.. code:: yaml

   root: intro

The value of the ``root`` key will be a path to a file, in Unix format
(folders split by ``/``), relative to the source directory, and can be
with or without the file extension.

.. note:: Configure root file

   This root file will be set as the
   `master_doc <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-master_doc>`_.

Document files can then have a ``subtrees`` key - denoting a list of
individual toctrees for that document - and in-turn each subtree should
have a ``entries`` key - denoting a list of children links, that are one of:

- ``file``: path to a single document file in Unix format,  with or without the file extension (as for ``root``)
- ``glob``: path to one or more document files *via* Unix shell-style wildcards (similar to `fnmatch <https://docs.python.org/3/library/fnmatch.html>`_, but single stars don't match slashes.)
- ``url``: path for an external URL (starting e.g. ``http`` or ``https``)

.. important::

   Each document file can only occur once in the ToC!

This can proceed recursively to any depth.

.. code:: yaml

   root: intro
   subtrees:
   - entries:
     - file: doc1
       subtrees:
       - entries:
         - file: doc2
           subtrees:
           - entries:
             - file: doc3
     - url: https://example.com
     - glob: subfolder/other*

This is equivalent to having a single ``toctree`` directive in
``intro``, containing ``doc1``, and a single ``toctree`` directive in
``doc1``, with the ``glob:`` flag and containing ``doc2``,
``https://example.com`` and ``subfolder/other*``.

As a shorthand, the ``entries`` key can be at the same level as the
``file``, which denotes a document with a single subtree.

For example, this file is exactly equivalent to the one above:

.. code:: yaml

   root: intro
   entries:
   - file: doc1
     entries:
     - file: doc2
       entries:
       - file: doc3
   - url: https://example.com
   - glob: subfolder/other*

File and URL titles
^^^^^^^^^^^^^^^^^^^^

By default, the initial header within a ``file`` document will be used
as its title in generated Table of Contents. With the ``title`` key you
can set an alternative title for a document. and also for ``url``:

.. code:: yaml

   root: intro
   subtrees:
   - entries:
     - file: doc1
       title: Document 1 Title
     - url: https://example.com
       title: Example URL Title

ToC tree options
^^^^^^^^^^^^^^^^^

Each subtree can be configured with a number of options (see also
`sphinx toctree options <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree>`_):

- ``caption`` (string): A title for the whole the subtree, e.g. shown above the subtree in ToCs
- ``hidden`` (boolean): Whether to show the ToC within (inline of) the document (default ``False``).
  By default it is appended to the end of the document, but see also the `tableofcontents` directive for positioning of the ToC.
- ``maxdepth`` (integer): A maximum nesting depth to use when showing the ToC within the document (default -1, meaning infinite).
- ``numbered`` (boolean or integer): Automatically add numbers to all documents within a subtree (default ``False``).
  If set to `True`, all sub-trees will also be numbered based on nesting (e.g. with ``1.1`` or ``1.1.1``),
  or if set to an integer then the numbering will only be applied to that depth.
- ``reversed`` (boolean): If `True` then the entries in the subtree will be listed in reverse order (default ``False``).
  This can be useful when using `glob` entries.
- ``titlesonly`` (boolean): If `True` then only the first heading in the document will be shown in the ToC, not other headings of the same level (default ``False``).

These options can be set at the level of the subtree:

.. code:: yaml

   root: intro
   subtrees:
   - caption: Subtree Caption
     hidden: False
     maxdepth: 1
     numbered: True
     reversed: False
     titlesonly: True
     entries:
     - file: doc1
       subtrees:
       - titlesonly: True
         entries:
         - file: doc2

or, if you are using the shorthand for a single subtree, set options under an ``options`` key:

.. code:: yaml

   root: intro
   options:
     caption: Subtree Caption
     hidden: False
     maxdepth: 1
     numbered: True
     reversed: False
     titlesonly: True
   entries:
   - file: doc1
     options:
       titlesonly: True
     entries:
     - file: doc2

You can also use the top-level ``defaults`` key, to set default options for all subtrees:

.. code:: yaml

   root: intro
   defaults:
     titlesonly: True
   options:
     caption: Subtree Caption
     hidden: False
     maxdepth: 1
     numbered: True
     reversed: False
   entries:
   - file: doc1
     entries:
     - file: doc2

.. warning:: numbered

   ``numbered`` should not generally be used as a default, since numbering
   cannot be changed by nested subtrees, and sphinx will log a warning.

.. note:: title numbering

   By default, title numbering restarts for each subtree.
   If you want want this numbering to be continuous, check-out the
   `sphinx-multitoc-numbering extension <https://github.com/executablebooks/sphinx-multitoc-numbering>`_.

Using different key-mappings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For certain use-cases, it is helpful to map the ``subtrees``/``entries``
keys to mirror e.g. an output
`LaTeX structure <https://www.overleaf.com/learn/latex/sections_and_chapters>`_.

The ``format`` key can be used to provide such mappings (and also initial defaults).
Currently available:

- ``jb-article``:
  - Maps ``entries`` -> ``sections``
  - Sets the default of `titlesonly` to ``true``
- ``jb-book``:
  - Maps the top-level ``subtrees`` to ``parts``
  - Maps the top-level ``entries`` to ``chapters``
  - Maps other levels of ``entries`` to ``sections``
  - Sets the default of ``titlesonly`` to ``true``

For example:

.. code:: yaml

   defaults:
     titlesonly: true
   root: index
   subtrees:
   - entries:
     - file: doc1
       entries:
       - file: doc2

is equivalent to:

.. code:: yaml

   format: jb-book
   root: index
   parts:
   - chapters:
     - file: doc1
       sections:
       - file: doc2

.. important:: key names changes

   These change in key names do not change the output site-map structure

Add a ToC to a page's content
------------------------------

By default, the ``toctree`` generated per document (one per subtree) are
appended to the end of the document and hidden (then, for example, most
HTML themes show them in a side-bar).

But if you would like them to be visible at a certain place within the document body, you may do so by using the ``tableofcontents`` directive:

ReStructuredText:

.. code:: text

   .. tableofcontents::


MyST Markdown:

.. code:: text

   ```{tableofcontents}
   ```

Currently, only one ``tableofcontents`` should be used per page (all
``toctree`` will be added here), and only if it is a page with
child/descendant documents.

Note, this will override the ``hidden`` option set for a subtree.

Excluding files not in ToC
---------------------------

By default, Sphinx will build all document files, regardless of whether
they are specified in the Table of Contents, if they:

1. Have a file extension relating to a loaded parser (e.g. ``.rst`` or ``.md``)

2. Do not match a pattern in
   `exclude_patterns <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-exclude_patterns>`_

To automatically add any document files that do not match a ``file`` or
``glob`` in the ToC to the ``exclude_patterns`` list, add to your ``conf.py``:

.. code:: python

    external_toc_exclude_missing = True

Note that, for performance, files that are in *hidden folders* (e.g.
in ``.tox`` or ``.venv``) will not be added to ``exclude_patterns`` even
if they are not specified in the ToC. You should exclude these folders explicitly.

.. important:: incompatible with orphan files

   This feature is currently incompatible with `orphan files <https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#metadata>`_.

Command-line
-------------

This package comes with the ``sphinx-etoc-strict`` command-line program,
with some additional tools.

To see all options:

.. code: shell

   sphinx-etoc-strict --help

.. code:: text

   Usage: sphinx-etoc-strict [OPTIONS] COMMAND [ARGS]...

     Command-line for sphinx-external-toc-strict.

   Options:
     --version   Show the version and exit.
     -h, --help  Show this message and exit.

   Commands:
     from-project  Create a ToC file from a project directory.
     migrate    Migrate a ToC from a previous revision.
     parse      Parse a ToC file to a site-map YAML.
     to-project    Create a project directory from a ToC file.

To build a template project from only a ToC file:

.. code: shell

   sphinx-etoc-strict to-project -p path/to/site -e rst path/to/_toc.yml

Note, you can also add additional files in ``meta``/``create_files`` and append text to the end of files with ``meta``/``create_append``, e.g.

.. code:: yaml

   root: intro
   entries:
   - glob: doc*
   meta:
     create_append:
       intro: |
         This is some
         appended text
     create_files:
     - doc1
     - doc2
     - doc3

To build a ToC file from an existing site:

.. code: shell

   sphinx-etoc-strict from-project path/to/folder

Some rules used:

- Files/folders will be skipped if they match a pattern added by ``-s`` (based on `[fnmatch docs] <https://docs.python.org/3/library/fnmatch.html>`_ Unix shell-style wildcards)
- Sub-folders with no content files inside will be skipped
- File and folder names will be sorted by `natural order <https://en.wikipedia.org/wiki/Natural_sort_order>`_
- If there is a file called ``index`` (or the name set by ``-i``) in any folder, it will be treated as the index file, otherwise the first file by ordering will be used.

The command can also guess a ``title`` for each file, based on its path:

- The folder name is used for index files, otherwise the file name
- Words are split by ``_``
- The first "word" is removed if it is an integer

For example, for a project with files:

.. code:: text

   index.rst
   1_a_title.rst
   11_another_title.rst
   .hidden_file.rst
   .hidden_folder/index.rst
   1_a_subfolder/index.rst
   2_another_subfolder/index.rst
   2_another_subfolder/other.rst
   3_subfolder/1_no_index.rst
   3_subfolder/2_no_index.rst
   14_subfolder/index.rst
   14_subfolder/subsubfolder/index.rst
   14_subfolder/subsubfolder/other.rst

will create the ToC:

.. code: shell

   sphinx-etoc-strict from-project path/to/folder -i index -s ".*" -e ".rst" -t

.. code:: text

   root: index
   entries:
   - file: 1_a_title
     title: A title
   - file: 11_another_title
     title: Another title
   - file: 1_a_subfolder/index
     title: A subfolder
   - file: 2_another_subfolder/index
     title: Another subfolder
     entries:
     - file: 2_another_subfolder/other
       title: Other
   - file: 3_subfolder/1_no_index
     title: No index
     entries:
     - file: 3_subfolder/2_no_index
       title: No index
   - file: 14_subfolder/index
     title: Subfolder
     entries:
     - file: 14_subfolder/subsubfolder/index
       title: Subsubfolder
       entries:
       - file: 14_subfolder/subsubfolder/other
         title: Other

.. note:: hidden files are unsupported

   On a filesystem, somewhere within your home directory, hidden files
   are meant for config files. Documents are not hidden files!

   The file stem and file suffix handling has improved dramatically.

   But a hidden file, like ``.hidden_file.rst``, and ``.tar.gz`` looks
   similar. Both have no file stem

   Either can have markdown support or hidden file support, not both.
   Fate chose markdown support; that's the way the dice rolled


API
----

The ToC file is parsed to a ``SiteMap``, which is a ``MutableMapping``
subclass, with keys representing docnames mapping to a ``Document`` that
stores information on the toctrees it should contain:

.. code:: python

    from sphinx_external_toc.parsing_strict import parse_toc_yaml, dump_yaml

    path = "path/to/_toc.yml"
    site_map = parse_toc_yaml(path)
    dump_yaml(site_map)

Would produce e.g.

.. code:: yaml

   root: intro
   documents:
     doc1:
       docname: doc1
       subtrees: []
       title: null
     intro:
       docname: intro
       subtrees:
       - caption: Subtree Caption
         numbered: true
         reversed: false
         items:
         - doc1
         titlesonly: true
       title: null
   meta: {}

Development Notes
------------------

Questions / TODOs:

- Add additional top-level keys, e.g. ``appendices`` (see `sphinx#2502 <https://github.com/sphinx-doc/sphinx/issues/2502>`_) and ``bibliography``
- Integrate `sphinx-multitoc-numbering <https://github.com/executablebooks/sphinx-multitoc-numbering>`_ into this extension? (or upstream PR)
- document suppressing warnings
- test against orphan file
- `sphinx-book-theme#304 <https://github.com/executablebooks/sphinx-book-theme/pull/304>`_
- CLI command to generate toc from existing documentation ``toctrees`` (and then remove toctree directives)
- test rebuild on toc changes (and document how rebuilds are controlled when toc changes)
- some jupyter-book issues point to potential changes in numbering, based on where the ``toctree`` is in the document.
  So could look into placing it e.g. under the first heading/title

.. |last-commit| image:: https://img.shields.io/github/last-commit/msftcangoblowm/sphinx-external-toc-strict/main
    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/pulse
    :alt: last commit to gauge activity
.. |test-status| image:: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/testsuite.yml/badge.svg?branch=main&event=push
    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/testsuite.yml
    :alt: Test suite status
.. |quality-status| image:: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/quality.yml/badge.svg?branch=main&event=push
    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/quality.yml
    :alt: Quality check status
.. |docs| image:: https://readthedocs.org/projects/sphinx-external-toc-strict/badge/?version=latest&style=flat
    :target: https://sphinx-external-toc-strict.readthedocs.io/
    :alt: Documentation
.. |kit| image:: https://img.shields.io/pypi/v/sphinx-external-toc-strict
    :target: https://pypi.org/project/sphinx-external-toc-strict/
    :alt: PyPI status
.. |versions| image:: https://img.shields.io/pypi/pyversions/sphinx-external-toc-strict.svg?logo=python&logoColor=FBE072
    :target: https://pypi.org/project/sphinx-external-toc-strict/
    :alt: Python versions supported
.. |license| image:: https://img.shields.io/github/license/msftcangoblowm/sphinx-external-toc-strict
    :target: https://pypi.org/project/sphinx-external-toc-strict/blob/master/LICENSE.txt
    :alt: License
.. |stars| image:: https://img.shields.io/github/stars/msftcangoblowm/sphinx-external-toc-strict.svg?logo=github
    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/stargazers
    :alt: GitHub stars
.. |mastodon-msftcangoblowm| image:: https://img.shields.io/mastodon/follow/112019041247183249
    :target: https://mastodon.social/@msftcangoblowme
    :alt: msftcangoblowme on Mastodon
.. |codecov| image:: https://codecov.io/gh/msftcangoblowm/sphinx-external-toc-strict/branch/main/graph/badge.svg?token=HCBC74IABR
    :target: https://codecov.io/gh/msftcangoblowm/sphinx-external-toc-strict
    :alt: sphinx-external-toc-strict coverage percentage
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/ambv/black

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sphinx-external-toc-strict",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "sphinx, extension, toc, strictyaml",
    "author": null,
    "author_email": "Dave Faulkmore <faulkmore@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d9/76/1bae986046b639f478dab73766f3d4aaaf2f3e384b70d2994a42bc022069/sphinx_external_toc_strict-1.1.7.tar.gz",
    "platform": null,
    "description": ".. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0\n.. For details: https://github.com/msftcangoblowm/sphinx-external-toc-strict/blob/master/NOTICE.txt\n\nsphinx-external-toc-strict\n===========================\n\nA sphinx extension that allows the documentation site-map (a.k.a Table of Contents) to be defined external to the documentation files.\n\n|  |last-commit| |codecov| |license|\n|  |test-status| |quality-status| |docs|\n|  |kit| |versions| |black|\n|  |stars| |mastodon-msftcangoblowm|\n\nIn normal Sphinx documentation, the documentation site-map is defined\n*via* a bottom-up approach - adding\n`toctree directives <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-of-contents>`_\nwithin pages of the documentation.\n\nThis extension facilitates a **top-down** approach to defining the\nsite-map structure, within a single YAML file.\n\n.. image:: https://raw.githubusercontent.com/msftcangoblowm/sphinx-external-toc-strict/main/docs/_static/toc-graphic.png\n   :alt: ToC graphic\n   :width: 1770px\n   :height: 908px\n\nIt also allows for documents not specified in the ToC to be auto-excluded.\n\n.. PYVERSIONS\n\n* Python 3.9 through 3.12, and 3.13.0a3 and up.\n\n**New in 1.1.x:**\n\nfork project; drop pyyaml support transition to strictyaml; use both markdown and restructuredtext;\ncode manual; semantic versioning; badges;\n\nThis is a fork\n---------------\n\nsphinx-external-toc-strict is a fork of sphinx-external-toc\n\n.. csv-table:: Comparison\n   :header: \"Matric\", \"TOC\", \"TOC-Strict\"\n   :widths: auto\n\n   \"yaml package\", `pyyaml / yaml <https://hitchdev.com/strictyaml/why-not/>`_, `strictyaml / ruemel.yaml <https://hitchdev.com/strictyaml/why/>`_\n   \".hidden.files.rst\", \"Yes\", \"No\"\n   \"docs theme\", `sphinx-book-theme <https://sphinx-book-theme.readthedocs.io/en/latest>`_, `alabaster <https://alabaster.readthedocs.io/en/latest/>`_\n   \"markdown support\", \"Yes\", \"Yes\"\n   \"both\", `No <https://github.com/executablebooks/sphinx-external-toc/#development-notes>`_, \"Yes, root doc must be ``index.rst``\"\n   \"dump yaml\", \"use yaml.dump\", \"[package].parsing_strictyaml.dump_yaml\"\n   \"static type checking\", \"patchy\", \"Yes (99%)\"\n   \"coverage\", \"patchy\", \"maximium\"\n   \"in-code manual\", \"No\", \"Yes\"\n\nThe core API should be compatible. To avoid confusion, on the command line, rather than ``sphinx-etoc``, use ``sphinx-etoc-strict``\n\nThe author of sphinx-external-toc `[source ToC] <https://pypi.org/project/sphinx_external_toc/>`_ is Chris Sewell\n\nThe author of sphinx-external-toc-strict `[source ToC-strict] <https://pypi.org/project/sphinx-external-toc-strict/>`_ is Dave Faulkmore\n\nUser Guide\n------------\n\nSphinx Configuration\n^^^^^^^^^^^^^^^^^^^^^\n\nAdd to your ``conf.py``:\n\n.. code:: python\n\n    source_suffix = [\".md\", \".rst\"]\n    extensions = [\"sphinx_external_toc_strict\", \"myst-parser\"]\n    external_toc_path = \"_toc.yml\"  # optional, default: _toc.yml\n    external_toc_exclude_missing = True\n\nOr to your ``pyproject.toml``:\n\n.. code:: text\n\n   [tool.sphinx-pyproject]\n   source_suffix = [\".md\", \".rst\"]\n   extensions = [\n       \"sphinx.ext.autodoc\",\n       \"sphinx.ext.autosectionlabel\",\n       \"sphinx.ext.todo\",\n       \"sphinx.ext.doctest\",\n       \"sphinx_paramlinks\",\n       \"sphinx.ext.intersphinx\",\n       \"sphinx.ext.extlinks\",\n       \"sphinx_external_toc_strict\",\n       \"myst_parser\",\n   ]\n   external_toc_path = \"_toc.yml\"  # optional, default: _toc.yml\n   external_toc_exclude_missing = true\n   myst_enable_extensions = [\"colon_fence\", \"html_image\"]\n\n\nNote the ``external_toc_path`` is always read as a Unix path, and can\neither be specified relative to the source directory (recommended) or\nas an absolute path.\n\nBasic Structure\n^^^^^^^^^^^^^^^^\n\nA minimal ToC defines the top level ``root`` key, for a single root document file:\n\n.. code:: yaml\n\n   root: intro\n\nThe value of the ``root`` key will be a path to a file, in Unix format\n(folders split by ``/``), relative to the source directory, and can be\nwith or without the file extension.\n\n.. note:: Configure root file\n\n   This root file will be set as the\n   `master_doc <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-master_doc>`_.\n\nDocument files can then have a ``subtrees`` key - denoting a list of\nindividual toctrees for that document - and in-turn each subtree should\nhave a ``entries`` key - denoting a list of children links, that are one of:\n\n- ``file``: path to a single document file in Unix format,  with or without the file extension (as for ``root``)\n- ``glob``: path to one or more document files *via* Unix shell-style wildcards (similar to `fnmatch <https://docs.python.org/3/library/fnmatch.html>`_, but single stars don't match slashes.)\n- ``url``: path for an external URL (starting e.g. ``http`` or ``https``)\n\n.. important::\n\n   Each document file can only occur once in the ToC!\n\nThis can proceed recursively to any depth.\n\n.. code:: yaml\n\n   root: intro\n   subtrees:\n   - entries:\n     - file: doc1\n       subtrees:\n       - entries:\n         - file: doc2\n           subtrees:\n           - entries:\n             - file: doc3\n     - url: https://example.com\n     - glob: subfolder/other*\n\nThis is equivalent to having a single ``toctree`` directive in\n``intro``, containing ``doc1``, and a single ``toctree`` directive in\n``doc1``, with the ``glob:`` flag and containing ``doc2``,\n``https://example.com`` and ``subfolder/other*``.\n\nAs a shorthand, the ``entries`` key can be at the same level as the\n``file``, which denotes a document with a single subtree.\n\nFor example, this file is exactly equivalent to the one above:\n\n.. code:: yaml\n\n   root: intro\n   entries:\n   - file: doc1\n     entries:\n     - file: doc2\n       entries:\n       - file: doc3\n   - url: https://example.com\n   - glob: subfolder/other*\n\nFile and URL titles\n^^^^^^^^^^^^^^^^^^^^\n\nBy default, the initial header within a ``file`` document will be used\nas its title in generated Table of Contents. With the ``title`` key you\ncan set an alternative title for a document. and also for ``url``:\n\n.. code:: yaml\n\n   root: intro\n   subtrees:\n   - entries:\n     - file: doc1\n       title: Document 1 Title\n     - url: https://example.com\n       title: Example URL Title\n\nToC tree options\n^^^^^^^^^^^^^^^^^\n\nEach subtree can be configured with a number of options (see also\n`sphinx toctree options <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree>`_):\n\n- ``caption`` (string): A title for the whole the subtree, e.g. shown above the subtree in ToCs\n- ``hidden`` (boolean): Whether to show the ToC within (inline of) the document (default ``False``).\n  By default it is appended to the end of the document, but see also the `tableofcontents` directive for positioning of the ToC.\n- ``maxdepth`` (integer): A maximum nesting depth to use when showing the ToC within the document (default -1, meaning infinite).\n- ``numbered`` (boolean or integer): Automatically add numbers to all documents within a subtree (default ``False``).\n  If set to `True`, all sub-trees will also be numbered based on nesting (e.g. with ``1.1`` or ``1.1.1``),\n  or if set to an integer then the numbering will only be applied to that depth.\n- ``reversed`` (boolean): If `True` then the entries in the subtree will be listed in reverse order (default ``False``).\n  This can be useful when using `glob` entries.\n- ``titlesonly`` (boolean): If `True` then only the first heading in the document will be shown in the ToC, not other headings of the same level (default ``False``).\n\nThese options can be set at the level of the subtree:\n\n.. code:: yaml\n\n   root: intro\n   subtrees:\n   - caption: Subtree Caption\n     hidden: False\n     maxdepth: 1\n     numbered: True\n     reversed: False\n     titlesonly: True\n     entries:\n     - file: doc1\n       subtrees:\n       - titlesonly: True\n         entries:\n         - file: doc2\n\nor, if you are using the shorthand for a single subtree, set options under an ``options`` key:\n\n.. code:: yaml\n\n   root: intro\n   options:\n     caption: Subtree Caption\n     hidden: False\n     maxdepth: 1\n     numbered: True\n     reversed: False\n     titlesonly: True\n   entries:\n   - file: doc1\n     options:\n       titlesonly: True\n     entries:\n     - file: doc2\n\nYou can also use the top-level ``defaults`` key, to set default options for all subtrees:\n\n.. code:: yaml\n\n   root: intro\n   defaults:\n     titlesonly: True\n   options:\n     caption: Subtree Caption\n     hidden: False\n     maxdepth: 1\n     numbered: True\n     reversed: False\n   entries:\n   - file: doc1\n     entries:\n     - file: doc2\n\n.. warning:: numbered\n\n   ``numbered`` should not generally be used as a default, since numbering\n   cannot be changed by nested subtrees, and sphinx will log a warning.\n\n.. note:: title numbering\n\n   By default, title numbering restarts for each subtree.\n   If you want want this numbering to be continuous, check-out the\n   `sphinx-multitoc-numbering extension <https://github.com/executablebooks/sphinx-multitoc-numbering>`_.\n\nUsing different key-mappings\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFor certain use-cases, it is helpful to map the ``subtrees``/``entries``\nkeys to mirror e.g. an output\n`LaTeX structure <https://www.overleaf.com/learn/latex/sections_and_chapters>`_.\n\nThe ``format`` key can be used to provide such mappings (and also initial defaults).\nCurrently available:\n\n- ``jb-article``:\n  - Maps ``entries`` -> ``sections``\n  - Sets the default of `titlesonly` to ``true``\n- ``jb-book``:\n  - Maps the top-level ``subtrees`` to ``parts``\n  - Maps the top-level ``entries`` to ``chapters``\n  - Maps other levels of ``entries`` to ``sections``\n  - Sets the default of ``titlesonly`` to ``true``\n\nFor example:\n\n.. code:: yaml\n\n   defaults:\n     titlesonly: true\n   root: index\n   subtrees:\n   - entries:\n     - file: doc1\n       entries:\n       - file: doc2\n\nis equivalent to:\n\n.. code:: yaml\n\n   format: jb-book\n   root: index\n   parts:\n   - chapters:\n     - file: doc1\n       sections:\n       - file: doc2\n\n.. important:: key names changes\n\n   These change in key names do not change the output site-map structure\n\nAdd a ToC to a page's content\n------------------------------\n\nBy default, the ``toctree`` generated per document (one per subtree) are\nappended to the end of the document and hidden (then, for example, most\nHTML themes show them in a side-bar).\n\nBut if you would like them to be visible at a certain place within the document body, you may do so by using the ``tableofcontents`` directive:\n\nReStructuredText:\n\n.. code:: text\n\n   .. tableofcontents::\n\n\nMyST Markdown:\n\n.. code:: text\n\n   ```{tableofcontents}\n   ```\n\nCurrently, only one ``tableofcontents`` should be used per page (all\n``toctree`` will be added here), and only if it is a page with\nchild/descendant documents.\n\nNote, this will override the ``hidden`` option set for a subtree.\n\nExcluding files not in ToC\n---------------------------\n\nBy default, Sphinx will build all document files, regardless of whether\nthey are specified in the Table of Contents, if they:\n\n1. Have a file extension relating to a loaded parser (e.g. ``.rst`` or ``.md``)\n\n2. Do not match a pattern in\n   `exclude_patterns <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-exclude_patterns>`_\n\nTo automatically add any document files that do not match a ``file`` or\n``glob`` in the ToC to the ``exclude_patterns`` list, add to your ``conf.py``:\n\n.. code:: python\n\n    external_toc_exclude_missing = True\n\nNote that, for performance, files that are in *hidden folders* (e.g.\nin ``.tox`` or ``.venv``) will not be added to ``exclude_patterns`` even\nif they are not specified in the ToC. You should exclude these folders explicitly.\n\n.. important:: incompatible with orphan files\n\n   This feature is currently incompatible with `orphan files <https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#metadata>`_.\n\nCommand-line\n-------------\n\nThis package comes with the ``sphinx-etoc-strict`` command-line program,\nwith some additional tools.\n\nTo see all options:\n\n.. code: shell\n\n   sphinx-etoc-strict --help\n\n.. code:: text\n\n   Usage: sphinx-etoc-strict [OPTIONS] COMMAND [ARGS]...\n\n     Command-line for sphinx-external-toc-strict.\n\n   Options:\n     --version   Show the version and exit.\n     -h, --help  Show this message and exit.\n\n   Commands:\n     from-project  Create a ToC file from a project directory.\n     migrate    Migrate a ToC from a previous revision.\n     parse      Parse a ToC file to a site-map YAML.\n     to-project    Create a project directory from a ToC file.\n\nTo build a template project from only a ToC file:\n\n.. code: shell\n\n   sphinx-etoc-strict to-project -p path/to/site -e rst path/to/_toc.yml\n\nNote, you can also add additional files in ``meta``/``create_files`` and append text to the end of files with ``meta``/``create_append``, e.g.\n\n.. code:: yaml\n\n   root: intro\n   entries:\n   - glob: doc*\n   meta:\n     create_append:\n       intro: |\n         This is some\n         appended text\n     create_files:\n     - doc1\n     - doc2\n     - doc3\n\nTo build a ToC file from an existing site:\n\n.. code: shell\n\n   sphinx-etoc-strict from-project path/to/folder\n\nSome rules used:\n\n- Files/folders will be skipped if they match a pattern added by ``-s`` (based on `[fnmatch docs] <https://docs.python.org/3/library/fnmatch.html>`_ Unix shell-style wildcards)\n- Sub-folders with no content files inside will be skipped\n- File and folder names will be sorted by `natural order <https://en.wikipedia.org/wiki/Natural_sort_order>`_\n- If there is a file called ``index`` (or the name set by ``-i``) in any folder, it will be treated as the index file, otherwise the first file by ordering will be used.\n\nThe command can also guess a ``title`` for each file, based on its path:\n\n- The folder name is used for index files, otherwise the file name\n- Words are split by ``_``\n- The first \"word\" is removed if it is an integer\n\nFor example, for a project with files:\n\n.. code:: text\n\n   index.rst\n   1_a_title.rst\n   11_another_title.rst\n   .hidden_file.rst\n   .hidden_folder/index.rst\n   1_a_subfolder/index.rst\n   2_another_subfolder/index.rst\n   2_another_subfolder/other.rst\n   3_subfolder/1_no_index.rst\n   3_subfolder/2_no_index.rst\n   14_subfolder/index.rst\n   14_subfolder/subsubfolder/index.rst\n   14_subfolder/subsubfolder/other.rst\n\nwill create the ToC:\n\n.. code: shell\n\n   sphinx-etoc-strict from-project path/to/folder -i index -s \".*\" -e \".rst\" -t\n\n.. code:: text\n\n   root: index\n   entries:\n   - file: 1_a_title\n     title: A title\n   - file: 11_another_title\n     title: Another title\n   - file: 1_a_subfolder/index\n     title: A subfolder\n   - file: 2_another_subfolder/index\n     title: Another subfolder\n     entries:\n     - file: 2_another_subfolder/other\n       title: Other\n   - file: 3_subfolder/1_no_index\n     title: No index\n     entries:\n     - file: 3_subfolder/2_no_index\n       title: No index\n   - file: 14_subfolder/index\n     title: Subfolder\n     entries:\n     - file: 14_subfolder/subsubfolder/index\n       title: Subsubfolder\n       entries:\n       - file: 14_subfolder/subsubfolder/other\n         title: Other\n\n.. note:: hidden files are unsupported\n\n   On a filesystem, somewhere within your home directory, hidden files\n   are meant for config files. Documents are not hidden files!\n\n   The file stem and file suffix handling has improved dramatically.\n\n   But a hidden file, like ``.hidden_file.rst``, and ``.tar.gz`` looks\n   similar. Both have no file stem\n\n   Either can have markdown support or hidden file support, not both.\n   Fate chose markdown support; that's the way the dice rolled\n\n\nAPI\n----\n\nThe ToC file is parsed to a ``SiteMap``, which is a ``MutableMapping``\nsubclass, with keys representing docnames mapping to a ``Document`` that\nstores information on the toctrees it should contain:\n\n.. code:: python\n\n    from sphinx_external_toc.parsing_strict import parse_toc_yaml, dump_yaml\n\n    path = \"path/to/_toc.yml\"\n    site_map = parse_toc_yaml(path)\n    dump_yaml(site_map)\n\nWould produce e.g.\n\n.. code:: yaml\n\n   root: intro\n   documents:\n     doc1:\n       docname: doc1\n       subtrees: []\n       title: null\n     intro:\n       docname: intro\n       subtrees:\n       - caption: Subtree Caption\n         numbered: true\n         reversed: false\n         items:\n         - doc1\n         titlesonly: true\n       title: null\n   meta: {}\n\nDevelopment Notes\n------------------\n\nQuestions / TODOs:\n\n- Add additional top-level keys, e.g. ``appendices`` (see `sphinx#2502 <https://github.com/sphinx-doc/sphinx/issues/2502>`_) and ``bibliography``\n- Integrate `sphinx-multitoc-numbering <https://github.com/executablebooks/sphinx-multitoc-numbering>`_ into this extension? (or upstream PR)\n- document suppressing warnings\n- test against orphan file\n- `sphinx-book-theme#304 <https://github.com/executablebooks/sphinx-book-theme/pull/304>`_\n- CLI command to generate toc from existing documentation ``toctrees`` (and then remove toctree directives)\n- test rebuild on toc changes (and document how rebuilds are controlled when toc changes)\n- some jupyter-book issues point to potential changes in numbering, based on where the ``toctree`` is in the document.\n  So could look into placing it e.g. under the first heading/title\n\n.. |last-commit| image:: https://img.shields.io/github/last-commit/msftcangoblowm/sphinx-external-toc-strict/main\n    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/pulse\n    :alt: last commit to gauge activity\n.. |test-status| image:: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/testsuite.yml/badge.svg?branch=main&event=push\n    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/testsuite.yml\n    :alt: Test suite status\n.. |quality-status| image:: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/quality.yml/badge.svg?branch=main&event=push\n    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/actions/workflows/quality.yml\n    :alt: Quality check status\n.. |docs| image:: https://readthedocs.org/projects/sphinx-external-toc-strict/badge/?version=latest&style=flat\n    :target: https://sphinx-external-toc-strict.readthedocs.io/\n    :alt: Documentation\n.. |kit| image:: https://img.shields.io/pypi/v/sphinx-external-toc-strict\n    :target: https://pypi.org/project/sphinx-external-toc-strict/\n    :alt: PyPI status\n.. |versions| image:: https://img.shields.io/pypi/pyversions/sphinx-external-toc-strict.svg?logo=python&logoColor=FBE072\n    :target: https://pypi.org/project/sphinx-external-toc-strict/\n    :alt: Python versions supported\n.. |license| image:: https://img.shields.io/github/license/msftcangoblowm/sphinx-external-toc-strict\n    :target: https://pypi.org/project/sphinx-external-toc-strict/blob/master/LICENSE.txt\n    :alt: License\n.. |stars| image:: https://img.shields.io/github/stars/msftcangoblowm/sphinx-external-toc-strict.svg?logo=github\n    :target: https://github.com/msftcangoblowm/sphinx-external-toc-strict/stargazers\n    :alt: GitHub stars\n.. |mastodon-msftcangoblowm| image:: https://img.shields.io/mastodon/follow/112019041247183249\n    :target: https://mastodon.social/@msftcangoblowme\n    :alt: msftcangoblowme on Mastodon\n.. |codecov| image:: https://codecov.io/gh/msftcangoblowm/sphinx-external-toc-strict/branch/main/graph/badge.svg?token=HCBC74IABR\n    :target: https://codecov.io/gh/msftcangoblowm/sphinx-external-toc-strict\n    :alt: sphinx-external-toc-strict coverage percentage\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/ambv/black\n",
    "bugtrack_url": null,
    "license": " Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS ",
    "summary": "A sphinx extension that allows the site-map to be defined in a single YAML file.",
    "version": "1.1.7",
    "project_urls": {
        "Changes": "https://raw.githubusercontent.com/msftcangoblowm/sphinx-external-toc-strict/main/CHANGES.rst",
        "Chat": "https://mastodon.social/@msftcangoblowme",
        "Documentation": "https://sphinx-external-toc-strict.readthedocs.io",
        "Issue tracker": "https://github.com/msftcangoblowm/sphinx-external-toc-strict/issues",
        "PyPI Releases": "https://pypi.org/project/sphinx-external-toc-strict",
        "Source code": "https://github.com/msftcangoblowm/sphinx-external-toc-strict"
    },
    "split_keywords": [
        "sphinx",
        " extension",
        " toc",
        " strictyaml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d71f6b04610cba98025e753855a51c630630d9124b56dd5b170ab60891768ac",
                "md5": "3cca835e52d892a24ac98375b7b233a9",
                "sha256": "50256920794aeb4efe345cdfedc4d18c6bc5ca68d89512a1e2aaacbf8c4fbc23"
            },
            "downloads": -1,
            "filename": "sphinx_external_toc_strict-1.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3cca835e52d892a24ac98375b7b233a9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 64238,
            "upload_time": "2024-04-19T06:51:48",
            "upload_time_iso_8601": "2024-04-19T06:51:48.554154Z",
            "url": "https://files.pythonhosted.org/packages/4d/71/f6b04610cba98025e753855a51c630630d9124b56dd5b170ab60891768ac/sphinx_external_toc_strict-1.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9761bae986046b639f478dab73766f3d4aaaf2f3e384b70d2994a42bc022069",
                "md5": "479f1b0451ac71df5b3d9e8ea226822c",
                "sha256": "b034197bbc09f9532a2989ea035810b8acfb9b19d520411e436a9fc04a8a6c33"
            },
            "downloads": -1,
            "filename": "sphinx_external_toc_strict-1.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "479f1b0451ac71df5b3d9e8ea226822c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 458378,
            "upload_time": "2024-04-19T06:51:50",
            "upload_time_iso_8601": "2024-04-19T06:51:50.897224Z",
            "url": "https://files.pythonhosted.org/packages/d9/76/1bae986046b639f478dab73766f3d4aaaf2f3e384b70d2994a42bc022069/sphinx_external_toc_strict-1.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 06:51:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "msftcangoblowm",
    "github_project": "sphinx-external-toc-strict",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "sphinx-external-toc-strict"
}
        
Elapsed time: 0.24871s