Jonathan Corbet | 89a66d7 | 2016-03-06 20:29:31 -0700 | [diff] [blame] | 1 | # |
Jani Nikula | 30ca7aa | 2016-05-26 10:40:17 +0300 | [diff] [blame] | 2 | # Unescape. |
Jonathan Corbet | 89a66d7 | 2016-03-06 20:29:31 -0700 | [diff] [blame] | 3 | # |
| 4 | s/$bq/`/g |
Jani Nikula | 30ca7aa | 2016-05-26 10:40:17 +0300 | [diff] [blame] | 5 | s/$lt/</g |
| 6 | s/$gt/>/g |
| 7 | # |
| 8 | # pandoc thinks that both "_" needs to be escaped. Remove the extra |
| 9 | # backslashes. |
| 10 | # |
Jonathan Corbet | 89a66d7 | 2016-03-06 20:29:31 -0700 | [diff] [blame] | 11 | s/\\_/_/g |
| 12 | # |
| 13 | # Unwrap docproc directives. |
| 14 | # |
| 15 | s/^``DOCPROC: !E\(.*\)``$/.. kernel-doc:: \1\n :export:/ |
| 16 | s/^``DOCPROC: !I\(.*\)``$/.. kernel-doc:: \1\n :internal:/ |
| 17 | s/^``DOCPROC: !F\([^ ]*\) \(.*\)``$/.. kernel-doc:: \1\n :functions: \2/ |
| 18 | s/^``DOCPROC: !P\([^ ]*\) \(.*\)``$/.. kernel-doc:: \1\n :doc: \2/ |
| 19 | s/^``DOCPROC: \(!.*\)``$/.. WARNING: DOCPROC directive not supported: \1/ |
| 20 | # |
| 21 | # Trim trailing whitespace. |
| 22 | # |
| 23 | s/[[:space:]]*$// |