dhcpkit.ipv6.server.generate_config_docs module¶
A script to generate .rst documentation based on the config schema
-
dhcpkit.ipv6.server.generate_config_docs.
create_file
(name, args)[source]¶ Create a file, or a file-like dummy if dry-run is enabled
Parameters: - name – The relative file/path name
- args – The command like arguments
Returns: A file-like object
-
dhcpkit.ipv6.server.generate_config_docs.
handle_args
(args: Iterable)[source]¶ Handle the command line arguments.
Parameters: args – Command line arguments Returns: The arguments object
-
dhcpkit.ipv6.server.generate_config_docs.
heading
(text: str, underline: str) → str[source]¶ Create a heading using the specified underline character.
Parameters: - text – The text to use as the heading
- underline – The character to underline with
Returns: The heading in rst format
-
dhcpkit.ipv6.server.generate_config_docs.
key_doc
(info: Union) → List[source]¶ Generate documentation for a key.
Parameters: info – The information object for this key Returns: The documentation for that key
-
dhcpkit.ipv6.server.generate_config_docs.
link_destination
(name: str) → str[source]¶ Create an rst link.
Parameters: name – The destination to link to Returns: The reStructuredText link
-
dhcpkit.ipv6.server.generate_config_docs.
link_to
(text: str, link: str = None) → str[source]¶ Make the text a reference link.
Parameters: - text – The text to link
- link – The link destination, if different from the text
Returns: The texts as a reference link
-
dhcpkit.ipv6.server.generate_config_docs.
main
(args: Iterable) → int[source]¶ Generate .rst documentation based on the config schema
Parameters: args – Command line arguments Returns: Program exit code
-
dhcpkit.ipv6.server.generate_config_docs.
nicer_type_name
(name: str) → str[source]¶ Make a nicer name for a type.
Parameters: name – The ugly name Returns: The nicer name
-
dhcpkit.ipv6.server.generate_config_docs.
normalise_link_name
(link: str) → str[source]¶ Convert i.e. “filter_factory” to “filters”
Parameters: link – The original link name Returns: The normalised link name
-
dhcpkit.ipv6.server.generate_config_docs.
reindent
(text: str, new_indent: str = '') → str[source]¶ Fix the indentation.
Parameters: - text – The original text with unknown indentation
- new_indent – The string to indent with
Returns: The text with fixed indentation
-
dhcpkit.ipv6.server.generate_config_docs.
run
() → int[source]¶ Run the main program and handle exceptions
Returns: The program exit code