Skip to content

Commit

Permalink
Generate documentation automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoema committed Oct 4, 2023
1 parent 2cf2113 commit 6dbae0a
Show file tree
Hide file tree
Showing 65 changed files with 123 additions and 6 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Automatic generation of documentation will be copied and checked into the
# gh-pages branch.
name: Documentation generation CI

on:
push:
paths:
- '.github/workflows/generate_docs.yml'
- 'docs/**'
branches:
- master
- develop

jobs:
build:
name: Generate documentation
runs-on: ubuntu-latest

steps:
# checkout branch
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: docs

# Install dblatex
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y dblatex dbtoepub xsltproc
# generate the documentation files
- name: Generate documentation
run: |
cd docs
dblatex -s texstyle.sty mobilitydb-workshop.xml
dbtoepub -o mobilitydb-workshop.epub mobilitydb-workshop.xml
mkdir html
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o html/index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml
cp -r images docbook.css html/
cp docbook.css html/
# store the documentation files
- name: Upload output directory
uses: actions/upload-artifact@v2
with:
name: doc-files
path: |
docs/index.md
docs/mobilitydb-workshop.pdf
docs/mobilitydb-workshop.epub
docs/html/docbook.css
docs/html/images/*
docs/html/*.html
retention-days: 1


copy:
name: Deploy documentation
runs-on: ubuntu-latest
needs: build

steps:
# checkout the gh-pages branch
- uses: actions/checkout@v3
with:
ref: gh-pages

# download the doc files, most of which are generated above
- name: Download output directory
uses: actions/download-artifact@v2
with:
name: doc-files
path: docs-temp

# Rename the directory to master
- name: Rename the directory to master
if: ${{ github.ref == 'refs/heads/master' }}
run: |
rm -rf master
mv docs-temp master
# Rename the directory to master
- name: Rename the directory to develop
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
rm -rf develop
mv docs-temp develop
# add, commit and push to gh-pages
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Update docs'
branch: gh-pages
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ of the modules.

## Documentation

You can generate the workshop documentation from the sources. Go to `/doc` directory and run:
You can generate the workshop documentation from the sources. Go to `/docs` directory and run:
* In HTML format
```bash
xsltproc --stringparam html.stylesheet "docbook.css" --xinclude -o index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml
```
* In PDF format
```bash
Expand All @@ -21,13 +21,21 @@ You can generate the workshop documentation from the sources. Go to `/doc` direc
```
In addition, pre-generated versions of them are available.

* In HTML format: https://docs.mobilitydb.com/MobilityDB-workshop/master/
* In PDF format: https://docs.mobilitydb.com/MobilityDB-workshop/master/mobilitydb-workshop.pdf
* In EPUB format: https://docs.mobilitydb.com/MobilityDB-workshop/master/mobilitydb-workshop.epub
Master branch:

* In HTML format: https://mobilitydb.github.io/MobilityDB-workshop/master/html/index.html
* In PDF format: https://mobilitydb.github.io/MobilityDB-workshop/master/mobilitydb-workshop.pdf
* In EPUB format: https://mobilitydb.github.io/MobilityDB-workshop/master/mobilitydb-workshop.epub

Develop branch:

* In HTML format: https://mobilitydb.github.io/MobilityDB-workshop/develop/html/index.html
* In PDF format: https://mobilitydb.github.io/MobilityDB-workshop/develop/mobilitydb-workshop.pdf
* In EPUB format: https://mobilitydb.github.io/MobilityDB-workshop/develop/mobilitydb-workshop.epub

## How the Repo is Organized
- `/data`: raw data files used for some workshops
- `/doc`: files needed to generate the workshop documentation from sources
- `/docs`: files needed to generate the workshop documentation from sources

## Docker container

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 14 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<img src="https://MobilityDB.github.io/MobilityDB-workshop/images/mobilitydb-logo.png"
alt="MobilityDB icon"
style="float: center; margin-right: 10px;" />

-----------------------------------------------
# **Documentation of the MobilityDB Workshop**
-----------------------------------------------


The documentation is available in the following formats

* [PDF](./mobilitydb-workshop.pdf)
* [EPUB](./mobilitydb-workshop.epub)
* [HTML](./html/index.html)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6dbae0a

Please sign in to comment.