-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I just fixed this. I don't think the themes need to be changed; I consider the
styling to be a bit ugly anyway (in HTML; things are different for Latex and
text writers where there is (often) no coloring and underlines possible to
mark links).
Georg
On 02/25/2015 03:29 PM, Robert Lehmann wrote:
> I think the problem Ignacio was pointing at is that there /are no/ emphasis
> or reference nodes in that doctree. As far as I understand, the problem is
> that Transforms are applied on a per-document basis and thus pending_xref
> <
http://sphinx-doc.org/extdev/nodes.html#sphinx.addnodes.pending_xref> is
> <mailto:
jel...@gmail.com>> wrote:
>
> Thanks.
>
> Note that I don't want to replace all emphasis nodes, only those that have
> been added (unnecessarily, I'd say) in references. Anyway, I tried this in
> conf.py:
>
> | fromdocutils importnodes | | fromdocutils.transforms importTransform
>
> classEmphasisTransform(Transform): | |
>
> default_priority =999
>
> defapply(self): fornode inself.document.traverse(nodes.paragraph):
> printnode
>
> defsetup(app): app.add_transform(EmphasisTransform) |
>
> and what I get is something like:
>
> <paragraph ids="index-1">Lorem ipsum dolor <pending_xref refdoc="doc"
> refdomain="std" refexplicit="False" reftarget="label" reftype="numref"
> refwarn="True"><literal classes="xref std
> std-numref">label</literal></pending_xref> ...</paragraph>
>
> What's important: no emphasis node, no reference node, so there's nothing
> to replace. I tried different values of default_priority, and it doesn't
> seem to change.
>
>
>
> On Saturday, February 21, 2015 at 12:07:47 AM UTC+1, Takayuki SHIMIZUKAWA
> wrote:
>
> Hi,
>
> You can replace a node before rendering by using transform. IMO, in this
> case you can write transform in your conf.py as:
>
> ``` from docutils.transforms import Transform
>
> class EmphasisTransform(Transform): default_priority = 210
>
> def apply(self): for node in self.document.traverse(nodes.__emphasis):
> new_node = nodes.inline(rawsource='', *node.children)
> node.replace_self(new_node)
>
> def setup(app): app.add_transform(__EmphasisTransform) ``` (not tested,
> it'll probably work.. )
>
> -- You received this message because you are subscribed to the Google
> Groups "sphinx-dev" group. To unsubscribe from this group and stop
> receiving emails from it, send an email to
>
sphinx-dev+...@googlegroups.com
> <mailto:
sphinx-dev+...@googlegroups.com>. For more options, visit
> <mailto:
sphinx-dev+...@googlegroups.com>. For more options, visit
> <mailto:
sphinx-dev+...@googlegroups.com>. For more options, visit
>
https://groups.google.com/d/optout.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlTt4fEACgkQN9GcIYhpnLC/IgCfWc6hZHtJuWRX/1f1UjWRs2LI
lBsAmwYIyjtB8+u74TZsh+y/vpRhDEuH
=xKK3
-----END PGP SIGNATURE-----