Skip to content

Commit

Permalink
Merge pull request #125 from BIG-MAP/cwa/close-73-reactivate-docs
Browse files Browse the repository at this point in the history
Test building docs in PRs
  • Loading branch information
jsimonclark authored Mar 12, 2024
2 parents 4e52a0a + 866ab2b commit 70a3705
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 44 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: '3.7'

- name: Install EMMOntoPy
run: |
Expand All @@ -29,5 +29,3 @@ jobs:
--skip test_quantity_dimension \
--configfile=.github/utils/emmocheck_config.yml \
battinfo.ttl
30 changes: 17 additions & 13 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,36 @@ on:
push:
branches:
- 'master'

pull_request:

env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "[email protected]"

jobs:

updatepages:

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5 #Uses python install action from here: https://github.com/marketplace?type=actions
uses: actions/setup-python@v5
with:
python-version: '3.10' # Replace with the desired Python version
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install Markdown==3.4.3 rdflib==6.3.2 # Add any other dependencies if needed
pip install -U setuptools wheel
pip install -r requirements_docs.txt
- name: Render documentation from ttl
run: python sphinx/ttl_to_rst.py

Expand All @@ -40,17 +42,19 @@ jobs:
with:
docs-folder: "sphinx/"
pre-build-command: "apt-get update -y; apt-get install -y pandoc"


# Still upload built documentation as an artifact if not deploying
# This is to provide the opportunity to download the built documentation
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentationHTML
path: sphinx/_build/html/


# Only deploy if pushing to 'master'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sphinx/_build/html

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Python
__pycache__
*.py[cod]

# Documentation
site
3 changes: 1 addition & 2 deletions docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico">
</head>
<body>

<div class="banner">
<a href="index.html">
<img src="./assets/banner.jpg" alt="Banner Image">
Expand Down Expand Up @@ -41,4 +41,3 @@ <h3>Aknowledgements</h3>
<p>This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 957189.</p>
</body>
</html>

10 changes: 5 additions & 5 deletions docs/assets/about.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# About BattINFO
The BattINFO Ontology has been developed as part of the [BIG-MAP](http://www.big-map.eu/) project, in an effort to deliver a digital resource the battery community
to facilitate the implementation of FAIR data standards.

### License
The BattINFO Ontology has been developed as part of the [BIG-MAP](http://www.big-map.eu/) project, in an effort to deliver a digital resource the battery community to facilitate the implementation of FAIR data standards.

## License

The Battery Interface Domain Ontology is released under the [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/legalcode) license (CC BY 4.0).

### Contributors
## Contributors

- Simon Clark, SINTEF, Norway
- Jesper Friis, SINTEF, Norway
Expand All @@ -24,6 +24,6 @@ The Battery Interface Domain Ontology is released under the [Creative Commons At
- Inga Gudem Ringdalen, SINTEF, Norway
- Emanuele Farhi, SOLEIL synchrotron, France

## Aknowledgements

### Aknowledgements
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 957189.
15 changes: 10 additions & 5 deletions docs/assets/contribute.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Contributing to BattINFO

There are two ways you can contribute to BattINFO.
### Suggest minor changes on existing elements
Create a [Feature request in a Github Issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) to suggest edits to names, defintions, references on existing classes and properties.
### Propose additions/deletion of elements

## Suggest minor changes on existing elements

Create a [Feature request in a Github Issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) to suggest edits to names, defintions, references on existing classes and properties.

## Propose additions/deletion of elements

> **_NOTE:_** We recommend contacting some of BattINFO contributors in advance to discuss which additions deletions you wish to make.
We recoommend 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 you local PC, create your branch based on the existing ```dev``` 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 Protege software. In case of the latter, [install Protege](https://protege.stanford.edu/) and use it to open the ontology file you wish to edit. Before adding elements, ensure Protege is configured to create IRIs in the right format:

* Open Protégé
* Go to File/Open and load the ontology file you wish to modify
* Go to File/Preferences and there go to the New Entities Tab
* Ensure you have configured the preferences with the correct IRI prefixes.

* Once you have made your changes, commit them to your fork and [create a pull 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.
* We will merge the request after assessing it.
10 changes: 2 additions & 8 deletions docs/assets/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# BattINFO

| [**About**](./about.html) | [**Contribute**](./contribute.html) | [![BattINFO Github](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/BIG-MAP/BattINFO)


The **Batt**ery **IN**ter**F**ace **O**ntology is a digital resource to support interoperability of battery data.
The **Batt**ery **IN**ter**F**ace **O**ntology is a digital resource to support interoperability of battery data.

BattINFO consists of a list of entities representing concepts used in batteries and electrochemistry. Each entity has a unique identifier (IRI) and is annotated with additional information, such as its preferred name ("prefLabel"), alternative names, definition, references, etc. As users link their research resources to BattINFO entities, they are effectively describing their resource using a common vocabulary. Resources can be datasets, documents, persons, organizations, equipment, samples... anything linked to the common vocabulary described in BattINFO, becomes part of an ecosystem of Findable resources.

Here you can find the entities described in BattINFO, classified in two domains.


[**Battery Domain**](http://emmo.info/battery) | [**Electrochemistry Domain**](http://emmo.info/electrochemistry)





3 changes: 1 addition & 2 deletions docs/contribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico">
</head>
<body>

<div class="banner">
<a href="index.html">
<img src="./assets/banner.jpg" alt="Banner Image">
Expand All @@ -33,4 +33,3 @@ <h3>Propose additions/deletion of elements</h3>
</ul>
</body>
</html>

3 changes: 1 addition & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico">
</head>
<body>

<div class="banner">
<a href="index.html">
<img src="./assets/banner.jpg" alt="Banner Image">
Expand All @@ -21,4 +21,3 @@
<p><a href="http://emmo.info/battery"><strong>Battery Domain</strong></a> | <a href="http://emmo.info/electrochemistry"><strong>Electrochemistry Domain</strong></a> </p>
</body>
</html>

Binary file not shown.
Binary file removed docs/scripts/__pycache__/md_to_html.cpython-310.pyc
Binary file not shown.
Binary file removed docs/scripts/__pycache__/ttl_to_html.cpython-310.pyc
Binary file not shown.
Binary file removed docs/scripts/__pycache__/ttl_to_md.cpython-310.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/scripts/md_to_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def render_html_top() -> str:
</a>
</div>
'''

return top_html + banner

########## RENDER HTML BOTTOM ################
Expand All @@ -39,7 +39,7 @@ def render_html_bottom() -> str:
########## LOAD MD INTO HTML ################

def load_md_into_html(path:str)-> str:

with open(path, 'r', encoding="utf-8") as file:
markdown_text = file.read()

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
EMMOntoPy>=0.1.3,<1
semver>=2.13.0,<3
EMMOntoPy>=0.7.1,<1
semver>=3.0.2,<4
1 change: 1 addition & 0 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rdflib==6.3.2

0 comments on commit 70a3705

Please sign in to comment.