From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932626AbcELNRr (ORCPT ); Thu, 12 May 2016 09:17:47 -0400 Received: from mga01.intel.com ([192.55.52.88]:39193 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932092AbcELNQD (ORCPT ); Thu, 12 May 2016 09:16:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,610,1455004800"; d="scan'208";a="978364083" From: Jani Nikula To: Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: jani.nikula@intel.com Subject: [PATCH 3/9] kernel-doc: use rst C domain directives and references for types Date: Thu, 12 May 2016 16:15:38 +0300 Message-Id: <35f8fa5e55e14dec18e9e035cd2bf43ba65a0f8c.1463058396.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Jonathan Corbet --- scripts/kernel-doc | 19 +++++++++---------- 1 file 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 = ""; my @highlights_rst = ( [$type_constant, "``\$1``"], [$type_func, "\\:c\\:func\\:`\$1`"], - [$type_struct_full, "\\:ref\\:`\$1 \$2`"], - [$type_enum_full, "\\:ref\\:`\$1 \$2`"], - [$type_struct, "\\:ref\\:`struct \$1`"], + [$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], + [$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], + [$type_struct, "\\:c\\:type\\:`struct \$1 <\$1>`"], [$type_param, "**\$1**"] ); my $blankline_rst = "\n"; @@ -1835,10 +1835,9 @@ sub output_enum_rst(%) { my %args = %{$_[0]}; my ($parameter); my $count; - my $name = "enum " . $args{'enum'}; - print ".. _" . $name . ":\n\n"; - print "**$name**\n\n"; + + print "\n\n.. c:type:: " . $name . "\n\n"; print " " . $args{'purpose'} . "\n\n"; print "..\n\n:Constants:\n\n"; @@ -1863,8 +1862,9 @@ sub output_typedef_rst(%) { my $count; my $name = "typedef " . $args{'typedef'}; - print "**$name**\n\n"; - print $args{'purpose'} . "\n\n"; + ### FIXME: should the name below contain "typedef" or not? + print "\n\n.. c:type:: " . $name . "\n\n"; + print " " . $args{'purpose'} . "\n\n"; output_section_rst(@_); } @@ -1874,8 +1874,7 @@ sub output_struct_rst(%) { my ($parameter); my $name = $args{'type'} . " " . $args{'struct'}; - print ".. _" . $name . ":\n\n"; - print "**$name**\n\n"; + print "\n\n.. c:type:: " . $name . "\n\n"; print " " . $args{'purpose'} . "\n\n"; print ":Definition:\n\n"; -- 2.1.4