Skip to content

Commit e1fe59f

Browse files
committed
deploy: 4daccc9
1 parent aee932d commit e1fe59f

12 files changed

Lines changed: 111 additions & 22 deletions

File tree

_sources/reference/_autoapi/docbuild/cli/cmd_validate/index.rst.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ Functions
2929
Package Contents
3030
----------------
3131

32-
.. py:function:: validate(ctx: click.Context, xmlfiles: tuple | collections.abc.Iterator[pathlib.Path]) -> None
32+
.. py:function:: validate(ctx: click.Context, xmlfiles: tuple | collections.abc.Iterator[pathlib.Path], validation_method: str) -> None
3333
3434
Subcommand to validate XML configuration files.
3535

3636
:param ctx: The Click context object.
37+
:param xmlfiles: XML files to validate, if empty all XMLs in config dir are used.
38+
:param validation_method: Validation method to use, 'jing' or 'lxml'.
3739

3840

_sources/reference/_autoapi/docbuild/cli/cmd_validate/process/index.rst.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Functions
1717
docbuild.cli.cmd_validate.process.display_results
1818
docbuild.cli.cmd_validate.process.run_command
1919
docbuild.cli.cmd_validate.process.validate_rng
20+
docbuild.cli.cmd_validate.process.validate_rng_lxml
2021
docbuild.cli.cmd_validate.process.run_python_checks
2122
docbuild.cli.cmd_validate.process.process_file
2223
docbuild.cli.cmd_validate.process.process
@@ -47,7 +48,7 @@ Module Contents
4748
:raises FileNotFoundError: if the command is not found.
4849

4950

50-
.. py:function:: validate_rng(xmlfile: pathlib.Path, rng_schema_path: pathlib.Path = PRODUCT_CONFIG_SCHEMA, *, xinclude: bool = True) -> tuple[bool, str]
51+
.. py:function:: validate_rng(xmlfile: pathlib.Path, rng_schema_path: pathlib.Path = PRODUCT_CONFIG_SCHEMA, *, xinclude: bool = True, idcheck: bool = True) -> tuple[bool, str]
5152
:async:
5253

5354

@@ -58,12 +59,24 @@ Module Contents
5859
more robust for complex XInclude statements, including those with XPointer.
5960

6061
:param xmlfile: The path to the XML file to validate.
61-
:param rng_schema_path: The path to the RELAX NG schema file. It supports
62-
both RNC and RNG formats.
62+
:param rng_schema_path: The path to the RELAX NG schema file. It supports both RNC and RNG formats.
6363
:param xinclude: If True, resolve XIncludes with `xmllint` before validation.
64+
:param idcheck: If True, perform ID uniqueness checks.
6465
:return: A tuple containing a boolean success status and any output message.
6566

6667

68+
.. py:function:: validate_rng_lxml(xmlfile: pathlib.Path, rng_schema_path: pathlib.Path = PRODUCT_CONFIG_SCHEMA) -> tuple[bool, str]
69+
70+
Validate an XML file against a RELAX NG (.rng) schema using lxml.
71+
72+
This function uses lxml.etree.RelaxNG, which supports only the XML syntax
73+
of RELAX NG schemas (i.e., .rng files, not .rnc files).
74+
75+
:param xmlfile: Path to the XML file to validate.
76+
:param rng_schema_path: Path to the RELAX NG (.rng) schema file.
77+
:return: Tuple of (is_valid: bool, error_message: str)
78+
79+
6780
.. py:function:: run_python_checks(tree: lxml.etree._ElementTree) -> list[tuple[str, docbuild.config.xml.checks.CheckResult]]
6881
:async:
6982

_sources/reference/_autoapi/docbuild/cli/context/DocBuildContext.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,12 @@ docbuild.cli.context.DocBuildContext
9595
If set, enable debug mode
9696

9797

98+
99+
.. py:attribute:: validation_method
100+
:type: str
101+
:value: 'jing'
102+
103+
104+
Method used to validate XML files: 'jing' (default) or 'lxml'
105+
106+

_sources/user/build.rst.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ The fields in the doctype have the following meanings:
3737

3838
Some common examples of doctypes are:
3939

40-
* ``//en-us``: Matches all supported deliverables in English.
41-
* ``sles/*/en-us``: Matches all SLES deliverables in English, regardless of the docset or lifecycle.
40+
* ``sles/15-SP6/en-us``: Matches the English deliverables for SLES 15-SP6, regardless of the lifecycle.
41+
* ``*/*/de-de``: Matches all deliverables in German, regardless of the product, docset, or lifecycle.
42+
* ``//en-us``: Matches all deliverables in English, regardless of product, docset, or lifecycle. This is a shorter version of ``*/*/en-us``.
43+
* ``sles//en-us``: Matches all English SLES deliverables, regardless of the docset or lifecycle.
4244
* ``sle-ha//@unsupported/en-us,de-de``: Matches all SLE-HA deliverables in English and German that are in the unsupported lifecycle, regardless of the docset.
43-
* ``"*/@beta,supported/de-de"``: Matches all SLES deliverables in German that are in the beta or supported lifecycle, regardless of the product.
45+
* ``*/@beta,supported/de-de``: Matches all SLES deliverables in German that are in the beta or supported lifecycle, regardless of the product.
46+
* ``//``: Matches all deliverables in all languages, regardless of the product, docset, or lifecycle. This is the simplest doctype and matches everything.
4447

4548

4649
Minimal set of doctypes
@@ -54,4 +57,4 @@ The command tries to find overlaps in the specified doctypes and only builds the
5457
5558
[1] sles/*/en-us + sles/15-SP6/en-us => sles/*/en-us
5659
[2] sles/*/en-us + sles/15-SP6/de-de => sles/*/en-us,sles/15-SP6/de-de
57-
[3] sles/15-SP6/en-us + sles/15-SP6/de-de => sles/15-SP6/en-us,de-de
60+
[3] sles/15-SP6/en-us + sles/15-SP6/de-de => sles/15-SP6/en-us,de-de

genindex.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,20 @@ <h2 id="Symbols">Symbols</h2>
467467
<li><a href="reference/docbuild-cli.html#cmdoption-docbuild-env-config">docbuild command line option</a>
468468
</li>
469469
</ul></li>
470-
</ul></td>
471-
<td style="width: 33%; vertical-align: top;"><ul>
472470
<li>
473471
--no-debug
474472

475473
<ul>
476474
<li><a href="reference/docbuild-cli.html#cmdoption-docbuild-debug">docbuild command line option</a>
475+
</li>
476+
</ul></li>
477+
</ul></td>
478+
<td style="width: 33%; vertical-align: top;"><ul>
479+
<li>
480+
--validation-method
481+
482+
<ul>
483+
<li><a href="reference/docbuild-cli.html#cmdoption-docbuild-validate-validation-method">docbuild-validate command line option</a>
477484
</li>
478485
</ul></li>
479486
<li>
@@ -808,6 +815,8 @@ <h2 id="D">D</h2>
808815
docbuild-validate command line option
809816

810817
<ul>
818+
<li><a href="reference/docbuild-cli.html#cmdoption-docbuild-validate-validation-method">--validation-method</a>
819+
</li>
811820
<li><a href="reference/docbuild-cli.html#cmdoption-docbuild-validate-arg-XMLFILES">XMLFILES</a>
812821
</li>
813822
</ul></li>
@@ -1683,9 +1692,13 @@ <h2 id="V">V</h2>
16831692
<li><a href="reference/_autoapi/docbuild/models/language/LanguageCode.html#docbuild.models.language.LanguageCode.validate_language">validate_language() (docbuild.models.language.LanguageCode class method)</a>
16841693
</li>
16851694
<li><a href="reference/_autoapi/docbuild/cli/cmd_validate/process/index.html#docbuild.cli.cmd_validate.process.validate_rng">validate_rng() (in module docbuild.cli.cmd_validate.process)</a>
1695+
</li>
1696+
<li><a href="reference/_autoapi/docbuild/cli/cmd_validate/process/index.html#docbuild.cli.cmd_validate.process.validate_rng_lxml">validate_rng_lxml() (in module docbuild.cli.cmd_validate.process)</a>
16861697
</li>
16871698
</ul></td>
16881699
<td style="width: 33%; vertical-align: top;"><ul>
1700+
<li><a href="reference/_autoapi/docbuild/cli/context/DocBuildContext.html#docbuild.cli.context.DocBuildContext.validation_method">validation_method (docbuild.cli.context.DocBuildContext attribute)</a>
1701+
</li>
16891702
<li><a href="glossary.html#term-VENV"><strong>VENV</strong></a>
16901703
</li>
16911704
<li><a href="reference/_autoapi/docbuild/cli/context/DocBuildContext.html#docbuild.cli.context.DocBuildContext.verbose">verbose (docbuild.cli.context.DocBuildContext attribute)</a>

objects.inv

40 Bytes
Binary file not shown.

reference/_autoapi/docbuild/cli/cmd_validate/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,15 @@ <h2>Functions<a class="headerlink" href="#functions" title="Link to this heading
590590
<h2>Package Contents<a class="headerlink" href="#package-contents" title="Link to this heading">#</a></h2>
591591
<dl class="py function">
592592
<dt class="sig sig-object py" id="docbuild.cli.cmd_validate.validate">
593-
<span class="sig-prename descclassname"><span class="pre">docbuild.cli.cmd_validate.</span></span><span class="sig-name descname"><span class="pre">validate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ctx</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://click.palletsprojects.com/en/latest/api/#click.Context" title="(in Click v8.2.x)"><span class="pre">click.Context</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">xmlfiles</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.13)"><span class="pre">tuple</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator" title="(in Python v3.13)"><span class="pre">collections.abc.Iterator</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/pathlib.html#pathlib.Path" title="(in Python v3.13)"><span class="pre">pathlib.Path</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#docbuild.cli.cmd_validate.validate" title="Link to this definition">#</a></dt>
593+
<span class="sig-prename descclassname"><span class="pre">docbuild.cli.cmd_validate.</span></span><span class="sig-name descname"><span class="pre">validate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ctx</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://click.palletsprojects.com/en/latest/api/#click.Context" title="(in Click v8.2.x)"><span class="pre">click.Context</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">xmlfiles</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.13)"><span class="pre">tuple</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator" title="(in Python v3.13)"><span class="pre">collections.abc.Iterator</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/pathlib.html#pathlib.Path" title="(in Python v3.13)"><span class="pre">pathlib.Path</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">validation_method</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><span class="pre">None</span></a></span></span><a class="headerlink" href="#docbuild.cli.cmd_validate.validate" title="Link to this definition">#</a></dt>
594594
<dd><p>Subcommand to validate XML configuration files.</p>
595595
<dl class="field-list simple">
596596
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
597-
<dd class="field-odd"><p><strong>ctx</strong> – The Click context object.</p>
597+
<dd class="field-odd"><ul class="simple">
598+
<li><p><strong>ctx</strong> – The Click context object.</p></li>
599+
<li><p><strong>xmlfiles</strong> – XML files to validate, if empty all XMLs in config dir are used.</p></li>
600+
<li><p><strong>validation_method</strong> – Validation method to use, ‘jing’ or ‘lxml’.</p></li>
601+
</ul>
598602
</dd>
599603
</dl>
600604
</dd></dl>

0 commit comments

Comments
 (0)