diff --git a/Makefile b/Makefile index 80c0418ef78..9f9a428d2de 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ ghpages: setup --output-dir doc/build/api docs_suse: setup - poetry run make -C doc xml + poetry run make -C doc xml_suse rm -rf doc/build/restxml mv doc/build/xml doc/build/restxml poetry run pip install \ diff --git a/doc/Makefile b/doc/Makefile index e5ddc114b14..c2d143fda00 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -210,6 +210,14 @@ xml: @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: xml_suse +xml_suse: + $(SPHINXBUILD) -b xml -t suse $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + + .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml diff --git a/doc/source/conf.py b/doc/source/conf.py index b26d16cfdd0..b58573605e3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -8,6 +8,9 @@ from os.path import abspath, dirname, join, normpath import shlex +from sphinx.transforms import SphinxTransform + + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -57,8 +60,25 @@ def prologReplace(app, docname, source): result = result.replace(key, app.config.prolog_replacements[key]) source[0] = result +class AddRootRole(SphinxTransform): + # Runs after the document is parsed and the source path is set + default_priority = 500 + + def apply(self): + master_doc = self.config.master_doc + + # Get the current document name relative to the source directory + # e.g., 'index', 'folder/subpage', etc. + docname = self.env.docname + + # Only apply the attribute if this is the main entry point + if docname == master_doc: + self.document['role'] = 'main' + + def setup(app): app.add_config_value('prolog_replacements', {}, True) + app.add_transform(AddRootRole) app.connect('source-read', prologReplace) app.connect("autodoc-process-docstring", remove_module_docstring) diff --git a/doc/source/index.rst b/doc/source/index.rst index 2f40e856417..f5ae30e7aca 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,5 +1,9 @@ .. kiwi documentation master file +.. only:: suse + + .. include:: suse_metadata.rst + Welcome to KIWI NG ================== @@ -19,24 +23,46 @@ Why KIWI? * **Extensible and Customizable**: A flexible plugin architecture and the ability to include custom scripts and configuration files give you full control over the image-building process. * **Battle-Tested**: {kiwi} is used by enterprises and open-source projects alike, and builds official images in the build service of SUSE and Fedora. -.. toctree:: - :maxdepth: 1 - :hidden: - - overview - installation - quickstart - commands - troubleshooting - plugins - concept_and_workflow - image_description - image_types_and_results - building_images - working_with_images - contributing - integration_testing - api +.. only:: suse + + .. toctree:: + :maxdepth: 1 + + overview + installation + quickstart + commands + troubleshooting + plugins + concept_and_workflow + image_description + image_types_and_results + building_images + working_with_images + contributing + integration_testing + api + +.. only:: not suse + + .. toctree:: + :maxdepth: 1 + :hidden: + + overview + installation + quickstart + commands + troubleshooting + plugins + concept_and_workflow + image_description + image_types_and_results + building_images + working_with_images + contributing + integration_testing + api .. sidebar:: Links diff --git a/doc/source/suse_metadata.rst b/doc/source/suse_metadata.rst new file mode 100644 index 00000000000..dd01c601f6a --- /dev/null +++ b/doc/source/suse_metadata.rst @@ -0,0 +1,7 @@ +:meta: + :description: Your flexible operating system image and appliance builder + :keyword: KIWI + :social-descr: The SEO description + :seo-title: KIWI - Appliance Builder Next Generation + :task: Deployment, Installation + :series: Products & Solutions