Blame view

Documentation/sphinx/convert_template.sed 631 Bytes
89a66d761   Jonathan Corbet   sphinx: cheesy sc...
1
2
3
4
  #
  # Pandoc doesn't grok <function> or <structname>, so convert them
  # ahead of time.
  #
30ca7aaf2   Jani Nikula   Documentation/sph...
5
6
7
8
  # Use the following escapes to pass through pandoc:
  #	$bq = "`"
  #	$lt = "<"
  #	$gt = ">"
89a66d761   Jonathan Corbet   sphinx: cheesy sc...
9
  #
2e83ecb83   Jani Nikula   sphinx: update do...
10
11
  s%<function>\([^<(]\+\)()</function>%:c:func:$bq\1()$bq%g
  s%<function>\([^<(]\+\)</function>%:c:func:$bq\1()$bq%g
30ca7aaf2   Jani Nikula   Documentation/sph...
12
13
14
  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
89a66d761   Jonathan Corbet   sphinx: cheesy sc...
15
16
17
18
  #
  # Wrap docproc directives in para and code blocks.
  #
  s%^\(!.*\)$%<para><code>DOCPROC: \1</code></para>%