Skip to content
Snippets Groups Projects

Use Git aliases in local contribution guide

Merged Bert Wesarg requested to merge local-contrib-git-aliases into preview
1 unresolved thread
1 file
+ 28
28
Compare changes
  • Side-by-side
  • Inline
@@ -83,17 +83,17 @@ Build the Docker image. This might take a bit longer, as `mkdocs` and other nece
@@ -83,17 +83,17 @@ Build the Docker image. This might take a bit longer, as `mkdocs` and other nece
needs to be downloaded, but you have to run it only once in a while.
needs to be downloaded, but you have to run it only once in a while.
Building a container could be done with the following steps:
Building a container could be done with the following steps:
```bash
```console
cd hpc-wiki
marie@local$ cd hpc-wiki
Please register or sign in to reply
doc.zih.tu-dresden.de/util/download-newest-mermaid.js.sh
marie@local$ doc.zih.tu-dresden.de/util/download-newest-mermaid.js.sh
docker build -t hpc-compendium .
marie@local$ docker build -t hpc-compendium .
```
```
To avoid a lot of retyping, use the following in your shell:
To avoid a lot of retyping, set the following Git aliases once inside your local Git clone:
```bash
```console
alias wikiscript="docker run --name=hpc-compendium --rm -w /docs --mount src=${PWD},target=/docs,type=bind hpc-compendium"
marie@local$ git config alias.wikiscript '!docker run --name=hpc-compendium --rm -w /docs --mount src=${PWD},target=/docs,type=bind hpc-compendium'
alias wiki="docker run --name=hpc-compendium -p 8000:8000 --rm -w /docs --mount src=${PWD}/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium"
marie@local$ git config alias.wiki '!docker run --name=hpc-compendium -p 8000:8000 --rm -w /docs --mount src=${PWD}/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium'
```
```
## Working with the Docker Container
## Working with the Docker Container
@@ -104,8 +104,8 @@ Here is a suggestion of a workflow which might be suitable for you.
@@ -104,8 +104,8 @@ Here is a suggestion of a workflow which might be suitable for you.
The command(s) to start the dockerized web server is this:
The command(s) to start the dockerized web server is this:
```bash
```console
wiki mkdocs serve -a 0.0.0.0:8000
marie@local$ git wiki mkdocs serve -a 0.0.0.0:8000
```
```
You can view the documentation via `http://localhost:8000` in your browser, now.
You can view the documentation via `http://localhost:8000` in your browser, now.
@@ -118,8 +118,8 @@ You can view the documentation via `http://localhost:8000` in your browser, now.
@@ -118,8 +118,8 @@ You can view the documentation via `http://localhost:8000` in your browser, now.
If you cannot see the page in your browser, check if you can get the URL for your browser's
If you cannot see the page in your browser, check if you can get the URL for your browser's
address bar from a different terminal window:
address bar from a different terminal window:
```bash
```console
echo http://$(docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -qf "name=hpc-compendium")):8000
marie@local$ echo http://$(docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -qf "name=hpc-compendium")):8000
```
```
You can now update the contents in you preferred editor. The running container automatically takes
You can now update the contents in you preferred editor. The running container automatically takes
@@ -150,8 +150,8 @@ case, failing checks prevent commits (unless you use option `--no-verify`). This
@@ -150,8 +150,8 @@ case, failing checks prevent commits (unless you use option `--no-verify`). This
by adding a pre-commit hook to your local clone of the repository. The following code snippet shows
by adding a pre-commit hook to your local clone of the repository. The following code snippet shows
how to do that:
how to do that:
```bash
```console
cp doc.zih.tu-dresden.de/util/pre-commit .git/hooks/
marie@local$ cp doc.zih.tu-dresden.de/util/pre-commit .git/hooks/
```
```
!!! note
!!! note
@@ -166,8 +166,8 @@ Read on if you want to run a specific check.
@@ -166,8 +166,8 @@ Read on if you want to run a specific check.
If you want to check whether the markdown files are formatted properly, use the following command:
If you want to check whether the markdown files are formatted properly, use the following command:
```bash
```console
wiki markdownlint docs
marie@local$ git wiki markdownlint docs
```
```
#### Spell Checker
#### Spell Checker
@@ -175,14 +175,14 @@ wiki markdownlint docs
@@ -175,14 +175,14 @@ wiki markdownlint docs
For spell-checking a single file, e.g.
For spell-checking a single file, e.g.
`doc.zih.tu-dresden.de/docs/software/big_data_frameworks.md`, use:
`doc.zih.tu-dresden.de/docs/software/big_data_frameworks.md`, use:
```bash
```console
wikiscript doc.zih.tu-dresden.de/util/check-spelling.sh doc.zih.tu-dresden.de/docs/software/big_data_frameworks.md
marie@local$ git wikiscript doc.zih.tu-dresden.de/util/check-spelling.sh doc.zih.tu-dresden.de/docs/software/big_data_frameworks.md
```
```
For spell-checking all files, use:
For spell-checking all files, use:
```bash
```console
wikiscript doc.zih.tu-dresden.de/util/check-spelling.sh -a
marie@local$ git wikiscript doc.zih.tu-dresden.de/util/check-spelling.sh -a
```
```
This outputs all words of all files that are unknown to the spell checker.
This outputs all words of all files that are unknown to the spell checker.
@@ -195,8 +195,8 @@ The script `util/check-no-floating.sh` first checks the hierarchy depth of the p
@@ -195,8 +195,8 @@ The script `util/check-no-floating.sh` first checks the hierarchy depth of the p
the second check tests if every markdown file is included in the navigation section of the
the second check tests if every markdown file is included in the navigation section of the
`mkdocs.yaml` file. Invoke it as follows:
`mkdocs.yaml` file. Invoke it as follows:
```bash
```console
wikiscript doc.zih.tu-dresden.de/util/check-no-floating.sh doc.zih.tu-dresden.de
marie@local$ git wikiscript doc.zih.tu-dresden.de/util/check-no-floating.sh doc.zih.tu-dresden.de
```
```
#### Link Checker
#### Link Checker
@@ -215,8 +215,8 @@ With the script `doc.zih.tu-dresden.de/util/check-links.sh`, you can either chec
@@ -215,8 +215,8 @@ With the script `doc.zih.tu-dresden.de/util/check-links.sh`, you can either chec
To check the links within a single file, e.g.
To check the links within a single file, e.g.
`doc.zih.tu-dresden.de/docs/software/big_data_frameworks.md`, use:
`doc.zih.tu-dresden.de/docs/software/big_data_frameworks.md`, use:
```bash
```console
wikiscript doc.zih.tu-dresden.de/util/check-links.sh docs/software/big_data_frameworks.md
marie@local$ git wikiscript doc.zih.tu-dresden.de/util/check-links.sh docs/software/big_data_frameworks.md
```
```
##### All Modified Files
##### All Modified Files
@@ -225,14 +225,14 @@ The script can also check the links in all modified files, i.e., markdown files
@@ -225,14 +225,14 @@ The script can also check the links in all modified files, i.e., markdown files
of the repository and different to the `preview` branch. Use this script before committing your
of the repository and different to the `preview` branch. Use this script before committing your
changes to make sure your commit passes the CI/CD pipeline.
changes to make sure your commit passes the CI/CD pipeline.
```bash
```console
wikiscript doc.zih.tu-dresden.de/util/check-links.sh -c
marie@local$ git wikiscript doc.zih.tu-dresden.de/util/check-links.sh -c
```
```
##### All Files
##### All Files
Checking the links of all markdown files takes a moment of time:
Checking the links of all markdown files takes a moment of time:
```bash
```console
wikiscript doc.zih.tu-dresden.de/util/check-links.sh -a
marie@local$ git wikiscript doc.zih.tu-dresden.de/util/check-links.sh -a
```
```
Loading