Skip to content

Commit

Permalink
Muazzam chaud/issue278 setup GitHub repo to host static docs (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
MuazzamChaud authored Jan 12, 2022
1 parent 17dce78 commit bbbfed0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 18 deletions.
55 changes: 49 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pipeline {
stash name: 'wheels', includes: '**/dist/*.whl'
}
}
stage('Documentation') {
stage('Building Documentation') {
steps {
script {
dir('csvcubed-devtools') {
Expand All @@ -132,19 +132,62 @@ pipeline {
sh 'poetry run sphinx-build -W -b html docs docs/_build/html'
}

dir('external-docs'){
sh "python3 -m mkdocs build"
}

stash name: 'docs', includes: '**/docs/_build/html/**/*'
stash name: 'mkdocs', includes: '**/external-docs/site/**/*'
}
}
}
stage('Build Static Site'){
stage('Publishing Documentation'){
when{
branch 'main'
}
steps{
script{
dir('external-docs'){
sh "python3 -m mkdocs build"
try {
withCredentials([gitUsernamePassword(credentialsId: 'csvcubed-github', gitToolName: 'git-tool')]){
sh 'git clone "https://github.com/GSS-Cogs/csvcubed-docs.git"'
dir ('csvcubed-docs') {
sh 'git config --global user.email "[email protected]" && git config --global user.name "csvcubed"'

if (fileExists("external")) {
sh 'git rm -rf external'
}
sh 'mkdir external'
sh 'cp -r ../external-docs/site/* external'

if (fileExists("api-docs")) {
sh 'git rm -rf api-docs'
}
sh 'mkdir api-docs'
sh 'mkdir api-docs/csvcubed'
sh 'mkdir api-docs/csvcubed-devtools'
sh 'mkdir api-docs/csvcubed-models'
sh 'mkdir api-docs/csvcubed-pmd'

sh 'cp -r ../csvcubed/docs/_build/html/* api-docs/csvcubed'
sh 'cp -r ../csvcubed-devtools/docs/_build/html/* api-docs/csvcubed-devtools'
sh 'cp -r ../csvcubed-models/docs/_build/html/* api-docs/csvcubed-models'
sh 'cp -r ../csvcubed-pmd/docs/_build/html/* api-docs/csvcubed-pmd'

sh 'touch .nojekyll'

sh 'git add *'
sh 'git add .nojekyll'
sh 'git commit -m "Updating documentation."'
// commit being built in csvcubed repo: https://github.com/GSS-Cogs/csvcubed
sh 'git checkout gh-pages'
sh 'git reset --hard main'
sh 'git push -f'
}
}
} finally {
sh 'rm -rf csvcubed-docs'
}
stash name: 'mkdocs', includes: '**/external-docs/site/**/*'
}

}
}
}
Expand Down
19 changes: 7 additions & 12 deletions external-docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).
## The Project
### What the Project is about

## Commands
The csvcubed project aims to provide libraries and utilities which make it simple to turn a CSV into [5* linked data](https://5stardata.info/en/). We want to make it easier for data producers to annotate their existing data with the metadata required to ensure that each dataset is discoverable, comparable and analysable by automated tools.

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
The csvcubed catalogue of tools help to deliver this vision in an opinionated fashion. Our tools output [data cubes](https://en.wikipedia.org/wiki/Data_cube) using the [CSV on the web (CSV-W)](https://www.w3.org/TR/tabular-metadata/) file format. Within these CSV-W files we describe what the data represents using a combination of the following ontologies:

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
- [RDF Data Cube (qb)](https://www.w3.org/TR/vocab-data-cube/)
- [Simple Knowledge Organization System (SKOS)](http://www.w3.org/TR/skos-primer)
- [Data Catalog Vocabulary (DCAT2)](https://www.w3.org/TR/vocab-dcat-2/)
1 change: 1 addition & 0 deletions external-docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ theme:
icon: material/toggle-switch
name: Switch to light mode
features:
- search.highlight
- navigation.instant
# - navigation.expand
- navigation.sections
Expand Down

0 comments on commit bbbfed0

Please sign in to comment.