blob: 392770bac53b79ac0814c02fde26d61fc2935fcb [file] [log] [blame]
Jonathan Corbet89a66d72016-03-06 20:29:31 -07001#
Jani Nikula30ca7aa2016-05-26 10:40:17 +03002# Unescape.
Jonathan Corbet89a66d72016-03-06 20:29:31 -07003#
4s/$bq/`/g
Jani Nikula30ca7aa2016-05-26 10:40:17 +03005s/$lt/</g
6s/$gt/>/g
7#
8# pandoc thinks that both "_" needs to be escaped. Remove the extra
9# backslashes.
10#
Jonathan Corbet89a66d72016-03-06 20:29:31 -070011s/\\_/_/g
12#
13# Unwrap docproc directives.
14#
15s/^``DOCPROC: !E\(.*\)``$/.. kernel-doc:: \1\n :export:/
16s/^``DOCPROC: !I\(.*\)``$/.. kernel-doc:: \1\n :internal:/
17s/^``DOCPROC: !F\([^ ]*\) \(.*\)``$/.. kernel-doc:: \1\n :functions: \2/
18s/^``DOCPROC: !P\([^ ]*\) \(.*\)``$/.. kernel-doc:: \1\n :doc: \2/
19s/^``DOCPROC: \(!.*\)``$/.. WARNING: DOCPROC directive not supported: \1/
20#
21# Trim trailing whitespace.
22#
23s/[[:space:]]*$//