diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2016-05-12 09:15:38 -0400 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2016-05-14 11:56:34 -0400 |
| commit | 6285097654725f39357527b553d03b70bfbaf4d2 (patch) | |
| tree | 33f1519fb1360fb2de6605654c6b8c8cce443377 /scripts/kernel-doc | |
| parent | c0d1b6ee780ab16f16cdbe046aa9c83a2a31f9e2 (diff) | |
kernel-doc: use rst C domain directives and references for types
First, the headings for structs, enums and typedefs will be similar to
functions. Second, this provides a kind of namespace for cross
references. Third, and most importantly, the return and parameter types
from .. c:function:: definitions will automagically become cross
references to the documented types.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0ad1fb0e3031..2fc8fad5195e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -275,9 +275,9 @@ my $blankline_text = ""; | |||
| 275 | my @highlights_rst = ( | 275 | my @highlights_rst = ( |
| 276 | [$type_constant, "``\$1``"], | 276 | [$type_constant, "``\$1``"], |
| 277 | [$type_func, "\\:c\\:func\\:`\$1`"], | 277 | [$type_func, "\\:c\\:func\\:`\$1`"], |
| 278 | [$type_struct_full, "\\:ref\\:`\$1 \$2`"], | 278 | [$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], |
| 279 | [$type_enum_full, "\\:ref\\:`\$1 \$2`"], | 279 | [$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], |
| 280 | [$type_struct, "\\:ref\\:`struct \$1`"], | 280 | [$type_struct, "\\:c\\:type\\:`struct \$1 <\$1>`"], |
| 281 | [$type_param, "**\$1**"] | 281 | [$type_param, "**\$1**"] |
| 282 | ); | 282 | ); |
| 283 | my $blankline_rst = "\n"; | 283 | my $blankline_rst = "\n"; |
| @@ -1835,10 +1835,9 @@ sub output_enum_rst(%) { | |||
| 1835 | my %args = %{$_[0]}; | 1835 | my %args = %{$_[0]}; |
| 1836 | my ($parameter); | 1836 | my ($parameter); |
| 1837 | my $count; | 1837 | my $count; |
| 1838 | |||
| 1839 | my $name = "enum " . $args{'enum'}; | 1838 | my $name = "enum " . $args{'enum'}; |
| 1840 | print ".. _" . $name . ":\n\n"; | 1839 | |
| 1841 | print "**$name**\n\n"; | 1840 | print "\n\n.. c:type:: " . $name . "\n\n"; |
| 1842 | print " " . $args{'purpose'} . "\n\n"; | 1841 | print " " . $args{'purpose'} . "\n\n"; |
| 1843 | 1842 | ||
| 1844 | print "..\n\n:Constants:\n\n"; | 1843 | print "..\n\n:Constants:\n\n"; |
| @@ -1863,8 +1862,9 @@ sub output_typedef_rst(%) { | |||
| 1863 | my $count; | 1862 | my $count; |
| 1864 | my $name = "typedef " . $args{'typedef'}; | 1863 | my $name = "typedef " . $args{'typedef'}; |
| 1865 | 1864 | ||
| 1866 | print "**$name**\n\n"; | 1865 | ### FIXME: should the name below contain "typedef" or not? |
| 1867 | print $args{'purpose'} . "\n\n"; | 1866 | print "\n\n.. c:type:: " . $name . "\n\n"; |
| 1867 | print " " . $args{'purpose'} . "\n\n"; | ||
| 1868 | 1868 | ||
| 1869 | output_section_rst(@_); | 1869 | output_section_rst(@_); |
| 1870 | } | 1870 | } |
| @@ -1874,8 +1874,7 @@ sub output_struct_rst(%) { | |||
| 1874 | my ($parameter); | 1874 | my ($parameter); |
| 1875 | my $name = $args{'type'} . " " . $args{'struct'}; | 1875 | my $name = $args{'type'} . " " . $args{'struct'}; |
| 1876 | 1876 | ||
| 1877 | print ".. _" . $name . ":\n\n"; | 1877 | print "\n\n.. c:type:: " . $name . "\n\n"; |
| 1878 | print "**$name**\n\n"; | ||
| 1879 | print " " . $args{'purpose'} . "\n\n"; | 1878 | print " " . $args{'purpose'} . "\n\n"; |
| 1880 | 1879 | ||
| 1881 | print ":Definition:\n\n"; | 1880 | print ":Definition:\n\n"; |
