### Requirements
The code is documented with [Doxygen][doxygen] JavaDoc style, a prettified documentation
-also requires [breathe][breathe] and [Sphinx][sphinx] for building sane documentation pages.
+also requires [breathe][breathe], [Sphinx][sphinx] and [Sphinx tabs][sphinx-tabs] for building sane documentation pages.
It is not however required.
[doxygen]:https://www.stack.nl/~dimitri/doxygen/manual/index.html
[breathe]: https://github.com/michaeljones/breathe
[sphinx]: http://sphinx-doc.org/
+[sphinx-tabs]: https://sphinx-tabs.readthedocs.io/
You can get the extra dependencies with pip:
```sh
-pip install -U Sphinx breathe
+pip install -U Sphinx sphinx-tabs breathe
# Alternatively
pip -r doc/requirements.txt
```
### Building documentation
-If you satisfy the requirements, it's as easy as `make doc`, which builds the documentation in this folder.
+If you satisfy the requirements, it's as easy as `make doc`, which builds the documentation in this folder `doc/html`.
+```sh
+$ meson build_dir -Ddoc=enabled
+$ ninja -C build_dir doc
+```
subprocess.call('doxygen')
# Add any Sphinx extension module names here, as strings.
-extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'breathe']
+extensions = [
+ 'sphinx.ext.todo',
+ 'sphinx.ext.viewcode',
+ 'sphinx_tabs.tabs',
+ 'breathe'
+]
# Breathe configuration
breathe_projects = {"libkres": "doxyxml"}
else
python_sphinx_rtd_theme = run_command('python2', '-c', 'import sphinx_rtd_theme', check: false)
if python_sphinx_rtd_theme.returncode() != 0
- error('missing doc dependency: python sphinx_rtd_theme')
+ error('missing doc dependency: python sphinx_rtd_theme')
+ endif
+ python_sphinx_tabs = run_command('python2', '-c', 'import sphinx_tabs', check: false)
+ if python_sphinx_tabs.returncode() != 0
+ error('missing doc dependency: python python-sphinx-tabs')
endif
endif
else
if python_sphinx_rtd_theme.returncode() != 0
error('missing doc dependency: python sphinx_rtd_theme')
endif
+ python_sphinx_tabs = run_command('python3', '-c', 'import sphinx_tabs', check: false)
+ if python_sphinx_tabs.returncode() != 0
+ error('missing doc dependency: python python-sphinx-tabs')
+ endif
endif
message('------------------------')
Listening on network interfaces
===============================
-Network interfaces to listen on and supported protocols are configured using :func:`net.listen()` function.
-
The following configuration instructs Knot Resolver to receive standard unencrypted DNS queries on IP addresses `192.0.2.1` and `2001:db8::1`. Encrypted DNS queries are accepted using DNS-over-TLS protocol on all IP addresses configured on network interface `eth0`, TCP port 853.
-.. code-block:: lua
- -- unencrypted DNS on port 53 is default
- net.listen('192.0.2.1')
- net.listen('2001:db8::1')
- net.listen(net.eth0, 853, { kind = 'tls' })
+.. tabs::
+
+ .. tab:: yaml
+
+ .. code-block:: yaml
+
+ network:
+ listen:
+ - interface: ['192.0.2.1', '2001:db8::1'] # unencrypted DNS on port 53 is default
+ - interface: 'eth0'
+ port: 853
+ kind: 'dot'
+
+
+ .. tab:: lua legacy
+
+ Network interfaces to listen on and supported protocols are configured using :func:`net.listen()` function.
+
+ .. code-block:: lua
+
+ -- unencrypted DNS on port 53 is default
+ net.listen('192.0.2.1')
+ net.listen('2001:db8::1')
+ net.listen(net.eth0, 853, { kind = 'tls' })
+
.. warning::
Sphinx>=3.0.0
+sphinx-tabs
breathe