mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
89a66d7610
This script uses pandoc to convert existing DocBook template files to RST templates. A couple of sed scripts are need to massage things both before and after the conversion, but the result is then usable with no hand editing. [Jani: Change usage to tmplcvt <in> <out>. Fix escaping for docproc directives. Add support the new kernel-doc extension.] Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
15 lines
497 B
Sed
15 lines
497 B
Sed
#
|
|
# 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.
|
|
#
|
|
s%<function>\([^<(]\+\)()</function>%:c:func:$bq\1$bq%g
|
|
s%<function>\([^<(]\+\)</function>%:c:func:$bq\1$bq%g
|
|
s%<structname>struct *\([^<]\+\)</structname>%:ref:$bqstruct \1$bq%g
|
|
s%<structname>\([^<]\+\)</structname>%:ref:$bqstruct \1$bq%g
|
|
#
|
|
# Wrap docproc directives in para and code blocks.
|
|
#
|
|
s%^\(!.*\)$%<para><code>DOCPROC: \1</code></para>%
|