1. 09 6月, 2019 2 次提交
    • J
      doc: Cope with Sphinx logging deprecations · 21158982
      Jonathan Corbet 提交于
      commit 096ea522e84ea68f8e6c41e5e7294731a81e29bc upstream.
      
      Recent versions of sphinx will emit messages like:
      
        Documentation/sphinx/kerneldoc.py:103:
           RemovedInSphinx20Warning: app.warning() is now deprecated.
           Use sphinx.util.logging instead.
      
      Switch to sphinx.util.logging to make this unsightly message go away.
      Alas, that interface was only added in version 1.6, so we have to add a
      version check to keep things working with older sphinxes.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21158982
    • J
      doc: Cope with the deprecation of AutoReporter · c0742228
      Jonathan Corbet 提交于
      commit 2404dad1f67f8917e30fc22a85e0dbcc85b99955 upstream.
      
      AutoReporter is going away; recent versions of sphinx emit a warning like:
      
        Documentation/sphinx/kerneldoc.py:125:
            RemovedInSphinx20Warning: AutodocReporter is now deprecated.
            Use sphinx.util.docutils.switch_source_input() instead.
      
      Make the switch.  But switch_source_input() only showed up in 1.7, so we
      have to do ugly version checks to keep things working in older versions.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0742228
  2. 30 6月, 2018 1 次提交
  3. 10 3月, 2018 1 次提交
  4. 08 3月, 2018 1 次提交
  5. 01 9月, 2017 1 次提交
  6. 20 10月, 2016 1 次提交
  7. 01 9月, 2016 1 次提交
  8. 21 7月, 2016 1 次提交
  9. 10 6月, 2016 3 次提交
    • J
      Documentation/sphinx: add support for specifying extra export files · 03d35d9e
      Jani Nikula 提交于
      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: NJani Nikula <jani.nikula@intel.com>
      03d35d9e
    • J
      Documentation/sphinx: use a more sensible string split in kernel-doc extension · 057de5c4
      Jani Nikula 提交于
      Using the default str.split doesn't return empty strings like the
      current version does.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      057de5c4
    • J
      Documentation/sphinx: remove unnecessary temporary variable · 06173fe3
      Jani Nikula 提交于
      Leftover cruft. No functional changes.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      06173fe3
  10. 04 6月, 2016 1 次提交
    • D
      doc/sphinx: Track line-number of starting blocks · d90368f2
      Daniel Vetter 提交于
      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 <jani.nikula@intel.com>
      Cc: linux-doc@vger.kernel.org
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      d90368f2
  11. 03 6月, 2016 1 次提交
  12. 01 6月, 2016 2 次提交
  13. 30 5月, 2016 1 次提交
    • J
      Documentation/sphinx: add Sphinx kernel-doc directive extension · c56de1db
      Jani Nikula 提交于
      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: NJani Nikula <jani.nikula@intel.com>
      c56de1db