Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs directory structure to reflect diátaxis #520

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ __pycache__
src/_features.h
netplan_cli/_features.py
dbus/io.netplan.Netplan.service
.DS_Store
2 changes: 1 addition & 1 deletion doc/.sphinx/spellingcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ matrix:
- .custom_wordlist.txt
output: .sphinx/.wordlist.dic
sources:
- _build/**/*.html|!_build/genindex/index.html|!_build/apidoc/**/*.html
- _build/**/*.html|!_build/genindex/index.html|!_build/reference/apidoc/**/*.html
pipeline:
- pyspelling.filters.html:
comments: false
Expand Down
6 changes: 4 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@
# For example: 'explanation/old-name.html': '../how-to/prettify.html',

redirects = {
'README.md': '/',
'netplan': '/netplan-yaml',
'README.md': '../',
'netplan': '../reference/netplan-yaml',
'netplan-everywhere': '../howto/netplan-everywhere',
'netplan-yaml': '../reference/netplan-yaml',
}

############################################################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/security.md → doc/explanation/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ varying key lengths of RSA, DSA, ECDSA, ECDH and EdDSA.
### Cryptographic technology exposed to the user

Netplan allows to configure certain cryptographic technology that can be
described in its {doc}`netplan-yaml`. Notable settings include the
described in its {doc}`../reference/netplan-yaml`. Notable settings include the
{ref}`yaml-auth` block, e.g. `auth.password` can be used configure `WPA-PSK` or
`WPA-EAP` secrets, which can also be a special `hash:...` value for
`wpa_supplicant`. The `auth.method` field controls the technology, such as
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This guide shows how to configure a virtual machine (VM) host using Netplan and the `virsh` interface. The host in this scenario has four network interface (NICs). The host uses network bonding and three VLAN networks.


```{include} reuse/configure-vm-prerequisites.md
```{include} ../reuse/configure-vm-prerequisites.md

```

Expand Down Expand Up @@ -35,7 +35,7 @@ This guide shows how to configure a virtual machine (VM) host using Netplan and
- Firewall configured; see [UFW](https://help.ubuntu.com/community/UFW).


```{include} reuse/configure-vm-disable-netfilter.md
```{include} ../reuse/configure-vm-disable-netfilter.md

```

Expand Down Expand Up @@ -141,16 +141,16 @@ Configure Netplan:
```


```{include} reuse/configure-vm-using-virsh.md
```{include} ../reuse/configure-vm-using-virsh.md

```


```{include} reuse/configure-vm-check-networking-delete-default.md
```{include} ../reuse/configure-vm-check-networking-delete-default.md

```


```{include} reuse/configure-vm-create-bridged-networks.md
```{include} ../reuse/configure-vm-create-bridged-networks.md

```
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
This guide shows how to configure a virtual machine (VM) host using Netplan and the `virsh` interface. The host in this scenario has a single network interface (NIC) and three VLAN networks.


```{include} reuse/configure-vm-prerequisites.md
```{include} ../reuse/configure-vm-prerequisites.md

```


```{include} reuse/configure-vm-prerequisites-system.md
```{include} ../reuse/configure-vm-prerequisites-system.md

```

