Processed: Re: Bug#915583: about html_static_path

2024-02-24 Thread Debian Bug Tracking System
Processing control commands:

> tag -1 + pending
Bug #915583 [debian-policy] debian-policy: More attractive sphinx theme, please
Added tag(s) pending.

-- 
915583: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=915583
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#915583: about html_static_path

2024-02-24 Thread Sean Whitton
control: tag -1 + pending

Hello,

On Sat 24 Feb 2024 at 08:52am +01, Holger Wansing wrote:

> Hi Sean,
>
> Sean Whitton  wrote (Sat, 24 Feb 2024 11:58:59 
> +0800):
>> Attached is the patch I prepared, which I couldn't get to work.  Maybe
>> you can see what is wrong.  Thanks!
>
> As I know it, the debian.css file has to reside in policy/_static.
> And activate (un-comment) the path declaration for that in line 105 of 
> conf.py.in.
>
> Additionally, as I already wrote somewhere, for navigating it would be good
> to have the Next/Previous buttons at the top of the page as well, not only
> at the bottom.
>
> And: do we want to have the
>   "Built with Sphinx using a theme provided by Read the Docs."
> in the footer? If not, that could be suppressed by
>   html_show_sphinx = False
> in conf.py.in.
>
>
> My diff for conf.py.in would be like this (with above suggestions):

Thank you very much, both -- now merged for the next upload.

-- 
Sean Whitton


signature.asc
Description: PGP signature


Bug#915583: about html_static_path

2024-02-23 Thread Holger Wansing
Hi Sean,

Sean Whitton  wrote (Sat, 24 Feb 2024 11:58:59 +0800):
> Attached is the patch I prepared, which I couldn't get to work.  Maybe
> you can see what is wrong.  Thanks!

As I know it, the debian.css file has to reside in policy/_static.
And activate (un-comment) the path declaration for that in line 105 of 
conf.py.in.

Additionally, as I already wrote somewhere, for navigating it would be good
to have the Next/Previous buttons at the top of the page as well, not only
at the bottom.

And: do we want to have the 
"Built with Sphinx using a theme provided by Read the Docs."
in the footer? If not, that could be suppressed by
html_show_sphinx = False
in conf.py.in.


My diff for conf.py.in would be like this (with above suggestions):

diff --git a/policy/conf.py.in b/policy/conf.py.in
index d516d7b..4ea4df6 100755
--- a/policy/conf.py.in
+++ b/policy/conf.py.in
@@ -84,13 +84,19 @@ todo_include_todos = False
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'nature'
+html_theme = 'sphinx_rtd_theme'
 
 # 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 = {
+   # To get previous/next buttons at the top and the bottom:
+   'prev_next_buttons_location': 'both'
+}
+
+# Overwrite theme to fit Debian colors
+html_css_files = ['debian.css']
 
 # Override the title to remove the unnecessary "documentation" suffix.
 html_title = "Debian Policy Manual v@VERSION@"
@@ -98,11 +104,14 @@ html_title = "Debian Policy Manual v@VERSION@"
 # Suppress the copyright notice.
 html_show_copyright = False
 
+# Hide “Created using Sphinx” in the HTML footer
+html_show_sphinx = False
+
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
 #
-# html_static_path = ['_static']
+html_static_path = ['_static']
 
 
 # -- Options for HTMLHelp output --



Best regards
Holger



-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#915583: about html_static_path

2024-02-23 Thread Sean Whitton
Hello,

On Thu 15 Feb 2024 at 11:44pm +01, Holger Wansing wrote:

> Sean Whitton  wrote:
>> On Fri 29 Dec 2023 at 07:08am +01, Stéphane Blondon wrote:
>>
>> > Yes, html_static_path must be set but it's already the case in conf.py.in:
>> > https://sources.debian.org/src/debian-policy/4.6.2.0/policy/conf.py.in/#L105
>> >
>> > I guess conf.py is generated from conf.py.in so we only need to keep
>> > the current setup.
>>
>> That line is commented out, though.  Are you saying it takes on its
>> default value in that case?
>
> I think it would be good to un-comment such lines which are needed, so it's
> clear without doubt, what is used and active.
> Works fine here BTW.

Attached is the patch I prepared, which I couldn't get to work.  Maybe
you can see what is wrong.  Thanks!

-- >8 --
From: =?UTF-8?q?St=C3=A9phane=20Blondon?= 
Date: Mon, 27 Nov 2023 23:36:06 +0100
Subject: [PATCH] New Debian-specific Sphinx style

---
 debian/changelog  |   3 ++
 debian/control|   1 +
 policy/conf.py.in |   5 ++-
 policy/debian.css | 103 ++
 4 files changed, 111 insertions(+), 1 deletion(-)
 create mode 100644 policy/debian.css

