DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mcnamara, John" <john.mcnamara@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 0/2] doc: refactored fig and table nums into references
Date: Thu, 30 Apr 2015 13:34:15 +0000	[thread overview]
Message-ID: <B27915DBBA3421428155699D51E4CFE2F183E8@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <4018323.hxXVqqSkHq@xps13>



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, April 29, 2015 5:13 PM
> To: Mcnamara, John
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/2] doc: refactored fig and table nums
> into references
> 
> is really a great work but I think it's not reasonnable to require
> sphinx 1.3. As almost nobody is using this version, it would be equivalent
> to prevent users and developers to generate the doc by themselves.

Hi Thomas,

Yes. That is probably right.


> It produces this error:
> 	ERROR: Unknown interpreted text role "numref".
> 
> Do you think it's possible to implement a fallback in our conf.py in order
> to ignore this new role if not supported?

It would be possible but a full implementation probably wouldn't be worth it. We could add a workaround like the following to conf.py that would just render the figure/table ref numbers as the target name as a fallback. That would allow people to generate the docs with older versions of sphinx:

$ git diff doc/guides/conf.py
diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index 1bc031f..bbf40f1 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -82,3 +82,16 @@ class CustomLatexFormatter(LatexFormatter):
 
 # Replace the default latex formatter.
 PygmentsBridge.latex_formatter = CustomLatexFormatter
+
+from docutils import nodes
+from distutils.version import LooseVersion
+from sphinx import __version__ as sphinx_version
+
+# Workaround to ignore :numref: in older versions of Sphinx.
+def setup(app):
+
+    if LooseVersion(sphinx_version) < LooseVersion('1.3.1'):
+        print('[dpdk docs] Upgrade sphinx to version >= 1.3.1 for '
+              'improved Figure/Table number handling.')
+        app.add_generic_role('numref', nodes.emphasis)
+


That is just a workaround though, and maybe not worth it either.

P.S. Also note, Sphinx 1.3.1 has a nice but very different default Html style. 

John




 

  reply	other threads:[~2015-04-30 13:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 13:11 John McNamara
2015-04-24 13:11 ` [dpdk-dev] [PATCH 1/2] doc: refactored figure numbers " John McNamara
2015-04-24 13:11 ` [dpdk-dev] [PATCH 2/2] doc: refactored table " John McNamara
2015-04-29 16:12 ` [dpdk-dev] [PATCH 0/2] doc: refactored fig and table nums " Thomas Monjalon
2015-04-30 13:34   ` Mcnamara, John [this message]
2015-05-13 19:07     ` Thomas Monjalon
2015-05-14 10:41       ` Mcnamara, John
2015-05-18 10:48       ` Mcnamara, John
2015-05-18 11:15 ` [dpdk-dev] [PATCH v2 0/3] " John McNamara
2015-05-18 11:15   ` [dpdk-dev] [PATCH 1/3] doc: refactored figure numbers " John McNamara
2015-05-18 11:15   ` [dpdk-dev] [PATCH v2 3/3] doc: add sphinx numref compatibility workaround John McNamara
2015-05-18 11:34 ` [dpdk-dev] [PATCH v3 0/3] doc: refactored fig and table nums into references John McNamara
2015-05-18 11:34   ` [dpdk-dev] [PATCH v3 1/3] doc: refactored figure numbers " John McNamara
2015-05-18 11:34   ` [dpdk-dev] [PATCH v3 2/3] doc: refactored table " John McNamara
2015-05-18 11:34   ` [dpdk-dev] [PATCH v3 3/3] doc: add sphinx numref compatibility workaround John McNamara
2015-05-25 14:05   ` [dpdk-dev] [PATCH v3 0/3] doc: refactored fig and table nums into references Thomas Monjalon
2015-05-25 16:37     ` Mcnamara, John

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=B27915DBBA3421428155699D51E4CFE2F183E8@IRSMSX103.ger.corp.intel.com \
    --to=john.mcnamara@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).