All Projects → ammaraskar → Sphinx Action

ammaraskar / Sphinx Action

Licence: apache-2.0
Github action that builds docs using sphinx and places errors inline

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Sphinx Action

Sphinx
Main repository for the Sphinx documentation builder
Stars: ✭ 4,313 (+4639.56%)
Mutual labels:  sphinx
Sphinxcontrib Asyncio
Sphinx extension to add asyncio-specific markups
Stars: ✭ 19 (-79.12%)
Mutual labels:  sphinx
Bebops
BebopS aims to simulate the behavior of Parrot Bebop 2 by using SIL methodologies
Stars: ✭ 40 (-56.04%)
Mutual labels:  sphinx
Docs
MinIO Object Storage Documentation
Stars: ✭ 488 (+436.26%)
Mutual labels:  sphinx
Readthedocs.org
The source code that powers readthedocs.org
Stars: ✭ 6,802 (+7374.73%)
Mutual labels:  sphinx
Jsx Lexer
a JSX lexer for pygments
Stars: ✭ 26 (-71.43%)
Mutual labels:  sphinx
Furo
A clean customizable documentation theme for Sphinx
Stars: ✭ 267 (+193.41%)
Mutual labels:  sphinx
Pism
repository for the Parallel Ice Sheet Model (PISM)
Stars: ✭ 61 (-32.97%)
Mutual labels:  sphinx
Javersphinxbundle
Symfony bundle which provides integration of Sphinx search engine with Symfony using SphinxQL
Stars: ✭ 18 (-80.22%)
Mutual labels:  sphinx
Sphinx Automodapi
Sphinx extension for generating API documentation
Stars: ✭ 36 (-60.44%)
Mutual labels:  sphinx
Breathe
ReStructuredText and Sphinx bridge to Doxygen
Stars: ✭ 514 (+464.84%)
Mutual labels:  sphinx
Awesome Sphinxdoc
A curated list of awesome tools for Sphinx Python Documentation Generator
Stars: ✭ 716 (+686.81%)
Mutual labels:  sphinx
Sphinx Polish Wordforms
Słownik polskich odmian dla Sphinx
Stars: ✭ 8 (-91.21%)
Mutual labels:  sphinx
Easyavr
Easy AVR USB Keyboard Firmware and Keymapper
Stars: ✭ 479 (+426.37%)
Mutual labels:  sphinx
Awesome Docs With Static Site Generators
Pointers to all templates and implementations based on static site generators
Stars: ✭ 44 (-51.65%)
Mutual labels:  sphinx
Doc2dash
Create docsets for Dash.app-compatible API browser.
Stars: ✭ 380 (+317.58%)
Mutual labels:  sphinx
React Express Fullstack
Full stack (mostly unopinionated) starter pack with React+Redux and Expressjs
Stars: ✭ 23 (-74.73%)
Mutual labels:  sphinx
Osmium
Online collaborative fitting tool.
Stars: ✭ 74 (-18.68%)
Mutual labels:  sphinx
Myst Nb
Parse and execute ipynb files in Sphinx
Stars: ✭ 45 (-50.55%)
Mutual labels:  sphinx
Hawkmoth
Hawkmoth - Sphinx Autodoc for C
Stars: ✭ 31 (-65.93%)
Mutual labels:  sphinx

Sphinx Build Action

Build Status Test Coverage

This is a Github action that looks for Sphinx documentation folders in your project. It builds the documentation using Sphinx and any errors in the build process are bubbled up as Github status checks.

The main purposes of this action are:

  • Run a CI test to ensure your documentation still builds.

  • Allow contributors to get build errors on simple doc changes inline on Github without having to install Sphinx and build locally.

Example Screenshot

How to use

Create a workflow for the action, for example:

name: "Pull Request Docs Check"
on: 
- pull_request

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: ammaraskar/[email protected]
      with:
        docs-folder: "docs/"
  • If you have any Python dependencies that your project needs (themes, build tools, etc) then place them in a requirements.txt file inside your docs folder.

  • If you have multiple sphinx documentation folders, please use multiple uses blocks.

For a full example repo using this action including advanced usage, take a look at https://github.com/ammaraskar/sphinx-action-test

Great Actions to Pair With

Some really good actions that work well with this one are actions/upload-artifact and ad-m/github-push-action.

You can use these to make built HTML and PDFs available as artifacts:

    - uses: actions/[email protected]
      with:
        name: DocumentationHTML
        path: docs/_build/html/

Or to push docs changes automatically to a gh-pages branch:

Code for your workflow

    - name: Commit documentation changes
      run: |
        git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
        cp -r docs/_build/html/* gh-pages/
        cd gh-pages
        git config --local user.email "[email protected]"
        git config --local user.name "GitHub Action"
        git add .
        git commit -m "Update documentation" -a || true
        # The above command will fail if no changes were present, so we ignore
        # the return code.
    - name: Push changes
      uses: ad-m/[email protected]
      with:
        branch: gh-pages
        directory: gh-pages
        github_token: ${{ secrets.GITHUB_TOKEN }}

For a full fledged example of this in action take a look at: https://github.com/ammaraskar/sphinx-action-test

Advanced Usage

If you wish to customize the command used to build the docs (defaults to make html), you can provide a build-command in the with block. For example, to invoke sphinx-build directly you can use:

    - uses: ammaraskar/[email protected]
      with:
        docs-folder: "docs/"
        build-command: "sphinx-build -b html . _build"

If there's system level dependencies that need to be installed for your build, you can use the pre-build-command argument like so:

    - uses: ammaraskar/[email protected]
      with:
        docs-folder: "docs2/"
        pre-build-command: "apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended"
        build-command: "make latexpdf"

Running the tests

python -m unittest

Formatting

Please use black for formatting:

black entrypoint.py sphinx_action tests

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].