Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
I also need to figure out how to print that to the screen.
Do you mean the HTML/PDF/ODF or whatever output? Once you have the
correct element node added to the document tree (at the right place),
conversion to the output format should be done by the writer without
further effort. This is the nice thing about the separation of parsing,
transforming and writing steps.
I guess I have this part figured out now. I'll probably be wrong, but I
think I have it.
A very basic example of what I'm trying to do is...
.. mydirective:: fuzzy
A|b|c|d
wuzzy
was a
bear
I would like to do two things with this directive. I first want the
argument to generate a title and the first line to generate a table,
followed by the remaining stuff.
If I weren't making this directive, it would be something more like
this...
fuzzy
~~~~~
========= > > *Title 1* A
*Title 2* b
*Title 3* c
*Title 4* d
========= >
wuzzy
was a
bear
This is a grossly simplified version, but basically explains exactly
what I
need. I need to first, register that heading, then I need to generate a
table.
I really hope this makes sense. I'm struggling to explain it and really
hope
that someone can help me figure this out.
For me, a help in creating such directives was to re-create the intended
behaviour in rst (as you do above) and then have a look at the
rst2pseudoxml
or rst2xml output to see what the relevant part of the document tree looks
like. Then I go to docutils/docutils/parsers/rst/directives and look for
examples to copy and paste and adapt.
That sounds like a scary trip. I'll try to run through there and figure it
out.

--001a11369dc277d11e04eeba0336
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable <div dir="ltr">I think I&#39;m finally starting to get this. sphinx-doc uses docutils to do most of its work. Docutils provides the parsing of rst along with pretty much all of the work that sphinx-doc does. So... it is indeed docutils that I need to work with to make this work.<br> <div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 29, 2013 at 11:31 AM, Guenter Milde <span dir="ltr">&lt;<a href="mailto:***@users.sf.net" target="_blank">***@users.sf.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-12-29, Michael Lustfield wrote:<br></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
&gt; This function now sticks things on the page, but... I can&#39;t figure out<br>
&gt; how to register a heading. The heading I want to register will always<br>
&gt; be the same level.<br>
<br>
</div>

Loading...