diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2016-05-26 03:40:17 -0400 |
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2016-05-30 06:38:54 -0400 |
| commit | 30ca7aaf279944da930b587b05d9b325ec7f821d (patch) | |
| tree | ddcb1575c0df64f651a265c6613cc3554697fc12 /Documentation/sphinx | |
| parent | 2e83ecb834ca923806fd58fab17d9f405767e1d9 (diff) | |
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@intel.com>
Diffstat (limited to 'Documentation/sphinx')
| -rw-r--r-- | Documentation/sphinx/convert_template.sed | 10 | ||||
| -rw-r--r-- | 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 @@ | |||
| 2 | # Pandoc doesn't grok <function> or <structname>, so convert them | 2 | # Pandoc doesn't grok <function> or <structname>, so convert them |
| 3 | # ahead of time. | 3 | # ahead of time. |
| 4 | # | 4 | # |
| 5 | # Use "$bq" instead of "`" so that pandoc won't mess with it. | 5 | # Use the following escapes to pass through pandoc: |
| 6 | # $bq = "`" | ||
| 7 | # $lt = "<" | ||
| 8 | # $gt = ">" | ||
| 6 | # | 9 | # |
| 7 | s%<function>\([^<(]\+\)()</function>%:c:func:$bq\1()$bq%g | 10 | s%<function>\([^<(]\+\)()</function>%:c:func:$bq\1()$bq%g |
| 8 | s%<function>\([^<(]\+\)</function>%:c:func:$bq\1()$bq%g | 11 | s%<function>\([^<(]\+\)</function>%:c:func:$bq\1()$bq%g |
| 9 | s%<structname>struct *\([^<]\+\)</structname>%:c:type:$bq\1$bq%g | 12 | s%<structname>struct *\([^<]\+\)</structname>%:c:type:$bqstruct \1 $lt\1$gt$bq%g |
| 10 | s%<structname>\([^<]\+\)</structname>%:c:type:$bq\1$bq%g | 13 | s%struct <structname>\([^<]\+\)</structname>%:c:type:$bqstruct \1 $lt\1$gt$bq%g |
| 14 | s%<structname>\([^<]\+\)</structname>%:c:type:$bqstruct \1 $lt\1$gt$bq%g | ||
| 11 | # | 15 | # |
| 12 | # Wrap docproc directives in para and code blocks. | 16 | # Wrap docproc directives in para and code blocks. |
| 13 | # | 17 | # |
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 @@ | |||
| 1 | # | 1 | # |
| 2 | # pandoc thinks that both "_" needs to be escaped. Remove the extra | 2 | # Unescape. |
| 3 | # backslashes. Also put in proper backquotes now that pandoc won't quote | ||
| 4 | # them. | ||
| 5 | # | 3 | # |
| 6 | s/$bq/`/g | 4 | s/$bq/`/g |
| 5 | s/$lt/</g | ||
| 6 | s/$gt/>/g | ||
| 7 | # | ||
| 8 | # pandoc thinks that both "_" needs to be escaped. Remove the extra | ||
| 9 | # backslashes. | ||
| 10 | # | ||
| 7 | s/\\_/_/g | 11 | s/\\_/_/g |
| 8 | # | 12 | # |
| 9 | # Unwrap docproc directives. | 13 | # Unwrap docproc directives. |
