1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
# CP2K Documentation
These are the source of the [CP2K manual](https://manual.cp2k.org/trunk). They are published daily
by [this script](../tools/docker/scripts/test_manual.sh).
To build a local version of the manual perform the following steps:
1. Create and activate a [virtual Python environment](https://docs.python.org/3/tutorial/venv.html):
```
python3 -m venv ../docs_venv
source ../docs_venv/bin/activate
```
1. Install the required Python packages:
```
pip3 install -r ./requirements.txt
```
1. (optional) Build a CP2K binary and use it to generate the `cp2k_input.xml` file:
```
../exe/local/cp2k.psmp --xml
```
1. (optional) Generate Markdown pages from the `cp2k_input.xml` file:
```
./generate_input_reference.py ./cp2k_input.xml
```
1. Run Sphinx:
```
make html
```
1. Browse the HTML output in the `_build/html` directory.
> \[!TIP\]
>
> While the first invocation of Sphinx can be quite slow, subsequent builds are significantly faster
> thanks to its doctree cache. Nevertheless, a build with the full input reference can take several
> minutes and requires a lot of memory. So for development it's advisable to build without the input
> reference. To check cross-references one can generate the input reference and then remove all
> pages except the relevant ones.
______________________________________________________________________
# Syntax Cheat Sheet
The CP2K manual uses Sphinx with the [MyST parser](https://myst-parser.readthedocs.io) for Markdown
support. The following gives a quick overview of the syntax:
## Headings
```
# A first-level heading
## A second-level heading
### A third-level heading
```
## Basic Text Formatting
```
**bold text**
_italic text_
~~strikethrough text~~
`inline code`
```
For a all typography options see the
[MyST documentation](https://myst-parser.readthedocs.io/en/latest/syntax/typography.html).
## Links
- Acronym: `` {term}`ADMM` ``
- Publication: `[](#Wilhelm2018)`
- Other page: `[](../properties/optical/tddft)`
- Input section: `[FORCE_EVAL](#CP2K_INPUT.FORCE_EVAL)`
- Input keyword: `[STRESS_TENSOR](#CP2K_INPUT.FORCE_EVAL.STRESS_TENSOR)`
- External URL: `<https://www.gromacs.org>`
- External URL with label:
`[click here](https://github.com/cp2k/cp2k-examples/blob/master/qm_mm/Protein.pdb)`
## Lists
```
1. First enumerated item
1. Second enumerated item
- A bullet point
- Another bullet point
```
## Tables
```
| foo | bar |
| --- | --- |
| baz | bim |
```
For a all table options see the
[MyST documentation](https://myst-parser.readthedocs.io/en/latest/syntax/tables.html).
## Math
```
Inline math: $A_{ia,jb}$.
Math block:
$$ \begin{align}
A_{ia,jb} &= (\varepsilon_a^{GW}-\varepsilon_i^{GW})\delta_{ij}\delta_{ab}
B_{ia,jb} &= 2 v_{ia,bj} - W_{ib,aj} \quad .
\end{align} $$
```
See also the
[MyST](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#math-shortcuts) and
[MathJax](https://docs.mathjax.org/en/latest/input/tex/index.html) documentation.
## Notes and Warnings
````
```{note}
A note box.
```
```{warning}
A warning box.
```
````
For all available admonitions see the
[MyST documentation](https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html).
## Code Blocks
````
```python
for i in range(10):
print("Hello World")
```
````
## Diagrams
````
```mermaid
block-beta
a b
a --> b
```
````
For details see the [Mermaid documentation](https://mermaid.js.org/intro/) and also check out their
great [live editor](https://mermaid.live).
## Videos
````
```{youtube} teHVWKwBOTU
---
url_parameters: ?start=1500
align: center
privacy_mode:
---
```
````
The above example links to https://www.youtube.com/watch?v=teHVWKwBOTU at the 1500 seconds time
mark.
|