<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/Documentation/sphinx/kernel-doc.py, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-09-01T14:19:02Z</updated>
<entry>
<title>docs: sphinx-extensions: add metadata parallel-safe</title>
<updated>2016-09-01T14:19:02Z</updated>
<author>
<name>Markus Heiser</name>
<email>markus.heiser@darmarIT.de</email>
</author>
<published>2016-08-24T13:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b62b9d81a06f60ae4ad5f7a9c969f5b9680e2829'/>
<id>urn:sha1:b62b9d81a06f60ae4ad5f7a9c969f5b9680e2829</id>
<content type='text'>
The setup() function of a Sphinx-extension can return a dictionary. This
is treated by Sphinx as metadata of the extension [1].

With metadata "parallel_read_safe = True" a extension is marked as
save for "parallel reading of source". This is needed if you want
build in parallel with N processes. E.g.:

  make SPHINXOPTS=-j4 htmldocs

will no longer log warnings like:

  WARNING: the foobar extension does not declare if it is safe for
  parallel reading, assuming it isn't - please ask the extension author
  to check and make it explicit.

Add metadata to extensions:

* kernel-doc
* flat-table
* kernel-include

[1] http://www.sphinx-doc.org/en/stable/extdev/#extension-metadata

Signed-off-by: Markus Heiser &lt;markus.heiser@darmarIT.de&gt;
Tested-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>doc-rst: kernel-doc directive, fix state machine reporter</title>
<updated>2016-07-20T22:51:12Z</updated>
<author>
<name>Markus Heiser</name>
<email>markus.heiser@darmarIT.de</email>
</author>
<published>2016-07-20T10:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f42ddca7bebcc069f470143434c119c96cd15bb5'/>
<id>urn:sha1:f42ddca7bebcc069f470143434c119c96cd15bb5</id>
<content type='text'>
Add a reporter replacement that assigns the correct source name and line
number to a system message, as recorded in a ViewList.

[1] http://mid.gmane.org/CAKMK7uFMQ2wOp99t-8v06Om78mi9OvRZWuQsFJD55QA20BB3iw@mail.gmail.com

Signed-off-by: Markus Heiser &lt;markus.heiser@darmarIT.de&gt;
Tested-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>Documentation/sphinx: add support for specifying extra export files</title>
<updated>2016-06-10T13:46:55Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-06-07T09:13:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=03d35d9ec4ae50afeafc3ab26d8207b7069f3cba'/>
<id>urn:sha1:03d35d9ec4ae50afeafc3ab26d8207b7069f3cba</id>
<content type='text'>
Let the user specify file patterns where to look for the EXPORT_SYMBOLs
in addition to the file with kernel-doc comments. This is directly based
on the -export-file FILE option added to kernel-doc in "kernel-doc: add
support for specifying extra files for EXPORT_SYMBOLs", but we extend
that with globbing patterns in the Sphinx extension.

The file patterns are added as options to the :export: and :internal:
arguments of the kernel-doc directive. For example, to extract the
documentation of exported functions from include/net/mac80211.h:

.. kernel-doc:: include/net/mac80211.h
   :export: net/mac80211/*.c

Without the file pattern, no exported functions would be found, as the
EXPORT_SYMBOLs are placed in the various source files under
net/mac80211.

The matched files are also added as dependencies on the document in
Sphinx, as they may affect the output. This is one of the reasons to do
the globbing in the Sphinx extension instead of in scripts/kernel-doc.

The file pattern remains optional, and is not needed if the kernel-doc
comments and EXPORT_SYMBOLs are placed in the source file passed in as
the main argument to the kernel-doc directive. This is the most common
case across the kernel source tree.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation/sphinx: use a more sensible string split in kernel-doc extension</title>
<updated>2016-06-10T08:29:21Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-06-08T07:25:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=057de5c4dd536bdf29275ec75910737087594860'/>
<id>urn:sha1:057de5c4dd536bdf29275ec75910737087594860</id>
<content type='text'>
Using the default str.split doesn't return empty strings like the
current version does.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation/sphinx: remove unnecessary temporary variable</title>
<updated>2016-06-10T08:29:20Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-06-08T10:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=06173fe33a3fd239540bd188f1f12a39e99b6c83'/>
<id>urn:sha1:06173fe33a3fd239540bd188f1f12a39e99b6c83</id>
<content type='text'>
Leftover cruft. No functional changes.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>doc/sphinx: Track line-number of starting blocks</title>
<updated>2016-06-04T08:35:59Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2016-06-03T20:21:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d90368f2fa7ded7c56d214aef087e88bba5199e7'/>
<id>urn:sha1:d90368f2fa7ded7c56d214aef087e88bba5199e7</id>
<content type='text'>
Design is pretty simple: kernel-doc inserts breadcrumbs with line
numbers, and sphinx picks them up. At first I went with a sphinx
comment, but inserting those at random places seriously upsets the
parser, and must be filtered. Hence why this version now uses "#define
LINEO " since one of these ever escape into output it's pretty clear
there is a bug.

It seems to work well, and at least the 2-3 errors where sphinx
complained about something that was not correct in kernel-doc text the
line numbers matched up perfectly.

v2: Instead of noodling around in the parser state machine, create
a ViewList and parse it ourselves. This seems to be the recommended
way, per Jani's suggestion.

v3:
- Split out ViewList pach. Splitting the kernel-doc changes from the
  sphinx ones isn't possible, since emitting the LINENO lines wreaks
  havoc with the rst formatting. We must filter them.

- Improve the regex per Jani's suggestions, and compile it just once
  for speed.

- Now that LINENO lines are eaten, also add them to function parameter
  descriptions. Much less content and offset than for in-line struct
  member descriptions, but still nice to know which exact continuation
  line upsets sphinx.

- Simplify/clarify the line +/-1 business a bit.

v4: Split out the scripts/kernel-doc changes and make line-numbers
opt-in, as suggested by Jani.

Cc: Jani Nikula &lt;jani.nikula@intel.com&gt;
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>doc/sphinx: Stop touching state_machine internals</title>
<updated>2016-06-03T08:31:37Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2016-06-02T12:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=16e161c8c67ac3b27cfc096cf07af9bceb144707'/>
<id>urn:sha1:16e161c8c67ac3b27cfc096cf07af9bceb144707</id>
<content type='text'>
Instead of just forcefully inserting our kernel-doc input and letting
the state machine stumble over it the recommended way is to create
ViewList, parse that and then return the list of parsed nodes.

Suggested by Jani.

Cc: Jani Nikula &lt;jani.nikula@intel.com&gt;
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>doc/sphinx: Pass right filename as source</title>
<updated>2016-06-01T09:28:31Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2016-06-01T09:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9cc1a44c03113cb2f3be73650d7c611c3e273ada'/>
<id>urn:sha1:9cc1a44c03113cb2f3be73650d7c611c3e273ada</id>
<content type='text'>
With this error output becomes almost readable. The line numbers are
still totally bonghits, but that's a lot harder to pull out of
kerneldoc. We'd essentially have to insert some special markers in the
kernel-doc output, split the output along these markers and then
insert each block separately using

     state_machine.insert_input(block, source, first_line)

Cc: Jani Nikula &lt;jani.nikula@intel.com&gt;
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation/sphinx: fix kernel-doc extension on python3</title>
<updated>2016-06-01T08:06:58Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-31T15:09:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba35018593547eac69998e2571fc95cf620f2220'/>
<id>urn:sha1:ba35018593547eac69998e2571fc95cf620f2220</id>
<content type='text'>
Reconcile differences between python2 and python3 on dealing with
stdout, stderr from Popen. This fixes "name 'unicode' is not defined"
errors on python3. We'll need to try to keep the extension working on
both python-sphinx and python3-sphinx so we don't need two copies.

Reported-and-tested-by: Marius Vlad &lt;marius.c.vlad@intel.com&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation/sphinx: add Sphinx kernel-doc directive extension</title>
<updated>2016-05-30T10:38:52Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-18T20:30:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c56de1db54dfbbdfc02a500388952af16e3a9368'/>
<id>urn:sha1:c56de1db54dfbbdfc02a500388952af16e3a9368</id>
<content type='text'>
Add an extension to handle kernel-doc directives, to call kernel-doc
according to the arguments and parameters given to the reStructuredText
directive.

The syntax for the kernel-doc directive is:

.. kernel-doc:: FILENAME
   :export:
   :internal:
   :functions: FUNCTION [FUNCTION ...]
   :doc: SECTION TITLE

Of the directive options export, internal, functions, and doc, currently
only one option may be given at a time.

The FILENAME is relative from the kernel source tree root.

The extension notifies Sphinx about the document dependency on FILENAME,
causing the document to be rebuilt when the file has been changed.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
</feed>
