mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-02-03 18:49:28 -05:00
doc: added EPUB target into Makefile
This commit is contained in:
parent
1840e6aebc
commit
a71174f4f2
6 changed files with 88 additions and 4 deletions
|
|
@ -1,8 +1,8 @@
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
SUBDIRS = src tests tests-fuzz python samples distro doc
|
||||
|
||||
.PHONY: singlehtml install-singlehtml
|
||||
singlehtml install-singlehtml:
|
||||
.PHONY: singlehtml epub install-singlehtml install-epub
|
||||
singlehtml install-singlehtml epub install-epub:
|
||||
$(MAKE) -C doc $@
|
||||
|
||||
.PHONY: check-compile
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ man_SPHINXOPTS = $(_SPHINXOPTS) \
|
|||
$(SPHINXOPTS) \
|
||||
$(srcdir)
|
||||
|
||||
.PHONY: html-local singlehtml pdf-local info-local man install-html-local install-singlehtml install-pdf-local install-info-local
|
||||
.PHONY: html-local singlehtml pdf-local info-local epub man install-html-local install-singlehtml install-pdf-local install-info-local install-epub
|
||||
|
||||
man_MANS =
|
||||
|
||||
|
|
@ -155,6 +155,15 @@ install-singlehtml: singlehtml
|
|||
$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/*.html $(DESTDIR)/$(docdir)/
|
||||
$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/_static/* $(DESTDIR)/$(docdir)/_static/
|
||||
|
||||
epub:
|
||||
$(AM_V_SPHINX)$(SPHINXBUILD) -b epub -A today=$(RELEASE_DATE) -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/epub
|
||||
$(AM_V_ECHO)
|
||||
$(AM_V_ECHO) "Build finished. The EPUB file is in $(SPHINXBUILDDIR)/epub/."
|
||||
|
||||
install-epub:
|
||||
$(INSTALL) -d $(DESTDIR)/$(docdir)
|
||||
$(INSTALL_DATA) $(SPHINXBUILDDIR)/epub/KnotDNS.epub $(DESTDIR)/$(docdir)/
|
||||
|
||||
if HAVE_PDFLATEX
|
||||
pdf-local:
|
||||
$(AM_V_SPHINX)$(SPHINXBUILD) -b latex -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/latex
|
||||
|
|
@ -201,7 +210,7 @@ $(MANPAGES_IN): $(MANPAGES_RST)
|
|||
$(AM_V_ECHO) "Build finished. The man pages are in man/."
|
||||
|
||||
else
|
||||
html-local singlehtml pdf-local info-local man install-html-local install-singlehtml install-pdf-local install-info-local:
|
||||
html-local singlehtml pdf-local info-local epub man install-html-local install-singlehtml install-pdf-local install-info-local install-epub:
|
||||
$(AM_V_ECHO) "Please install sphinx (python-sphinx) to generate Knot DNS documentation."
|
||||
endif # HAVE_SPHINXBUILD
|
||||
|
||||
|
|
|
|||
11
doc/conf.py
11
doc/conf.py
|
|
@ -256,3 +256,14 @@ texinfo_documents = [
|
|||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# -- Options for Epub output ----------------------------------------------
|
||||
|
||||
epub_title = project
|
||||
epub_author = author
|
||||
epub_publisher = author
|
||||
epub_copyright = copyright
|
||||
|
||||
epub_theme = 'theme_epub'
|
||||
epub_cover = ('_static/logo.svg', 'epub-cover.html')
|
||||
epub_exclude_files = ['epub-cover.xhtml']
|
||||
33
doc/theme_epub/epub-cover.html
Normal file
33
doc/theme_epub/epub-cover.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{#
|
||||
epub/epub-cover.html
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sample template for the html cover page.
|
||||
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "layout.html" %}
|
||||
{%- block header %}{% endblock %}
|
||||
{%- block rootrellink %}{% endblock %}
|
||||
{%- block relbaritems %}{% endblock %}
|
||||
{%- block sidebarlogo %}{% endblock %}
|
||||
{%- block linktags %}{% endblock %}
|
||||
{%- block relbar1 %}{% endblock %}
|
||||
{%- block sidebar1 %}{% endblock %}
|
||||
{%- block sidebar2 %}{% endblock %}
|
||||
{%- block footer %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="epub-cover">
|
||||
<img src="{{ image }}" alt="Cover image" />
|
||||
<h1>Knot DNS Documentation</h1>
|
||||
{% if version %}
|
||||
<h2 class="version">Release {{ version }}</h2>
|
||||
{% endif %}{% if copyright %}
|
||||
<h2>{{ copyright }}</h2>
|
||||
{% endif %}{% if today %}
|
||||
<p class="date">{{ today }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
28
doc/theme_epub/static/main.css
Normal file
28
doc/theme_epub/static/main.css
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
@import url("epub.css");
|
||||
|
||||
/* Addendum for admonitions */
|
||||
@import url("admons.css");
|
||||
|
||||
/* Other overrides here */
|
||||
.epub-cover {
|
||||
border-top: 1px solid black;
|
||||
padding: 10px 25px 0px 25px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.epub-cover img {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
.epub-cover .version {
|
||||
font-style: italic;
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.epub-cover .date {
|
||||
margin-top: 200px;
|
||||
font-size: 125%;
|
||||
}
|
||||
3
doc/theme_epub/theme.conf
Normal file
3
doc/theme_epub/theme.conf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[theme]
|
||||
inherit = epub
|
||||
stylesheet = main.css
|
||||
Loading…
Reference in a new issue