diff --git a/debian/changelog b/debian/changelog
index ffa0f8b..6d04491 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,9 @@ debian-policy (4.6.2.1) UNRELEASED; urgency=medium
   package metadata.
   * Update Installed-Size algorithm used by dpkg (Closes: #793499).
 
+  [ Stéphane Blondon ]
+  * New Debian-specific Sphinx style (Closes: #915583).
+
  -- Russ Allbery   Sat, 09 Sep 2023 15:27:27 -0700
 
 debian-policy (4.6.2.0) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index a98b425..ebb3c3f 100644
--- a/debian/control
+++ b/debian/control
@@ -17,6 +17,7 @@ Build-Depends:
  libxml2-utils,
  links | elinks,
  python3-sphinx,
+ python3-sphinx-rtd-theme,
  sphinx-common (>= 1.6.5),
  sphinx-intl,
  texinfo,
diff --git a/policy/conf.py.in b/policy/conf.py.in
index d516d7b..86bc1ac 100755
--- a/policy/conf.py.in
+++ b/policy/conf.py.in
@@ -84,7 +84,7 @@ todo_include_todos = False
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'nature'
+html_theme = 'sphinx_rtd_theme'
 
 # 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
@@ -92,6 +92,9 @@ html_theme = 'nature'
 #
 # html_theme_options = {}
 
+# Overwrite theme to fit Debian colors
+html_css_files = ['debian.css']
+
 # Override the title to remove the unnecessary "documentation" suffix.
 html_title = "Debian Policy Manual v@VERSION@"
 
diff --git a/policy/debian.css b/policy/debian.css
new file mode 100644
index 000..7f0981b
--- /dev/null
+++ b/policy/debian.css
@@ -0,0 +1,103 @@
+/* Debian Cascading stylesheet for Sphinx */
+
+div.related {
+background-color: #C70036;
+}
+
+.rst-content h1, .rst-content h2, .rst-content h3, .rst-content h4, 
.rst-content h5, .rst-content h6 {
+color: #C70036;
+}
+
+.wy-nav-top {
+background-color: #C70036;
+}
+
+.wy-side-nav-search {
+background-color: #C70036;
+}
+
+.rst-content a:link {
+color: #0035C7;
+text-decoration: none;
+}
+.rst-content a:visited {
+color: #00207A;
+text-decoration: none;
+}
+.rst-content a:link:hover {
+color: #00207A;
+text-decoration: underline;
+}
+
+
+/* Table in content */
+
+.wy-table-responsive table td, .wy-table-responsive table th {
+white-space: normal;
+}
+
+.rst-content table.docutils, .wy-table-bordered-all {
+width: 100%;
+}
+
+.wy-table-responsive table.docutils thead tr {
+background-color: #C70036;
+border: 1px solid black;
+color: black;
+}
+
+.wy-table-responsive table.docutils thead tr:hover {
+color: #fcfcfc;
+}
+
+.wy-table-responsive table.docutils tbody tr:hover {
+background-color:#66;
+color: #FF;
+}
+
+.rst-content table.docutils:not(.field-list) tbody tr:hover:nth-child(2n-1), 
.wy-table-backed, .wy-table-odd td, .wy-table-striped tr:nth-child(2n-1) td {
+background-color:#66;
+}
+
+/* Previous and next buttons */
+
+.rst-footer-buttons .btn:hover {
+text-decoration: none !important;
+}
+
+/* Version release more readable */
+
+.wy-side-nav-search > div.version {
+color: #FCFCFC;
+}
+
+/* Infos blocks */
+
+div.warning {
+border: 1px dashed #EFF500;
+background-color: #eff50030;
+}
+
+div.note {
+border: 1px dashed blue;
+background-color: #ff30;
+
+}
+
+.warning, .note {
+margin-left: 1em;
+margin-right: 1em;
+}
+
+@media (max-width: 5in), (max-device-width: 5in){
+.warning, .note {
+margin-left: 0.5em;
+margin-right: 0.5em;
+}
+}
+
+/* Notes */
+
+html.writer-html5 .rst-content aside.citation, html.writer-html5 .rst-content 
aside.footnote, html.writer-html5 .rst-content div.citation {
+display: block;
+}
-- 
Sean Whitton


signature.asc
Description: 

Bug#915583: about html_static_path

2024-02-15 Thread Holger Wansing


Sean Whitton  wrote:
> On Fri 29 Dec 2023 at 07:08am +01, Stéphane Blondon wrote:
> 
> > Yes, html_static_path must be set but it's already the case in conf.py.in:
> > https://sources.debian.org/src/debian-policy/4.6.2.0/policy/conf.py.in/#L105
> >
> > I guess conf.py is generated from conf.py.in so we only need to keep
> > the current setup.
> 
> That line is commented out, though.  Are you saying it takes on its
> default value in that case?

I think it would be good to un-comment such lines which are needed, so it's 
clear without doubt, what is used and active.
Works fine here BTW.


Holger

-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#915583: about html_static_path

2024-01-07 Thread Sean Whitton
Hello,

On Fri 29 Dec 2023 at 07:08am +01, Stéphane Blondon wrote:

> Yes, html_static_path must be set but it's already the case in conf.py.in:
> https://sources.debian.org/src/debian-policy/4.6.2.0/policy/conf.py.in/#L105
>
> I guess conf.py is generated from conf.py.in so we only need to keep
> the current setup.

That line is commented out, though.  Are you saying it takes on its
default value in that case?

-- 
Sean Whitton


signature.asc
Description: PGP signature


Bug#915583: about html_static_path

2023-12-28 Thread Stéphane Blondon
Yes, html_static_path must be set but it's already the case in conf.py.in:
https://sources.debian.org/src/debian-policy/4.6.2.0/policy/conf.py.in/#L105

I guess conf.py is generated from conf.py.in so we only need to keep
the current setup.

-- 
Stéphane