[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <30ca7aaf279944da930b587b05d9b325ec7f821d.1465031816.git.jani.nikula@intel.com>
Date: Sat, 4 Jun 2016 14:37:11 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: Jonathan Corbet <corbet@....net>
Cc: Jani Nikula <jani.nikula@...el.com>,
Markus Heiser <markus.heiser@...marit.de>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Grant Likely <grant.likely@...retlab.ca>,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
Keith Packard <keithp@...thp.com>,
LKML <linux-kernel@...r.kernel.org>, linux-doc@...r.kernel.org,
Hans Verkuil <hverkuil@...all.nl>
Subject: [PATCH v2 10/38] Documentation/sphinx: nicer referencing of struct in docbook->rst conversion
Add "struct" in the label of the reference.
Signed-off-by: Jani Nikula <jani.nikula@...el.com>
---
Documentation/sphinx/convert_template.sed | 10 +++++++---
Documentation/sphinx/post_convert.sed | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/Documentation/sphinx/convert_template.sed b/Documentation/sphinx/convert_template.sed
index 0553eabeac79..c1503fcca4ec 100644
--- a/Documentation/sphinx/convert_template.sed
+++ b/Documentation/sphinx/convert_template.sed
@@ -2,12 +2,16 @@
# Pandoc doesn't grok <function> or <structname>, so convert them
# ahead of time.
#
-# Use "$bq" instead of "`" so that pandoc won't mess with it.
+# Use the following escapes to pass through pandoc:
+# $bq = "`"
+# $lt = "<"
+# $gt = ">"
#
s%<function>\([^<(]\+\)()</function>%:c:func:$bq\1()$bq%g
s%<function>\([^<(]\+\)</function>%:c:func:$bq\1()$bq%g
-s%<structname>struct *\([^<]\+\)</structname>%:c:type:$bq\1$bq%g
-s%<structname>\([^<]\+\)</structname>%:c:type:$bq\1$bq%g
+s%<structname>struct *\([^<]\+\)</structname>%:c:type:$bqstruct \1 $lt\1$gt$bq%g
+s%struct <structname>\([^<]\+\)</structname>%:c:type:$bqstruct \1 $lt\1$gt$bq%g
+s%<structname>\([^<]\+\)</structname>%:c:type:$bqstruct \1 $lt\1$gt$bq%g
#
# Wrap docproc directives in para and code blocks.
#
diff --git a/Documentation/sphinx/post_convert.sed b/Documentation/sphinx/post_convert.sed
index ce17049f6a8e..392770bac53b 100644
--- a/Documentation/sphinx/post_convert.sed
+++ b/Documentation/sphinx/post_convert.sed
@@ -1,9 +1,13 @@
#
-# pandoc thinks that both "_" needs to be escaped. Remove the extra
-# backslashes. Also put in proper backquotes now that pandoc won't quote
-# them.
+# Unescape.
#
s/$bq/`/g
+s/$lt/</g
+s/$gt/>/g
+#
+# pandoc thinks that both "_" needs to be escaped. Remove the extra
+# backslashes.
+#
s/\\_/_/g
#
# Unwrap docproc directives.
--
2.1.4
Powered by blists - more mailing lists