From: Jon Turney <jon.turney@dronecode.org.uk>
To: newlib@sourceware.org
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH] Update makedocbook for bd547490
Date: Tue, 14 Feb 2017 20:02:00 -0000 [thread overview]
Message-ID: <20170214200148.81728-1-jon.turney@dronecode.org.uk> (raw)
Teach makedocbook how to handle some new things seen in the makedoc markup
since bd547490:
- struct lines appearing in the synopsis
- use of @strong{} texinfo markup
---
newlib/doc/makedocbook.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/newlib/doc/makedocbook.py b/newlib/doc/makedocbook.py
index 0c84e3c..cf48c34 100755
--- a/newlib/doc/makedocbook.py
+++ b/newlib/doc/makedocbook.py
@@ -293,9 +293,8 @@ def synopsis(c, t):
s = ''
for l in t.splitlines():
- if re.match('\s*[#[]', l):
- # a #include, #define etc.
- # fpclassify contains some comments in [ ] brackets
+ if re.match('\s*(#|\[|struct)', l):
+ # preprocessor # directives, structs, comments in square brackets
funcsynopsisinfo = lxml.etree.SubElement(funcsynopsis, 'funcsynopsisinfo')
funcsynopsisinfo.text = l.strip() + '\n'
else:
@@ -468,6 +467,8 @@ def line_markup_convert(p):
# also convert some simple texinfo markup
# convert @emph{foo} to <emphasis>foo</emphasis>
s = re.sub('@emph{(.*?)}', '<emphasis>\\1</emphasis>', s)
+ # convert @strong{foo} to <emphasis role=strong>foo</emphasis>
+ s = re.sub('@strong{(.*?)}', '<emphasis role="strong">\\1</emphasis>', s)
# convert @minus{} to U+2212 MINUS SIGN
s = s.replace('@minus{}', '−')
# convert @dots{} to U+2026 HORIZONTAL ELLIPSIS
--
2.8.3
next reply other threads:[~2017-02-14 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 20:02 Jon Turney [this message]
2017-02-15 15:33 ` Corinna Vinschen
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=20170214200148.81728-1-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=newlib@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).