diff --git a/.reuse/dep5 b/.reuse/dep5 index 5c3e72a..3d94d06 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,7 +3,7 @@ Upstream-Name: notes Upstream-Contact: Heiko Schaefer Source: https://codeberg.org/openpgp/notes -Files: book/assets/* book/source/img/* +Files: book/assets/* book/source/img/* book/source/_static/epub/img/* book/source/_static/html/img/* Copyright: 2023 The "Notes on OpenPGP" project License: CC-BY-SA-4.0 diff --git a/book/Makefile b/book/Makefile index 865650e..d4b9822 100644 --- a/book/Makefile +++ b/book/Makefile @@ -46,7 +46,7 @@ html: convert-svg @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) html-linkcheck: clean html - @$(LYCHEE) "$(BUILDDIR)/html/"*.html + @$(LYCHEE) --exclude "https://openpgp.dev*" --exclude "https://codeberg.org/openpgp/notes" "$(BUILDDIR)/html/"*.html # use watchexec to rebuild the HTML whenever a markdown file changes html-watch: diff --git a/book/source/_static/epub/img/cover.svg b/book/source/_static/epub/img/cover.svg new file mode 100644 index 0000000..5bc03b0 --- /dev/null +++ b/book/source/_static/epub/img/cover.svg @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/book/source/_static/html/img/favicon.ico b/book/source/_static/html/img/favicon.ico new file mode 100644 index 0000000..27ffc73 Binary files /dev/null and b/book/source/_static/html/img/favicon.ico differ diff --git a/book/source/_static/html/img/favicon.svg b/book/source/_static/html/img/favicon.svg new file mode 100644 index 0000000..c12de0b --- /dev/null +++ b/book/source/_static/html/img/favicon.svg @@ -0,0 +1,158 @@ + + diff --git a/book/source/_static/html/img/logo.svg b/book/source/_static/html/img/logo.svg new file mode 100644 index 0000000..b888225 --- /dev/null +++ b/book/source/_static/html/img/logo.svg @@ -0,0 +1,137 @@ + + diff --git a/book/source/conf.py b/book/source/conf.py index 9c10089..48e0bb7 100644 --- a/book/source/conf.py +++ b/book/source/conf.py @@ -6,12 +6,20 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +from datetime import date + # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'OpenPGP for application developers' -copyright = '2023, The "Notes on OpenPGP" project, CC-BY-SA-4.0' -version = "0.01" +author = 'The "Notes on OpenPGP" project' +upstream_url = "https://codeberg.org/openpgp/notes" +license_url = "https://creativecommons.org/licenses/by-sa/4.0/" +copyright = f'{date.today().year}, {author}, CC-BY-SA-4.0' +version = "0.1" +suppress_warnings = [ + 'epub.unknown_project_files', +] # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -29,6 +37,9 @@ numfig = True # number figures in flat hierarchy numfig_secnum_depth = 0 +# format today as YYYY-MM-DD instead of language specific +today_fmt = "%Y-%m-%d" + # -- Options for MyST-parser ------------------------------------------------- # https://myst-parser.readthedocs.io/en/latest/configuration.html @@ -45,9 +56,12 @@ myst_enable_extensions = [ # -- Options for EPUB output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-epub-output +epub_copyright = f'{date.today().year}, {author} ({upstream_url}), CC-BY-SA-4.0' +epub_cover = ('_static/epub/img/cover.svg', 'cover.j2') epub_css_files = [ 'epub/css/custom.css' ] +epub_title = project.replace(" ", "_") # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output @@ -58,13 +72,19 @@ html_css_files = [ ('html/css/custom.css', {'priority': 1000}) ] +html_favicon = '_static/html/img/favicon.ico' +html_logo = '_static/html/img/logo.svg' html_show_sphinx = False -html_show_copyright = False html_show_sourcelink = False +html_title = project # https://github.com/sphinx-doc/alabaster/blob/0.x/alabaster/theme.conf html_theme_options = { 'code_font_size': '9pt', + 'extra_nav_links': { + 'Sources on Codeberg': upstream_url, + 'Download EPUB': f'https://openpgp.dev/epub/{epub_title}.epub', + }, 'show_relbars': 'yes', 'show_powered_by': False, }