From 8a8b61de9de92889a19306bf9ffb4a5bc55582db Mon Sep 17 00:00:00 2001 From: Pablo Garay Date: Mon, 27 Oct 2025 12:32:12 -0700 Subject: [PATCH 1/5] feat: add build-docs check Signed-off-by: Pablo Garay --- .github/workflows/build-docs.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/build-docs.yml diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 00000000..a8eb4b59 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,24 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Build docs + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + workflow_call: + +jobs: + build-docs: + uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_docs.yml@v0.57.0 From bee9d48e715bd185740d68a5a30e5067571e6700 Mon Sep 17 00:00:00 2001 From: Pablo Garay Date: Mon, 27 Oct 2025 12:42:15 -0700 Subject: [PATCH 2/5] feat: add build-docs check Signed-off-by: Pablo Garay --- docs/autodoc2_docstrings_parser.py | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/autodoc2_docstrings_parser.py diff --git a/docs/autodoc2_docstrings_parser.py b/docs/autodoc2_docstrings_parser.py new file mode 100644 index 00000000..ed2b5908 --- /dev/null +++ b/docs/autodoc2_docstrings_parser.py @@ -0,0 +1,33 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# flake8: noqa +# pylint: skip-file +from docutils import nodes +from myst_parser.parsers.sphinx_ import MystParser +from sphinx.ext.napoleon.docstring import GoogleDocstring + + +class NapoleonParser(MystParser): + def parse(self, input_string: str, document: nodes.document) -> None: + # Get the Sphinx configuration + config = document.settings.env.config + + # Process with Google style + google_parsed = str(GoogleDocstring(input_string, config)) + + return super().parse(google_parsed, document) + + +Parser = NapoleonParser + From f72f674f298dbf2e8a451f78d235f5f8d3f4da9f Mon Sep 17 00:00:00 2001 From: Pablo Garay Date: Mon, 27 Oct 2025 12:53:29 -0700 Subject: [PATCH 3/5] fix build-docs Signed-off-by: Pablo Garay --- docs/conf.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 49aa55ae..22edbc5a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,6 +44,12 @@ templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +# Suppress warnings for cross-references and autodoc issues +suppress_warnings = [ + "myst.xref_missing", # Missing cross-references in included README + "autodoc2", # Autodoc2 warnings during API doc generation +] + # -- Options for MyST Parser (Markdown) -------------------------------------- # MyST Parser settings myst_enable_extensions = [ @@ -92,3 +98,9 @@ }, } html_extra_path = ["project.json", "versions1.json"] + +# Github links can get rate limited from Github Actions +linkcheck_ignore = [ + ".*github\\.com.*", + ".*githubusercontent\\.com.*", +] From 40fb5a5b9226015a03eb41ec1fd0abb4d66cf5c9 Mon Sep 17 00:00:00 2001 From: Pablo Garay Date: Mon, 27 Oct 2025 12:55:54 -0700 Subject: [PATCH 4/5] fix2 build-docs Signed-off-by: Pablo Garay --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 22edbc5a..95e4676e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,9 @@ # Suppress warnings for cross-references and autodoc issues suppress_warnings = [ "myst.xref_missing", # Missing cross-references in included README + "myst.header", # Header level warnings from autodoc2 generated files "autodoc2", # Autodoc2 warnings during API doc generation + "toc.not_included", # Autodoc2 index not included in main toctree ] # -- Options for MyST Parser (Markdown) -------------------------------------- From 8029bff86b54b24707ea05fbc8154febe4b4513d Mon Sep 17 00:00:00 2001 From: Pablo Garay Date: Mon, 27 Oct 2025 12:59:21 -0700 Subject: [PATCH 5/5] minimal lint fix Signed-off-by: Pablo Garay --- docs/autodoc2_docstrings_parser.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/autodoc2_docstrings_parser.py b/docs/autodoc2_docstrings_parser.py index ed2b5908..1f8e1bdb 100644 --- a/docs/autodoc2_docstrings_parser.py +++ b/docs/autodoc2_docstrings_parser.py @@ -30,4 +30,3 @@ def parse(self, input_string: str, document: nodes.document) -> None: Parser = NapoleonParser -