Expand All @@ -29,7 +29,7 @@ This guide shows how to configure a virtual machine (VM) host using Netplan and
- Firewall configured; see [UFW](https://help.ubuntu.com/community/UFW).


```{include} reuse/configure-vm-disable-netfilter.md
```{include} ../reuse/configure-vm-disable-netfilter.md

```

Expand Down Expand Up @@ -118,16 +118,16 @@ Configure Netplan:
```


```{include} reuse/configure-vm-using-virsh.md
```{include} ../reuse/configure-vm-using-virsh.md

```


```{include} reuse/configure-vm-check-networking-delete-default.md
```{include} ../reuse/configure-vm-check-networking-delete-default.md

```


```{include} reuse/configure-vm-create-bridged-networks.md
```{include} ../reuse/configure-vm-create-bridged-networks.md

```
10 changes: 5 additions & 5 deletions doc/single-nic-vm-host.md → doc/howto/single-nic-vm-host.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
This guide shows how to configure a virtual-machine host using Netplan and the `virsh` interface. The host in this scenario has a single network interface.


```{include} reuse/configure-vm-prerequisites.md
```{include} ../reuse/configure-vm-prerequisites.md

```


```{include} reuse/configure-vm-prerequisites-system.md
```{include} ../reuse/configure-vm-prerequisites-system.md

```

Expand All @@ -26,7 +26,7 @@ This guide shows how to configure a virtual-machine host using Netplan and the `
- Firewall configured; see [UFW](https://help.ubuntu.com/community/UFW).


```{include} reuse/configure-vm-disable-netfilter.md
```{include} ../reuse/configure-vm-disable-netfilter.md

```

Expand Down Expand Up @@ -81,12 +81,12 @@ Configure Netplan:
```


```{include} reuse/configure-vm-using-virsh.md
```{include} ../reuse/configure-vm-using-virsh.md

```


```{include} reuse/configure-vm-check-networking-delete-default.md
```{include} ../reuse/configure-vm-check-networking-delete-default.md

```

Expand Down
31 changes: 15 additions & 16 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Netplan documentation

```{toctree}
---
maxdepth: 2
hidden: true
---
tutorial
howto
reference
explanation
:maxdepth: 2
:hidden: true

tutorial/index
howto/index
reference/index
explanation/index
```

**Netplan** is a network configuration abstraction renderer.
Expand All @@ -27,14 +26,14 @@ systemd-networkd.

::::{grid} 1 1 2 2

:::{grid-item-card} **[Tutorial](/netplan-tutorial)**
:link: /netplan-tutorial
:::{grid-item-card} **[Tutorial](tutorial/netplan-tutorial)**
:link: tutorial/netplan-tutorial
:link-type: doc

**Get started** - hands-on introduction to Netplan for new users
:::
:::{grid-item-card} **[How-to guides](/examples)**
:link: /examples
:::{grid-item-card} **[How-to guides](howto/examples)**
:link: howto/examples
:link-type: doc

**Step-by-step guides** covering key operations and common tasks
Expand All @@ -44,14 +43,14 @@ systemd-networkd.
::::{grid} 1 1 2 2
:reverse:

:::{grid-item-card} **[Reference](/reference)**
:link: /reference
:::{grid-item-card} **[Reference](reference/index)**
:link: reference/index
:link-type: doc

**Technical information** - specifications, APIs, architecture
:::
:::{grid-item-card} **[Explanation](/explanation)**
:link: /explanation
:::{grid-item-card} **[Explanation](explanation/index)**
:link: explanation/index
:link-type: doc

**Discussion and clarification** of key topics
Expand Down
6 changes: 3 additions & 3 deletions doc/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
if pandoc.found()
custom_target(
input: ['manpage-header.md', 'structure-id.md', 'netplan-yaml.md', 'manpage-footer.md'],
input: ['manpage-header.md', 'explanation/structure-id.md', 'reference/netplan-yaml.md', 'manpage-footer.md'],
output: 'netplan.5',
command: [pandoc, '-s', '-o', '@OUTPUT@', '--from=markdown-smart', '@INPUT@'],
install: true,
install_dir: join_paths(get_option('mandir'), 'man5'))
custom_target(
input: 'netplan-yaml.md',
input: 'reference/netplan-yaml.md',
output: 'netplan.html',
command: [pandoc, '-s', '--metadata', 'title="Netplan reference"', '--toc', '-o', '@OUTPUT@', '@INPUT@'],
install: true,
Expand All @@ -15,7 +15,7 @@ if pandoc.found()
'netplan-apply', 'netplan-dbus', 'netplan-generate', 'netplan-get', 'netplan-set',
'netplan-try', 'netplan-info', 'netplan-ip', 'netplan-status', 'netplan-rebind',
]
markdown = files(doc + '.md')
markdown = files('reference/' + doc + '.md')
manpage = doc + '.8'
custom_target(
input: markdown,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/netplan-yaml.md → doc/reference/netplan-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -2192,4 +2192,4 @@ consumer of that back end. Currently, this is only used with `NetworkManager`.

> Can be used as a fallback mechanism to missing key-file settings.

<!--- vim: ft=markdown -->
<!--- vim: ft=markdown -->
slyon marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/validate_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ fi
for term in $(sed -n 's/[ ]\+{"\([a-z0-9-]\+\)", YAML_[A-Z]\+_NODE.*/\1/p' src/parse.c | sort | uniq); do
# it can be documented in the following ways.
# 1. "Properties for device type `blah:`
if egrep "## Properties for device type \`$term:\`" doc/netplan-yaml.md > /dev/null; then
if egrep "## Properties for device type \`$term:\`" doc/reference/netplan-yaml.md > /dev/null; then
continue
fi

# 2. "[blah, ]**blah**[, **blah2**]: (scalar|bool|...)
if egrep "Alias: \*\*\`$term\`\*\*|\*\*\`$term\`\*\*.*\((scalar|boolean|mapping|sequence of scalars|sequence of mappings|sequence of sequence of scalars)" doc/netplan-yaml.md > /dev/null; then
if egrep "Alias: \*\*\`$term\`\*\*|\*\*\`$term\`\*\*.*\((scalar|boolean|mapping|sequence of scalars|sequence of mappings|sequence of sequence of scalars)" doc/reference/netplan-yaml.md > /dev/null; then
continue
fi

Expand Down
Loading