Skip to content

Commit

Permalink
Merge pull request #86 from BrennanGit/feature/doc_builder_v4
Browse files Browse the repository at this point in the history
Feature/doc builder v4
  • Loading branch information
BrennanGit authored Oct 20, 2023
2 parents 797eb85 + dd68ccd commit 681548b
Show file tree
Hide file tree
Showing 25 changed files with 63 additions and 39 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
workflow_dispatch: {}

env:
DOC_BUILDER_IMAGE: 'ghcr.io/xmos/doc_builder:v3.0.0'
DOC_BUILDER_IMAGE: 'ghcr.io/xmos/xmosdoc:v4.0'

jobs:
build_documentation:
Expand All @@ -43,7 +43,8 @@ jobs:
- name: Build documentation
run: |
docker run --rm -t -u "$(id -u):$(id -g)" -v ${{ github.workspace }}:/build -e PDF=1 -e REPO:/build -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e DOXYGEN_INPUT=ignore ${DOC_BUILDER_IMAGE}
docker run --rm -t -u "$(id -u):$(id -g)" -v ${{ github.workspace }}:/build ${DOC_BUILDER_IMAGE} -vv
- name: Save documentation artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
49 changes: 41 additions & 8 deletions doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Documentation Source
####################

This folder contains source files for the documentation. The sources do not render well in GitHub or an RST viewer.
In addition, some information is not visible at all and some links will not be functional.

**********************
Building Documentation
**********************
Expand All @@ -10,13 +13,7 @@ Building Documentation
Prerequisites
=============

Install `Docker <https://www.docker.com/>`_.

Pull the docker container:

.. code-block:: console
$ docker pull ghcr.io/xmos/doc_builder:v3.0.0
Use the `xmosdoc tool <https://github.com/xmos/xmosdoc>`_ either via docker or install it into a pip environment.

========
Building
Expand All @@ -26,5 +23,41 @@ To build the documentation, run the following command in the root of the reposit

.. code-block:: console
$ docker run --rm -t -u "$(id -u):$(id -g)" -v $(pwd):/build -e PDF=1 -e REPO:/build -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INPUT=ignore ghcr.io/xmos/doc_builder:v3.0.0
# via pip package
xmosdoc clean html latex
# via docker
$ docker run --rm -t -u "$(id -u):$(id -g)" -v $(pwd):/build ghcr.io/xmos/xmosdoc clean html latex
HTML document output is saved in the ``doc/_build/html`` folder. Open ``index.html`` to preview the saved documentation.

Please refer to the ``xmosdoc`` documentation for a complete guide on how to use the tool.

**********************
Adding a New Component
**********************

Follow the following steps to add a new component.

- Add an entry for the new component's top-level document to the appropriate TOC in the documents tree.
- If the new component uses `Doxygen`, append the appropriate path(s) to the INPUT variable in `Doxyfile.inc`.
- If the new component includes `.rst` files that should **not** be part of the documentation build, append the appropriate pattern(s) to `exclude_patterns.inc`.

***
FAQ
***

Q: Is it possible to build just a subset of the documentation?

A: Yes, however it is not recommended at this time.

Q: Is it possible to used the ``livehtml`` feature of Sphinx?

A: Yes, run xmosdoc with the ``--auto`` option.

Q: Where can I learn more about the XMOS ``xmosdoc`` tools?

A: See the https://github.com/xmos/xmosdoc repository. See the ``xmosdoc`` repository README for details on additional build options.

Q: How do I suggest enhancements to the XMOS ``xmosdoc`` tool?

A: Create a new issue here: https://github.com/xmos/xmosdoc/issues
6 changes: 4 additions & 2 deletions doc/exclude_patterns.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# The following patterns are to be excluded from the documentation build
doc/README.rst
**CHANGELOG*
**LICENSE*
**README*
examples
test
tools
modules/mic_array
modules/xud
modules/xud
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2c/i2c.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

#############
|I2C| Library
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2c/i2c_master.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

************
|I2C| Master
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2c/i2c_registers.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

***************
|I2C| Registers
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2c/i2c_slave.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

***********
|I2C| Slave
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2s/i2s.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

#############
|I2S| Library
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2s/i2s_common.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

****************
|I2S| Common API
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2s/i2s_master.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

************
|I2S| Master
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2s/i2s_slave.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

***********
|I2S| Slave
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/i2s/i2s_tdm_slave.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

*********
TDM Slave
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/spi/spi.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

###########
SPI Library
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/spi/spi_master.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

**********
SPI Master
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/spi/spi_slave.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

*********
SPI Slave
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/uart/uart.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

############
UART Library
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/uart/uart_rx.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

*******
UART Rx
Expand Down
1 change: 0 additions & 1 deletion doc/programming_guide/reference/uart/uart_tx.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../../../substitutions.rst

*******
UART Tx
Expand Down
1 change: 0 additions & 1 deletion doc/shared/introduction.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. include:: ../substitutions.rst

########
Overview
Expand Down
2 changes: 0 additions & 2 deletions doc/shared/legal.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.. _sln_voice_copyright:


.. include:: ../_templates/disclaimer.rst

Licenses
========

Expand Down
1 change: 0 additions & 1 deletion doc/src_html/.gitkeep

This file was deleted.

2 changes: 0 additions & 2 deletions doc/substitutions.rst

This file was deleted.

5 changes: 0 additions & 5 deletions settings.json

This file was deleted.

14 changes: 14 additions & 0 deletions settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
project: fwk_io
title: XCORE Peripheral IO Framework
version: 3.3.0

documentation:
exclude_patterns_path: doc/exclude_patterns.inc
doxygen_projects:
fwk_io:
doxyfile_path: doc/Doxyfile.inc
pdfs:
doc/programming_guide/index:
pdf_title: "{{title}} - Programming Guide"
pdf_filename: "{{project}}_programming_guide_v{{version}}"

0 comments on commit 681548b

Please sign in to comment.