From 05c16a6e59d288e8fc4a4661fa9df7a299f32391 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 11 Sep 2020 11:05:41 +0200 Subject: [PATCH] docs: use alabaster theme It's not all perfect (yet) but way cleaner and simpler to use than the sphinx one. Custom do the scrolling for the fixed side bar and make some other slight adjustments. Main issue for now is that the "Developer Appendix" is always shown in the navigation tree, but we only include that toctree for devbuilds... Signed-off-by: Thomas Lamprecht --- docs/Makefile | 2 ++ docs/conf.py | 27 +++++++++++++++++++++++---- docs/custom.css | 11 +++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 docs/custom.css diff --git a/docs/Makefile b/docs/Makefile index 8d1e8a1b..4e2f9606 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -76,6 +76,8 @@ onlinehelpinfo: .PHONY: html html: ${GENERATED_SYNOPSIS} $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + cp images/proxmox-logo.svg $(BUILDDIR)/html/_static/ + cp custom.css $(BUILDDIR)/html/_static/ @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/docs/conf.py b/docs/conf.py index a9d45c2e..b1cadd08 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -156,13 +156,32 @@ todo_include_todos = True # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinxdoc' +html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + 'fixed_sidebar': True, + #'sidebar_includehidden': False, + 'sidebar_collapse': False, # FIXME: documented, but does not works?! + 'show_relbar_bottom': True, # FIXME: documented, but does not works?! + 'show_powered_by': False, + + 'logo': 'proxmox-logo.svg', + 'logo_name': True, # show project name below logo + #'logo_text_align': 'center', + #'description': 'Fast, Secure & Efficient.', + + 'sidebar_width': '300px', + 'page_width': '1280px', + # font styles + 'head_font_family': 'Lato, sans-serif', + 'caption_font_family': 'Lato, sans-serif', + 'caption_font_size': '20px', + 'font_family': 'Open Sans, sans-serif', +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] @@ -179,7 +198,7 @@ html_theme = 'sphinxdoc' # The name of an image file (relative to this directory) to place at the top # of the sidebar. # -html_logo = 'images/proxmox-logo.svg' +#html_logo = 'images/proxmox-logo.svg' # replaced by html_theme_options.logo # The name of an image file (relative to this directory) to use as a favicon of # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -232,7 +251,7 @@ html_static_path = ['_static'] # If true, links to the reST sources are added to the pages. # -# html_show_sourcelink = True +html_show_sourcelink = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # diff --git a/docs/custom.css b/docs/custom.css new file mode 100644 index 00000000..b9a575ec --- /dev/null +++ b/docs/custom.css @@ -0,0 +1,11 @@ +div.sphinxsidebar { + height: calc(100% - 20px); + overflow: auto; +} + +h1.logo-name { + font-size: 24px; +} +pre { + padding: 5px 10px; +}