Skip to content
Snippets Groups Projects
Commit f8f6a8a8 authored by Martin Schroschk's avatar Martin Schroschk
Browse files

Add content w.r.t. Checks

parent d26b75ea
No related branches found
No related tags found
3 merge requests!322Merge preview into main,!319Merge preview into main,!5Issue#6
...@@ -44,27 +44,26 @@ Now, create a local clone of your fork ...@@ -44,27 +44,26 @@ Now, create a local clone of your fork
```Shell Session ```Shell Session
# SSH based method # SSH based method
git@gitlab.hrz.tu-chemnitz.de:LOGIN/hpc-compendium.git ~ git@gitlab.hrz.tu-chemnitz.de:LOGIN/hpc-compendium.git
# HTTP based method # HTTP based method
https://gitlab.hrz.tu-chemnitz.de/LOGIN/hpc-compendium.git ~ https://gitlab.hrz.tu-chemnitz.de/LOGIN/hpc-compendium.git
``` ```
#### Install Dependencies #### Install Dependencies
TODO: Describtion **TODO:** Describtion
```Shell Session ```Shell Session
cd hpc-compendium/doc.zih.tu-dresden.de ~ cd hpc-compendium/doc.zih.tu-dresden.de
pip install -r requirements.txt ~ pip install -r requirements.txt
``` ```
TODO: virtual environment **TODO:** virtual environment
TODO: What we need for markdownlinter and co checks? **TODO:** What we need for markdownlinter and co checks?
<!--- All branches are protected, i.e., only ZIH staff can create branches and push to them ---> <!--- All branches are protected, i.e., only ZIH staff can create branches and push to them --->
## Contribute via Web IDE ## Contribute via Web IDE
GitLab offers a rich and versatile web interface to work with repositories. To fix typos and edit GitLab offers a rich and versatile web interface to work with repositories. To fix typos and edit
...@@ -99,8 +98,8 @@ preview the updated documentation locally before committing the changes to the r ...@@ -99,8 +98,8 @@ preview the updated documentation locally before committing the changes to the r
To make use of `mkdocs`, it is necessary to have two commands in mind To make use of `mkdocs`, it is necessary to have two commands in mind
``` ```
mkdocs serve - Start the live-reloading docs server. ~ mkdocs serve - Start the live-reloading docs server.
mkdocs build - Build the documentation site. ~ mkdocs build - Build the documentation site.
``` ```
#### Preview Using mkdocs #### Preview Using mkdocs
...@@ -144,7 +143,7 @@ locally on the documentation. At first, you should add a remote pointing to the ...@@ -144,7 +143,7 @@ locally on the documentation. At first, you should add a remote pointing to the
documentation. documentation.
```Shell Session ```Shell Session
git remote add upstream-zih git@gitlab.hrz.tu-chemnitz.de:zih/hpc-compendium/hpc-compendium.git ~ git remote add upstream-zih git@gitlab.hrz.tu-chemnitz.de:zih/hpc-compendium/hpc-compendium.git
``` ```
Now, you have two remotes, namely *origin* and *upstream-zih*. The remote *origin* points to your fork, Now, you have two remotes, namely *origin* and *upstream-zih*. The remote *origin* points to your fork,
...@@ -161,8 +160,8 @@ upstream-zih git@gitlab.hrz.tu-chemnitz.de:zih/hpc-compendium/hpc-compendium.git ...@@ -161,8 +160,8 @@ upstream-zih git@gitlab.hrz.tu-chemnitz.de:zih/hpc-compendium/hpc-compendium.git
Next, you should synchronize your `main` branch with the upstream. Next, you should synchronize your `main` branch with the upstream.
```Shell Session ```Shell Session
git checkout main ~ git checkout main
git pull upstream main ~ git pull upstream main
``` ```
At this point, your `main` branch is up-to-date with the original documentation of HPC compendium. At this point, your `main` branch is up-to-date with the original documentation of HPC compendium.
...@@ -177,12 +176,12 @@ changes, as outlined in the previous subsection. In order to commit to this docu ...@@ -177,12 +176,12 @@ changes, as outlined in the previous subsection. In order to commit to this docu
new branch (a so-called feature branch) basing on the `main` branch and commit your changes to it. new branch (a so-called feature branch) basing on the `main` branch and commit your changes to it.
```Shell Session ```Shell Session
git checkout main ~ git checkout main
git checkout -b <FEATUREBRANCH> ~ git checkout -b <FEATUREBRANCH>
# Edit file1, file2 etc. # Edit file1, file2 etc.
git add <file1> <file2> ~ git add <file1> <file2>
git commit -m <COMMIT MESSAGE> ~ git commit -m <COMMIT MESSAGE>
git push origin <FEATUREBRANCH> ~ git push origin <FEATUREBRANCH>
``` ```
The last command pushes the changes to your remote at branch `FEATUREBRANCH`. Now, it is time to The last command pushes the changes to your remote at branch `FEATUREBRANCH`. Now, it is time to
...@@ -190,12 +189,6 @@ incoporate the changes and improvements into the HPC Compendium. For this, creat ...@@ -190,12 +189,6 @@ incoporate the changes and improvements into the HPC Compendium. For this, creat
[merge request](https://gitlab.hrz.tu-chemnitz.de/zih/hpc-compendium/hpc-compendium/-/merge_requests/new) [merge request](https://gitlab.hrz.tu-chemnitz.de/zih/hpc-compendium/hpc-compendium/-/merge_requests/new)
to the `main` branch. to the `main` branch.
#### Run Checks
We have several checks on the markdown sources to ensure a high quality of the documentation. These
checks are run within the CI/CD pipeline and changes are only deployed to the HPC compendium, if the
checks are passed.
Thus, we **highly recommend** running the checks before committing and posing a merge request.
...@@ -222,38 +215,44 @@ If you are totally sure about your commit (e.g., fix a typo), it is only the fol ...@@ -222,38 +215,44 @@ If you are totally sure about your commit (e.g., fix a typo), it is only the fol
1. Pose Merge Request 1. Pose Merge Request
### Checks ## Checks
Several checks are invoked to ensure for a consistent and high quality documentation: We have several checks on the markdown sources to ensure a for a consistent and high quality of the
documentation. These checks are run within the CI/CD pipeline and changes are only deployed to the
HPC compendium, if the checks are passed. Thus, we **highly recommend** running the checks before
committing and posing a merge request.
* Markdown linter * Markdown linter
* Links * Check internal and external links
* Code and command examples * Check code and command examples
TODO: Describe
**TODO:** Describe
### Markdown Linter ### Markdown Linter
The [markdown linter client](https://github.com/igorshubovych/markdownlint-cli) should be invoked to The [markdown linter client](https://github.com/igorshubovych/markdownlint-cli) helps to keep the
help keep the markdown source code clean and consistent. markdown source code clean and consistent.
```shell Installation
npm install markdownlint-cli ```Shell Session
~ npm install markdownlint-cli
``` ```
```shell The configuration is stored in `.markdownlint.json`. The tool `markdownlint` can be run in dry or
markdownlint docs/index.md fix mode. The *dry* mode (default) only outputs findings, whereas in *fix* mode it resolves basic
errors directly in the markdown files.
```Shell Session
~ cd doc.zih.tu-dresden.de/
~ markdownlint [--config .markdownlint.json] [--fix] docs/index.md
docs/index.md:8:131 MD013/line-length Line length [Expected: 130; Actual: 138] docs/index.md:8:131 MD013/line-length Line length [Expected: 130; Actual: 138]
``` ```
configuration file: `.markdownlint.json`
Before committing, invoke the script `util/lint-changes.sh` which calls the markdownlint tool for all Before committing, invoke the script `util/lint-changes.sh` which calls the markdownlint tool for all
(git-)changed markdown files (git-)changed markdown files.
```shell ```Shell Session
sh util/lint-changes.sh ~ sh util/lint-changes.sh
hpc-compendium-2.0-gitlab-tudzih git:(master) ✗ sh util/lint-changes.sh hpc-compendium-2.0-gitlab-tudzih git:(master) ✗ sh util/lint-changes.sh
README.md:6 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] README.md:6 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
README.md:7 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3] README.md:7 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]
...@@ -262,33 +261,42 @@ README.md:22 MD022/blanks-around-headings/blanks-around-headers Headings should ...@@ -262,33 +261,42 @@ README.md:22 MD022/blanks-around-headings/blanks-around-headers Headings should
[8< 8<] [8< 8<]
``` ```
#### Fix Markdown ### Check Links
The markdownlint-cli tool can also be used to fix markdown source file. No one likes dead links. Therefore, we check the internal and external links within the markdown
```shell source files. For that, the script `util/check-links.sh` and/or the tool
markdownlint --fix [--config .markdownlint.json] docs/index.md [markdown-link-check](https://github.com/tcort/markdown-link-check) can be used.
```
## Check Links
We can use `util/check-links.sh` or [markdown-link-check](https://github.com/tcort/markdown-link-check) Installation
```Shell Session
~ npm install markdown-link-check
```
```shell ```Shell Session
npm i -D markdown-link-check ~ cd doc.zih.tu-dresden.de/
[8< 8<] ~ markdown-link-check docs/index.md
./node_modules/markdown-link-check/markdown-link-check docs/index.md
FILE: docs/index.md FILE: docs/index.md
[✖] google.de [✖] http://141.76.17.11/hpc-wiki/bin/view/Compendium
[✓] https://docs.olcf.ornl.gov/
1 links checked. [✓] https://nersc.gitlab.io/
[✓] https://www.mkdocs.org/
ERROR: 1 dead links found! [✓] https://docs.gitlab.com/runner/
[✖] google.de → Status: 400 [✓] https://docs.gitlab.com/ee/user/project/pages/
[✖] CONTRIBUTE.md
7 links checked.
ERROR: 2 dead links found!
[✖] http://141.76.17.11/hpc-wiki/bin/view/Compendium → Status: 0
[✖] CONTRIBUTE.md → Status: 400
``` ```
**TODO:** When and how to run `util/check-links.sh`?
### Check Code and Commands
**TODO**
## Content Rules ## Content Rules
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment