From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Markus Heiser <markus.heiser@darmarit.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
Jani Nikula <jani.nikula@intel.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
Date: Tue, 18 Oct 2016 08:06:28 -0200 [thread overview]
Message-ID: <20161018080628.439a0f40@vento.lan> (raw)
In-Reply-To: <BF4516DA-435D-4469-B968-D8F5858DC9CF@darmarit.de>
Sorry, I missed part of your comments on my last reply...
Em Tue, 18 Oct 2016 09:03:28 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:
> +- ``T:`` SCM tree type and location.
> +
> > + - Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
> > +
>
> Hmm, why is the last line a bullet list, shouldn't it be:
>
> +- ``T:`` SCM tree type and location
> + Type is one of: git, hg, quilt, stgit, topgit
IMHO, it is better to output it as:
- T: SCM tree type and location.
* Type is one of: git, hg, quilt, stgit, topgit
Putting the explanation on a separate line, then merging the description
of the tag with the details about the valid values.
>
>
> > +- ``S:`` Status, one of the following:
> > +
> > + - Supported:
> > + Someone is actually paid to look after this.
>
> Sorry, but I will never understand why you using mixed tabs and space
> for the same thing ;-) ... what I mean; why is the top-list indented by
> a tab after the bullet and the sub-list by two spaces ...
>
> We had the tab discussion already ... and IMO calling the CodeStyle is not
> helpful when using ASCII markup ... lets take the ASCI documentation compact
> and forget the tab ;-)
Well, my text editor is set to replace 8 spaces by tabs, as this is the
Kernel CodingStyle. I suspect other Kernel hackers do the same.
Using a different style just for documentation is really odd and will
cause problems, and make the maintainers life like hell if they would
need to manually check if a documentation hunk is not using tabs.
>
> > + - Maintained:
> > + Someone actually looks after it.
> > + - Odd Fixes:
> > + It has a maintainer but they don't have time to do
> > much other than throw the odd patch in. See below..
> > - Orphan: No current maintainer [but maybe you could take the
> > + - Orphan:
> > + No current maintainer [but maybe you could take the
> > role as you write your new code].
> > - Obsolete: Old code. Something tagged obsolete generally means
> > + - Obsolete:
> > + Old code. Something tagged obsolete generally means
> > it has been replaced by a better system and you
> > should be using that.
>
> Hmm, here its the same with the indent. List, list-items, paragraphs etc. are all
> "body elements".
>
> * http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#body-elements
>
> A body element is always introduced by a leading empty line. E.g:
>
> - ``S:`` Status, one of the following:
>
> - Supported:
>
> Someone is actually paid to look after this.
>
> - Maintained:
>
> Someone actually looks after it.
>
> or even more compact (which I do prefer), without paragraphs in the list items:
>
> - ``S:`` Status, one of the following:
>
> - Supported: Someone is actually paid to look after this.
>
> - Maintained: Someone actually looks after it.
Hmm... we actually use a lot of markups on the media books like:
- foo
- bar
when we want to put the first line in **bold**, as this seems to be the
only way to make the first line bold if it contains a verbatim.
There's an additional advantage of the above... it requires less typing
than:
- **foo**
- bar
:-)
>
> > - F: Files and directories with wildcard patterns.
> > +- ``F:`` Files and directories with wildcard patterns.
> > +
> > A trailing slash includes all files and subdirectory files.
> > - F: drivers/net/ all files in and below drivers/net
> > - F: drivers/net/* all files in drivers/net, but not below
> > - F: */net/* all files in "any top level directory"/net
> > - One pattern per line. Multiple F: lines acceptable.
> > - N: Files and directories with regex patterns.
> > - N: [^a-z]tegra all files whose path contains the word tegra
> > - One pattern per line. Multiple N: lines acceptable.
> > - scripts/get_maintainer.pl has different behavior for files that
> > - match F: pattern and matches of N: patterns. By default,
> > - get_maintainer will not look at git log history when an F: pattern
> > - match occurs. When an N: match occurs, git log history is used
> > - to also notify the people that have git commit signatures.
> > - X: Files and directories that are NOT maintained, same rules as F:
> > - Files exclusions are tested before file matches.
> > - Can be useful for excluding a specific subdirectory, for instance:
> > - F: net/
> > - X: net/ipv6/
> > - matches all files in and below net excluding net/ipv6/
> > - K: Keyword perl extended regex pattern to match content in a
> > +
> > + ============================== ======================================
> > + ``F:`` ``drivers/net/`` all files in and below
> > + ``drivers/net``
> > + ``F:`` ``drivers/net/*`` all files in ``drivers/net``,
> > + but not below
> > + ``F:`` ``*/net/*`` all files in "any top level
> > + directory" ``/net``
> > + ============================== ======================================
> > +
> > + One pattern per line. Multiple ``F:`` lines acceptable.
> > +- ``N:`` Files and directories with regex patterns.
>
> Between the last two lines, a empty line is required ... I fond this more times
> (will not comment each).
Surely we can improve the markups here. Yet, the point is that the html
produced via kernel-cmd is completely different than he one produced by
calling the perl script directly. When kernel-cmd is used, lots of tags are
not parsed.
That's said, if I add a logic at the script to expand the tabs before
output (patch enclosed), everything looks OK.
>
> OK, I will stop here, if you are interested in I can prepare a patch for
> illustration ....
>
Thanks,
Mauro
diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
index fb3af2a30c36..c3174c2b180a 100755
--- a/Documentation/sphinx/format_maintainers.pl
+++ b/Documentation/sphinx/format_maintainers.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl
+use Text::Tabs;
my $is_rst = 1;
@@ -15,18 +16,20 @@ my %tags = (
);
while (<>) {
+ my $s = expand($_);
+
if ($is_rst) {
- if (m/^\s+\-+$/) {
+ if ($s =~ m/^\s+\-+$/) {
$is_rst = 0;
next;
}
- print $_;
+ print $s;
next;
}
- next if (m/^$/);
+ next if ($s =~ m/^\s*$/);
- if (m/^([A-Z])\:(.*)/) {
+ if ($s =~ m/^([A-Z])\:(.*)/) {
my $tag = $1;
my $value = $2;
@@ -38,7 +41,7 @@ while (<>) {
next;
}
- print "\n$_";
+ print "\n$s";
}
print "\n";
next prev parent reply other threads:[~2016-10-18 10:06 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
2016-10-06 7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
2016-10-17 16:46 ` Mauro Carvalho Chehab
2016-10-18 6:07 ` Jani Nikula
2016-10-18 6:52 ` Markus Heiser
2016-10-18 9:13 ` Mauro Carvalho Chehab
2016-10-18 7:03 ` Markus Heiser
2016-10-18 8:59 ` Mauro Carvalho Chehab
2016-10-18 10:06 ` Mauro Carvalho Chehab [this message]
2016-10-18 11:36 ` Markus Heiser
2016-10-06 7:20 ` [PATCH 2/4] doc-rst: customize RTD theme; literal-block Markus Heiser
2016-10-06 7:20 ` [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive Markus Heiser
2016-10-06 11:46 ` Mauro Carvalho Chehab
2016-10-06 7:20 ` [PATCH 4/4] doc-rst: remove the kernel-include directive Markus Heiser
2016-10-06 8:42 ` [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Jani Nikula
2016-10-06 13:31 ` Mauro Carvalho Chehab
2016-10-06 14:21 ` Jani Nikula
2016-10-06 16:50 ` Mauro Carvalho Chehab
2016-10-07 5:56 ` Jani Nikula
2016-10-11 7:26 ` Markus Heiser
2016-10-11 14:28 ` Mauro Carvalho Chehab
2016-10-11 15:34 ` Jani Nikula
2016-10-11 16:06 ` Markus Heiser
2016-10-11 16:45 ` Mauro Carvalho Chehab
2016-10-12 6:57 ` Markus Heiser
2016-10-12 8:20 ` Jani Nikula
2016-10-21 22:05 ` Jonathan Corbet
2016-10-22 10:56 ` Mauro Carvalho Chehab
2016-10-22 15:04 ` Jonathan Corbet
2016-10-22 16:46 ` Markus Heiser
2016-10-22 19:10 ` Mauro Carvalho Chehab
2016-10-23 11:20 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161018080628.439a0f40@vento.lan \
--to=mchehab@infradead.org \
--cc=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=markus.heiser@darmarit.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.