Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hpc-compendium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZIH
hpcsupport
hpc-compendium
Commits
2ac0567e
Commit
2ac0567e
authored
3 years ago
by
Martin Schroschk
Browse files
Options
Downloads
Patches
Plain Diff
More on prompts and code blocks
parent
bb819f4d
No related branches found
No related tags found
3 merge requests
!322
Merge preview into main
,
!319
Merge preview into main
,
!221
Update readme
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc.zih.tu-dresden.de/README.md
+69
-20
69 additions, 20 deletions
doc.zih.tu-dresden.de/README.md
with
69 additions
and
20 deletions
doc.zih.tu-dresden.de/README.md
+
69
−
20
View file @
2ac0567e
...
@@ -400,18 +400,18 @@ things as clear for readers as possible and provide a consistent documentation,
...
@@ -400,18 +400,18 @@ things as clear for readers as possible and provide a consistent documentation,
be followed.
be followed.
1.
Use ticks to mark code blocks and commands, not italic font.
1.
Use ticks to mark code blocks and commands, not italic font.
1.
Specify language for code blocks (
[
see below
](
#code-blocks-and-syntax-highlighting
)
).
1.
Specify language for code blocks, refer to
[
highlight.js
](
https://highlightjs.org/static/demo/
)
for supported languages.
1.
All code blocks and commands should be runnable from a login node or a node within a specific partition (e.g.,
`ml`
).
1.
All code blocks and commands should be runnable from a login node or a node within a specific partition (e.g.,
`ml`
).
1.
It should be clear from the prompt, where the command is run (e.g. local machine, login node or
1.
It should be clear from the prompt, where the command is run (e.g. local machine, login node or
specific partition). We follow this rules regarding prompts
specific partition).
#### Prompts
We follow this rules regarding prompts:
| Host/Partition | Prompt |
| Host/Partition | Prompt |
|------------------------|------------------|
|------------------------|------------------|
| Login nodes |
`marie@
taurus
$`
|
| Login nodes |
`marie@
login
$`
|
| Arbirtray compute node |
`marie@compute$`
|
| Arbirtray compute node |
`marie@compute$`
|
|
`haswell`
partition |
`marie@haswell$`
|
|
`haswell`
partition |
`marie@haswell$`
|
|
`ml`
partition |
`marie@ml$`
|
|
`ml`
partition |
`marie@ml$`
|
...
@@ -419,23 +419,72 @@ be followed.
...
@@ -419,23 +419,72 @@ be followed.
|
`alpha`
partition |
`marie@alpha$`
|
|
`alpha`
partition |
`marie@alpha$`
|
|
`romeo`
partition |
`marie@romeo$`
|
|
`romeo`
partition |
`marie@romeo$`
|
|
`julia`
partition |
`marie@julia$`
|
|
`julia`
partition |
`marie@julia$`
|
|
l
ocalhost |
`marie@local$`
|
|
L
ocalhost |
`marie@local$`
|
**Always use a prompt**
, even there is no output. Using some magic, the prompt is identified and will
*Remarks:*
not be copied!
*
**Always use a prompt**
, even there is no output provided for the show command.
*
Using some magic, the prompt as well as the output is identified and will not be copied!
*
Stick to the
[
generic user name
](
#data-privacy-and-generic-user-name
)
`marie`
.
#### Code Blocks and Syntax Highlighting
#### Code Blocks and Syntax Highlighting
This project makes use of the extension
This project makes use of the extension
[
pymdownx.highlight
](
https://squidfunk.github.io/mkdocs-material/reference/code-blocks/
)
for syntax
[
pymdownx.highlight
](
https://squidfunk.github.io/mkdocs-material/reference/code-blocks/
)
for syntax
highlighting.
highlighting. There is a complete list of supported
[
language short codes
](
https://pygments.org/docs/lexers/
)
.
For consistency, use the following short codes within this project:
*
`bash`
for shell scripts
*
`console`
for command lines including prompt w/o output
*
`python`
for Python source code
*
`pycon`
for Python console output
There is complete list of supported
[
language short codes
](
https://pygments.org/docs/lexers/
)
.
Shell session and console:
Use the following short codes within this project for consistency:
*
`{bash}`
for shell scripts
````
markdown
*
`{shell-session}`
for command lines including prompt
```
console
*
`{python}`
for Python source code
marie@login$
ls
foo
bar
```
````
Shell scripts such as jobfiles:
````
markdown
```
bash
#!/bin/bash
#SBATCH -N 1
#SBATCH -t 01:00:00
#SBATCH -o slurm-%j.out
module load foss
srun a.out
```
````
Python source code:
````
markdown
```
python
from
time
import
gmtime
,
strftime
print
(
strftime
(
"
%Y-%m-%d %H:%M:%S
"
,
gmtime
()))
```
````
Python console:
````
markdown
```
pycon
>>> from time import gmtime, strftime
>>> print(strftime("%Y-%m-%d %H:%M:%S", gmtime()))
2021-08-03 07:20:33
```
````
Line numbers can be added via
Line numbers can be added via
...
@@ -476,10 +525,10 @@ _Result_:
...
@@ -476,10 +525,10 @@ _Result_:
### Data Privacy and Generic User Name
### Data Privacy and Generic User Name
Where possible, replace login, project name and other private data with clearly arbitrary placeholders.
Where possible, replace login, project name and other private data with clearly arbitrary placeholders.
E.g., use generic login
`marie`
and project name
`p_marie`
.
E.g., use
the
generic login
`marie`
and
the corresponding
project name
`p_marie`
.
```
Shell Session
```
console
taurus
$ ls -l
marie@login
$
ls
-l
drwxr-xr-x 3 marie p_marie 4096 Jan 24 2020 code
drwxr-xr-x 3 marie p_marie 4096 Jan 24 2020 code
drwxr-xr-x 3 marie p_marie 4096 Feb 12 2020 data
drwxr-xr-x 3 marie p_marie 4096 Feb 12 2020 data
-rw-rw---- 1 marie p_marie 4096 Jan 24 2020 readme.md
-rw-rw---- 1 marie p_marie 4096 Jan 24 2020 readme.md
...
@@ -491,7 +540,7 @@ If showing only a snippet of a long output, omissions are marked with `[...]`.
...
@@ -491,7 +540,7 @@ If showing only a snippet of a long output, omissions are marked with `[...]`.
### Mark Placeholders
### Mark Placeholders
Stick to the Unix rules on optional and required arguments, and selection of item sets
.
Stick to the Unix rules on optional and required arguments, and selection of item sets
:
*
`<required argument or value>`
*
`<required argument or value>`
*
`[optional argument or value]`
*
`[optional argument or value]`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment