Skip to content

Commit f0837a2

Browse files
committed
Rewrite the Quadlet documentation.
This commit does the following: - Splits the podman-systemd.unit.5.md into multiple files - one for each quadlet file type, podman-quadlet.7.md for general quadlet information and podman-quadlet-basic-usage.7.md for quadlet examples. - Majority of the text in the new files is copied from the podman-systemd.unit.5.md - Removes the original podman-systemd.unit.5.md file and links to the podman-quadlet.7.md instead. - Adds support for very simple condditional in the markdown_preprocess. - Uses new logic in markdown_preprocess in options/*.md to use a single .md file for both podman subcommands man-pages and quadlet man-pages. This deduplicates the Quadlet man-pages a lot. - Adds new `@@option quadlet:source.md` preprocess command to import such .md files from options directory. Signed-off-by: Jan Kaluza <[email protected]>
1 parent 098f1eb commit f0837a2

File tree

137 files changed

+3383
-2749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+3383
-2749
lines changed

docs/source/markdown/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ podman-manifest-create.1.md
3434
podman-manifest-inspect.1.md
3535
podman-manifest-push.1.md
3636
podman-mount.1.md
37+
podman-network-create.1.md
3738
podman-network-ls.1.md
3839
podman-network-reload.1.md
3940
podman-pause.1.md
@@ -69,3 +70,11 @@ podman-unpause.1.md
6970
podman-update.1.md
7071
podman-volume-ls.1.md
7172
podman-wait.1.md
73+
podman-build.unit.5.md
74+
podman-container.unit.5.md
75+
podman-image.unit.5.md
76+
podman-kube.unit.5.md
77+
podman-kube-down.1.md
78+
podman-network.unit.5.md
79+
podman-pod.unit.5.md
80+
podman-volume.unit.5.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.so man7/podman-quadlet.7
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.so man5/podman-systemd.unit.5
1+
.so man7/podman-quadlet.7

docs/source/markdown/options/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ mechanism:
1717

1818
```
1919
@@option foo ! includes options/foo.md
20+
@@option quadlet:foo ! includes options/foo.md with `is_quadlet=True`
21+
! See "Jinja2 Templating" below.
2022
```
2123

2224
The tool that does this is `hack/markdown-preprocess`. It is a python
@@ -25,6 +27,41 @@ file, this script creates a `.md` file that can then be read by
2527
`go-md2man`, `sphinx`, anything that groks markdown. This runs as
2628
part of `make docs`.
2729

30+
Conditionals
31+
============
32+
33+
Some options are used as both Podman command line option and Quadlet
34+
option. To reduce the duplication, the very limited conditionals are
35+
supported in the Markdown files.
36+
37+
The basic condition:
38+
39+
```
40+
<< if variable >>
41+
...
42+
<< endif >>
43+
```
44+
45+
It is possible to use the `not` keyword and `else` keyword:
46+
47+
```
48+
<< if not variable >>
49+
...
50+
<< else >>
51+
...
52+
<< endif >>
53+
```
54+
55+
It is also possible to do inline conditions like this:
56+
57+
```
58+
<< "foo" if variable else "bar" >>
59+
```
60+
61+
Following variables are available for Jinja2 Templates:
62+
63+
- `is_quadlet`: True if file is imported using `@@option quadlet:foo`.
64+
2865
Special Substitutions
2966
=====================
3067

docs/source/markdown/options/add-host.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
####> This option file is used in:
2-
####> podman build, create, farm build, pod create, run
2+
####> podman build, podman-container.unit.5.md.in, create, farm build, pod create, podman-pod.unit.5.md.in, run
33
####> If file is edited, make sure the changes
44
####> are applicable to all of those.
5+
<< if is_quadlet >>
6+
### `AddHost=hostname[;hostname[;...]]:ip`
7+
<< else >>
58
#### **--add-host**=*hostname[;hostname[;...]]*:*ip*
9+
<< endif >>
610

711
Add a custom host-to-IP mapping to the <<container|pod>>'s `/etc/hosts` file.
812

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
####> This option file is used in:
2+
####> podman podman-image.unit.5.md.in, pull
3+
####> If file is edited, make sure the changes
4+
####> are applicable to all of those.
5+
<< if is_quadlet >>
6+
### `AllTags=true`
7+
<< else >>
8+
#### **--all-tags**, **-a**
9+
<< endif >>
10+
11+
All tagged images in the repository are pulled.
12+
13+
*IMPORTANT: When using the all-tags flag, Podman does not iterate over the search registries in the **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)** but always uses docker.io for unqualified image names.*
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
####> This option file is used in:
2-
####> podman create, kube play, run
2+
####> podman podman-container.unit.5.md.in, create, kube play, run
33
####> If file is edited, make sure the changes
44
####> are applicable to all of those.
5+
<< if is_quadlet >>
6+
### `Annotation=key=value`
7+
<< else >>
58
#### **--annotation**=*key=value*
9+
<< endif >>
610

711
Add an annotation to the container<<| or pod>>. This option can be set multiple times.

docs/source/markdown/options/annotation.image.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
####> This option file is used in:
2-
####> podman build, farm build
2+
####> podman build, podman-build.unit.5.md.in, farm build
33
####> If file is edited, make sure the changes
44
####> are applicable to all of those.
5+
<< if is_quadlet >>
6+
### `Annotation=annotation=value [annotation=value ...]`
7+
<< else >>
58
#### **--annotation**=*annotation=value*
9+
<< endif >>
610

711
Add an image *annotation* (e.g. annotation=*value*) to the image metadata. Can
812
be used multiple times.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
####> This option file is used in:
2-
####> podman create, pull, run
2+
####> podman podman-build.unit.5.md.in, create, podman-image.unit.5.md.in, pull, run
33
####> If file is edited, make sure the changes
44
####> are applicable to all of those.
5+
<< if is_quadlet >>
6+
### `Arch=ARCH`
7+
<< else >>
58
#### **--arch**=*ARCH*
9+
<< endif >>
10+
611
Override the architecture, defaults to hosts, of the image to be pulled. For example, `arm`.
712
Unless overridden, subsequent lookups of the same image in the local storage matches this architecture, regardless of the host.

docs/source/markdown/options/authfile.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
####> This option file is used in:
2-
####> podman artifact pull, artifact push, auto update, build, container runlabel, create, farm build, image sign, kube play, login, logout, manifest add, manifest inspect, manifest push, pull, push, run, search
2+
####> podman artifact pull, artifact push, auto update, build, podman-build.unit.5.md.in, container runlabel, create, farm build, image sign, podman-image.unit.5.md.in, kube play, login, logout, manifest add, manifest inspect, manifest push, pull, push, run, search
33
####> If file is edited, make sure the changes
44
####> are applicable to all of those.
5+
<< if is_quadlet >>
6+
### `AuthFile=path`
7+
<< else >>
58
#### **--authfile**=*path*
9+
<< endif >>
610

711
Path of the authentication file. Default is `${XDG_RUNTIME_DIR}/containers/auth.json` on Linux, and `$HOME/.config/containers/auth.json` on Windows/macOS.
812
The file is created by **[podman login](podman-login.1.md)**. If the authorization state is not found there, `$HOME/.docker/config.json` is checked, which is set using **docker login**.

0 commit comments

Comments
 (0)