diff options
author | rebortg <github@ghlr.de> | 2020-11-09 21:16:02 +0100 |
---|---|---|
committer | rebortg <github@ghlr.de> | 2020-11-09 21:29:03 +0100 |
commit | c46473a849f20f8587b37ce5996979ea686685fa (patch) | |
tree | 5dc4f7aef1555d86a430e86605e8afa6ff95d4dd /docs/contributing/documentation.rst | |
parent | 099b01d67fba8b817545a534b93540cc1853af01 (diff) | |
download | vyos-documentation-c46473a849f20f8587b37ce5996979ea686685fa.tar.gz vyos-documentation-c46473a849f20f8587b37ce5996979ea686685fa.zip |
docs: add ..cmdinclude:: directive
Diffstat (limited to 'docs/contributing/documentation.rst')
-rw-r--r-- | docs/contributing/documentation.rst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/contributing/documentation.rst b/docs/contributing/documentation.rst index 92af881c..e8d1dba5 100644 --- a/docs/contributing/documentation.rst +++ b/docs/contributing/documentation.rst @@ -200,6 +200,44 @@ For a inline operational level command use ``:opcmd:`` :opcmd:`add system image` +cmdinclude +"""""""""" + +To minimize redundancy there is a special include directive. It include a txt +file and replace the ``{{ var0 }}`` - ``{{ var9 }}`` with the correct value + +.. code-block:: none + + .. cmdinclude:: interface-address.txt + :var0: ethernet + :var1: eth1 + +the content of interface-address.txt looks like this + +.. code-block:: none + + .. cfgcmd:: set interfaces {{ var0 }} <interface> address <address | dhcp | + dhcpv6> + + Configure interface `<interface>` with one or more interface + addresses. + + * **address** can be specified multiple times as IPv4 and/or IPv6 + address, e.g. 192.0.2.1/24 and/or 2001:db8::1/64 + * **dhcp** interface address is received by DHCP from a DHCP server + on this segment. + * **dhcpv6** interface address is received by DHCPv6 from a DHCPv6 + server on this segment. + + Example: + + .. code-block:: none + + set interfaces {{ var0 }} {{ var1 }} address 192.0.2.1/24 + set interfaces {{ var0 }} {{ var1 }} address 192.0.2.2/24 + set interfaces {{ var0 }} {{ var1 }} address 2001:db8::ffff/64 + set interfaces {{ var0 }} {{ var1 }} address 2001:db8:100::ffff/64 + vytask """""" |