mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Enrico Jorns <ejo@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Enrico Joerns <ejo@pengutronix.de>
Subject: [ptxdist] [PATCH 2/2] doc: 'notice' environment was replaced by 'sphinxadmonition'
Date: Sun, 10 Mar 2019 15:17:20 +0100	[thread overview]
Message-ID: <20190310141720.30516-2-ejo@pengutronix.de> (raw)
In-Reply-To: <20190310141720.30516-1-ejo@pengutronix.de>

From: Enrico Joerns <ejo@pengutronix.de>

Spinx deprecated 'notice' environment in 1.6b1 and finally removed in
1.7.0b1.

Anyway, environment renewal to show warning symbol for note rst
directive was not working in between.

This patch both fixes warning symbol in sphinx versions between 1.6b1
and 1.7.0b1 and tex generation error after version 1.7.0b1:

| ! LaTeX Error: Environment notice undefined.

Instead of renewing a possible non-existing environment, we create a
new one and override sphinxadmonition environment only if it existed
before, or notice environment if not.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
---
 doc/preamble.inc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/preamble.inc b/doc/preamble.inc
index 58665c52f..d9e528ef4 100644
--- a/doc/preamble.inc
+++ b/doc/preamble.inc
@@ -46,7 +46,7 @@
   \renewcommand{\footrulewidth}{0.4pt}
 }
 
-\renewenvironment{notice}[2]{
+\newenvironment{ptxdistwarning}[2]{
   \def\py@noticetype{#1}
   \csname py@noticestart@#1\endcsname
   \begin{minipage}[c]{\textwidth}
@@ -70,6 +70,15 @@
   \end{minipage}
 \csname py@noticeend@\py@noticetype\endcsname }
 
+% compatibility to old sphinx versions
+\ifdefined\sphinxadmonition
+\let\sphinxadmonition\ptxdistwarning
+\let\endsphinxadmonition\endptxdistwarning
+\else
+\let\notice\ptxdistwarning
+\let\endnotice\endptxdistwarning
+\fi
+
 \definecolor{VerbatimColor}{gray}{0.95}
 \definecolor{VerbatimBorderColor}{gray}{0.75}
 
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2019-03-10 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-10 14:17 [ptxdist] [PATCH 1/2] doc: it's an open project, thus use open fonts Enrico Jorns
2019-03-10 14:17 ` Enrico Jorns [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190310141720.30516-2-ejo@pengutronix.de \
    --to=ejo@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox