Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build docs better in CI/CD #132

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,24 @@ jobs:

- name: Install dependencies
run: |
# System dependencies
sudo apt-get update && sudo apt-get install -y pandoc

# Python dependencies
python -m pip install --upgrade pip
pip install -U setuptools wheel
pip install -r requirements_docs.txt
pip install -r requirements_docs.txt -r sphinx/requirements.txt

- name: Render documentation from ttl
run: python sphinx/ttl_to_rst.py

- name: Build HTML
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "sphinx/"
pre-build-command: "apt-get update -y; apt-get install -y pandoc"
run: make html
working-directory: sphinx
env:
# -v: Verbose
# -W: Turn warnings into errors
SPHINXOPTS: "-v -W"

# Still upload built documentation as an artifact if not deploying
# This is to provide the opportunity to download the built documentation
Expand Down
2 changes: 1 addition & 1 deletion sphinx/about.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About the Battery Interface Ontology
==========================
====================================

The Battery Interface Ontology (BattINFO) is a semantic resource for the terms and relations needed to describe things, processes, and data in the battery domain. It can be used to **generate linked data** for the Semantic Web, **comply with the FAIR data guidelines**, support **interoperaility of data** among different systems, and more!

Expand Down
17 changes: 16 additions & 1 deletion sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@

html_theme_options = {
# "show_nav_level": 4
"header_links_before_dropdown": 5, # show 5 links before "More" dropdown
"primary_sidebar_end": [],
}

# Add any paths that contain custom themes here, relative to this directory.
Expand Down Expand Up @@ -161,7 +163,14 @@
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
html_sidebars = {
"**": ["sidebar-nav-bs"],
"about": [],
"battinfo": [],
"contribute": [],
"faq": [],
"getstarted": [],
}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down Expand Up @@ -299,4 +308,10 @@

# MatAttributeDocumenter.add_directive_header = _add_directive_header

suppress_warnings = [
# Suppress "duplicate label" warnings in `battinfo.rst`.
# These are due to similarly named (prefLabel) concepts in the ontology,
# as the prefLabel is used as the section title.
"autosectionlabel.battinfo",
]

6 changes: 3 additions & 3 deletions sphinx/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ We recommend using the `forking
workflow <https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow>`__
to contribute additions/deletions. Fork this repository, clone the fork
on your local PC, create your branch based on the existing ``dev``
branch (e.g. ``dev_john_doe``) and work on the editions in you local
branch (e.g. ``dev_john_doe``) and work on the editions in you local
copy.

You can edit ontologes in two main ways. One is programmatically, using
for instance `EMMOntoPy <https://github.com/emmo-repo/EMMOntoPy>`__. The
second and more common is using the interface provided by the Protégé
software. In case of the latter, `install
Protégé <https://protege.stanford.edu/>`__ and use it to open the
ontology file you wish to edit. Before adding elements, ensure Prot´égé
ontology file you wish to edit. Before adding elements, ensure Protégé
is configured to create IRIs in the right format:

- Open Protégé
Expand All @@ -49,5 +49,5 @@ is configured to create IRIs in the right format:
request <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`__.
- We will merge the request after assessing it.

.. |Protege config.| image:: doc/img/protege_config_contribute.png
.. |Protege config.| image:: img/protege_config_contribute.png

Loading