Skip to contentSkip to conversation

doc: change sphinx theme to the read the docs theme

PATCH Superseded John McNamara 3 participants 9 messages Oct 20, 2015 – Dec 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: change sphinx theme to the read the docs theme

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

http://dpdk.readthedocs.org/en/latest/

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Also turn off option for distracting Html mouseover permalinks.

---
 doc/guides/conf.py | 2 ++
 1 file changed, 2 insertions(+)
doc/guides/conf.py +2 -0
index b2290b4..8cfb7d3 100644
@@ -37,6 +37,8 @@ from pygments.formatters.latex import LatexFormatter
 
 project = 'DPDK'
 
+html_theme = "sphinx_rtd_theme"
+html_add_permalinks = ""
 html_show_copyright = False
 highlight_language = 'none'
 
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH v2 1/1 doc: change sphinx theme to the read the docs theme

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

http://dpdk.readthedocs.org/en/latest/

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Also turn off option for distracting Html mouseover permalinks.

---

v2:
* Add version check since rtd theme is only available, by default, in Sphinx 1.3.1 and later.

 doc/guides/conf.py | 4 ++++
 1 file changed, 4 insertions(+)
doc/guides/conf.py +4 -0
index b2290b4..a87bb06 100644
@@ -37,6 +37,10 @@ from pygments.formatters.latex import LatexFormatter
 
 project = 'DPDK'
 
+if LooseVersion(sphinx_version) >= LooseVersion('1.3.1'):
+    html_theme = "sphinx_rtd_theme"
+
+html_add_permalinks = ""
 html_show_copyright = False
 highlight_language = 'none'
 
Signature · 1 line
1.8.1.4
Acked-by on v2 1/1
#2 lore raw
Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of John McNamara
Sent: Wednesday, October 21, 2015 10:39 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2] doc: change sphinx theme to the read the docs theme

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

Quoted 8 lines

http://dpdk.readthedocs.org/en/latest/

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Also turn off option for distracting Html mouseover permalinks.

#3 lore raw
In reply to John McNamara

2015-10-21 10:39, John McNamara:

Quoted 7 lines

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

http://dpdk.readthedocs.org/en/latest/

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Yes it is a clean theme.
It would be nice to add the DPDK logo somewhere.

Quoted 1 line

Also turn off option for distracting Html mouseover permalinks.

[...]

Quoted 1 line

+html_add_permalinks = ""

I think the permalinks are very useful to point a specific doc chapter to someone else.

#4 lore raw
Quoted 12 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, October 26, 2015 2:34 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] doc: change sphinx theme to the read the docs theme

2015-10-21 10:39, John McNamara:

Quoted 3 lines

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

Quoted 7 lines
Quoted 4 lines

http://dpdk.readthedocs.org/en/latest/

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Yes it is a clean theme.
It would be nice to add the DPDK logo somewhere.

Hi,

I'll submit a V3 with a logo for the html and pdf docs.

Note, the SVG logos are quite big (2 are required) and converting them to pdf for the Latex pdf docs requires another addition to the makefiles. This is a case where the patch would be smaller and simpler with PNG files and where the images are unlikely to require editing.

Quoted 6 lines
Quoted 1 line

Also turn off option for distracting Html mouseover permalinks.

[...]

Quoted 1 line

+html_add_permalinks = ""

I think the permalinks are very useful to point a specific doc chapter to someone else.

It is just as easy to get a link to a subsection from the index. The permalinks are distracting because they blink on and off when scrolling through the docs. Also, I doubt more than a handful of people will know what the permalinks in the Html docs are.

Anyway, I'll remove this part from the patch and submit it separately. If there is any support for it the patch can be applied, if not then you can reject it.

John.

#5 lore raw

2015-11-01 16:41, Mcnamara, John:

Quoted 3 lines

I'll submit a V3 with a logo for the html and pdf docs.

Note, the SVG logos are quite big (2 are required) and converting them to pdf for the Latex pdf docs requires another addition to the makefiles. This is a case where the patch would be smaller and simpler with PNG files and where the images are unlikely to require editing.

Yes the logo files are huge and mainly binary data.
There is no interest in importing them in git until they are real vector images. I'm in favor of importing a PNG with a reasonable resolution.

#6 lore raw
Quoted 13 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Sunday, November 1, 2015 6:37 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] doc: change sphinx theme to the read the docs theme

2015-11-01 16:41, Mcnamara, John:

Quoted 3 lines

I'll submit a V3 with a logo for the html and pdf docs.

Note, the SVG logos are quite big (2 are required) and converting them

Quoted 8 lines

to pdf for the Latex pdf docs requires another addition to the makefiles. This is a case where the patch would be smaller and simpler with PNG files and where the images are unlikely to require editing.

Yes the logo files are huge and mainly binary data.
There is no interest in importing them in git until they are real vector images.
I'm in favor of importing a PNG with a reasonable resolution.

Ok. I'll resubmit with 2 png logos.

John.

#7 lore raw

PATCH v4 1/1 doc: change sphinx theme and add logos

In reply to John McNamara

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

http://dpdk.readthedocs.org/en/latest/

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Also add logos for the html and latex docs.

---
V4
* Added png logos for html and latex.

 doc/guides/conf.py                        |   8 +++++++-
 doc/logo/DPDK_logo_horizontal_tag.png     | Bin 0 -> 122755 bytes
 doc/logo/DPDK_logo_vertical_rev_small.png | Bin 0 -> 16055 bytes
 3 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 doc/logo/DPDK_logo_horizontal_tag.png
 create mode 100644 doc/logo/DPDK_logo_vertical_rev_small.png
doc/guides/conf.py +7 -1
index b2290b4..90d0f77 100644
@@ -35,10 +35,16 @@ from sphinx import __version__ as sphinx_version
 from sphinx.highlighting import PygmentsBridge
 from pygments.formatters.latex import LatexFormatter
 
-project = 'DPDK'
+project = 'Data Plane Development Kit'
+
+if LooseVersion(sphinx_version) >= LooseVersion('1.3.1'):
+    html_theme = "sphinx_rtd_theme"
 
 html_show_copyright = False
 highlight_language = 'none'
+html_logo = '../logo/DPDK_logo_vertical_rev_small.png'
+
+latex_logo = '../logo/DPDK_logo_horizontal_tag.png'
 
 version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion']).decode('utf-8')
 release = version
doc/logo/DPDK_logo_horizontal_tag.png new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..8c2e35dc8579d2fef0f8516a6e62db8a4279846a
GIT binary patch
doc/logo/DPDK_logo_vertical_rev_small.png new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a418043177b35b2cf8f4806e2de2a34ed43a9fa2
GIT binary patch
Signature · 1 line
1.8.1.4
#8 lore raw

Re: [PATCH v4] doc: change sphinx theme and add logos

2015-11-01 23:29, John McNamara:

Quoted 5 lines

Change the Sphinx default theme from "alabaster" to the ReadTheDocs theme. See for example:

http://dpdk.readthedocs.org/en/latest/

Quoted 7 lines

This looks better for technical documentation and in particular it has a 80 char wide verbatim block rendering.

Also add logos for the html and latex docs.

Applied, thanks. It looks beautiful