From patchwork Mon Aug 15 14:08:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Heiser X-Patchwork-Id: 9281029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4694760467 for ; Mon, 15 Aug 2016 14:10:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3846028C40 for ; Mon, 15 Aug 2016 14:10:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CD2B28CA0; Mon, 15 Aug 2016 14:10:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2CF428C40 for ; Mon, 15 Aug 2016 14:10:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753020AbcHOOKH (ORCPT ); Mon, 15 Aug 2016 10:10:07 -0400 Received: from smtp1.goneo.de ([85.220.129.30]:33598 "EHLO smtp1.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753190AbcHOOIv (ORCPT ); Mon, 15 Aug 2016 10:08:51 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id 21B7724235D; Mon, 15 Aug 2016 16:08:50 +0200 (CEST) X-Virus-Scanned: by goneo Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IXgXOb5klnSp; Mon, 15 Aug 2016 16:08:39 +0200 (CEST) Received: from ubu1604.fritz.box (dyndsl-095-033-002-186.ewe-ip-backbone.de [95.33.2.186]) by smtp1.goneo.de (Postfix) with ESMTPSA id CF8E7241D84; Mon, 15 Aug 2016 16:08:38 +0200 (CEST) From: Markus Heiser To: Jonathan Corbet , Mauro Carvalho Chehab , Jani Nikula Cc: Markus Heiser , Linux Media Mailing List , linux-doc@vger.kernel.org Subject: [PATCH 1/5] doc-rst: add boilerplate to customize c-domain Date: Mon, 15 Aug 2016 16:08:24 +0200 Message-Id: <1471270108-29314-2-git-send-email-markus.heiser@darmarit.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471270108-29314-1-git-send-email-markus.heiser@darmarit.de> References: <1471270108-29314-1-git-send-email-markus.heiser@darmarit.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Heiser Add a sphinx-extension to customize the sphinx c-domain. No functional changes right yet, just the boilerplate code. Signed-off-by: Markus Heiser --- Documentation/conf.py | 2 +- Documentation/sphinx/cdomain.py | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Documentation/sphinx/cdomain.py diff --git a/Documentation/conf.py b/Documentation/conf.py index 5c06b01..dc46d23 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -29,7 +29,7 @@ from load_config import loadConfig # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include'] +extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain'] # Gracefully handle missing rst2pdf. try: diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py new file mode 100644 index 0000000..c32387a --- /dev/null +++ b/Documentation/sphinx/cdomain.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8; mode: python -*- +u""" + cdomain + ~~~~~~~ + + Replacement for the sphinx c-domain. + + :copyright: Copyright (C) 2016 Markus Heiser + :license: GPL Version 2, June 1991 see Linux/COPYING for details. +""" + +from sphinx.domains.c import CObject as Base_CObject +from sphinx.domains.c import CDomain as Base_CDomain + +__version__ = '1.0' + +def setup(app): + + app.override_domain(CDomain) + + return dict( + version = __version__ + , parallel_read_safe = True + , parallel_write_safe = True + ) + +class CObject(Base_CObject): + + """ + Description of a C language object. + """ + +class CDomain(Base_CDomain): + + """C language domain.""" + name = 'c' + label = 'C' + directives = { + 'function': CObject, + 'member': CObject, + 'macro': CObject, + 'type': CObject, + 'var': CObject, + }