Aahz | 1 May 2003 01:30

Re: Custom behaviour in reST

On Thu, May 01, 2003, Magnus Lyckå wrote:
>
> I hope I'm not just reiterating some old discussion you've
> been through before here...

Not quite, but close to it.  ;-)

> Are there in-line versions of the directives as well? Maybe
> I want a python style expression in the middle of a paragraph?

That's interpreted text and roles::

    :chapter:`Foo`

for example.

> Is it possible to have site specific directives without having
> to patch docutils? I.e, do they work as plug-ins? My quick look
> at the code seems to suggest that you would hand-edit the dict
> _directive_registry in directives/__init__.py, but maybe I
> missed something. (Either way, I assume it's better to fix that
> then to add another layer of code.)

From OOdirectives.py (part of my hacked OpenOffice writer)::

    from docutils.parsers.rst import directives
    from docutils.parsers.rst.languages import en

    registry = directives._directive_registry
    registry['include-code'] = ('OOdirectives', 'include_code')
(Continue reading)

David Goodger | 1 May 2003 04:38
Favicon

Re: Custom behaviour in reST

Magnus Lyckå wrote:
> I hope I'm not just reiterating some old discussion you've
> been through before here...
...
> Great, I still know all to little about this. (Waiting to be
> educated in Charleroi in June. :)

Please feel free to educate yourself via the contents of the spec, 
spec/rst, and docs directories, and the source code itself.  I doubt 
anyone would be reckless enough to talk about the Docutils *internals* 
at Charleroi.  I imagine (please correct me if I'm wrong) that Michael 
Hudson's lightning talk will be about *using* reStructuredText from an 
author's perspective, possibly delving into the 
developer-using-Docutils-as-library perspective.

> Are there in-line versions of the directives as well? Maybe
> I want a python style expression in the middle of a paragraph?

There's interpreted text with roles, which are essentially an extension 
mechanism for inline markup, and substitutions, which allow inline 
directives indirectly.

> Is it possible to have site specific directives without having
> to patch docutils? I.e, do they work as plug-ins?

The docutils.parsers.rst.directives.register_directive function was 
recently added (to __init__.py).  It bypasses the language lookup features.

> (Either way, I assume it's better to fix that
> then to add another layer of code.)
(Continue reading)

David Goodger | 1 May 2003 04:40
Favicon

Re: Custom behaviour in reST

Moore, Paul wrote:
> I think a general "phrase" element (I like that name) with a directive-
> defined "class" attribute, plus a policy/method for writers to handle these
> would probably be best.

I am coming to the same conclusion.

-- David Goodger

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Magnus Lyckå | 1 May 2003 13:14
Picon

Re: Custom behaviour in reST

At 22:38 2003-04-30 -0400, David Goodger wrote:
>Magnus Lyckå wrote:
>>I think it's good to keep such things
>>outside the core of Docutils if this is to be able to scale.
>
>Agreed.  I'm leaning toward adding a single new general-purpose element, 
>"phrase", equivalent to HTML's <span>.
...
>    <literal_block xml:space="preserve" class="python">
>     <phrase class="keyword">print</> <phrase
>      class="string">'This is Python code.'</>
>     <phrase class="keyword">for</> <phrase
>      class="identifier">i</> <phrase class="keyword">in</> <phrase
>      class="expression">range(10)</>:
>         <phrase class="keyword">print</> <phrase
>          class="expression">i</>
>     </literal_block>
>
>It's more verbose but more easily extensible and more appropriate for the 
>case at hand.
>
>>Ok, maybe not all of these will materialize, but in general, I
>>think it's a good idea to delegate things like this to the directive
>>code. As far as I understand, that means delegating writer work,
>>or possibly some very generic data-driven internal system.
>
>I don't follow.

If I understand you correctly, your thought is that all the drivers
should be extended to know how to render "keyword", "string", "expression"
(Continue reading)

Michael Hudson | 1 May 2003 16:36
Favicon

Re: Custom behaviour in reST

David Goodger <goodger <at> python.org> writes:

> Magnus Lyckå wrote:
>> I hope I'm not just reiterating some old discussion you've
>> been through before here...
> ...
>> Great, I still know all to little about this. (Waiting to be
>> educated in Charleroi in June. :)
>
> Please feel free to educate yourself via the contents of the spec,
> spec/rst, and docs directories, and the source code itself.  I doubt
> anyone would be reckless enough to talk about the Docutils *internals*
> at Charleroi.  I imagine (please correct me if I'm wrong) that Michael
> Hudson's lightning talk will be about *using* reStructuredText from an
> author's perspective, possibly delving into the
> developer-using-Docutils-as-library perspective.

You're not at all wrong!

Cheers,
M.

--

-- 
  Now this is what I don't get.  Nobody said absolutely anything
  bad about anything.  Yet it is always possible to just pull
  random flames out of ones ass.
         -- http://www.advogato.org/person/vicious/diary.html?start=60

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
(Continue reading)

David Goodger | 1 May 2003 23:48
Favicon

Re: Custom behaviour in reST

Discussion moved to docutils-develop; subscribe at 
<http://lists.sf.net/lists/listinfo/docutils-develop>.

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Michele Simionato | 2 May 2003 19:01
Picon
Favicon

latex writer

I have just started playing with the latex writer and I
must say I am impressed. 

I have just few questions:

1) when I try to compile the tex file, I get

! LaTeX Error: File `style.tex' not found.

Where is this file in the standard distribution ?
(I have the snapshot of few days ago). Anyway,
it works if I ignore the message.

2) Am I right if I say that there is not yet
documentation for the latex writer ?

3) How do I force a pagebreak ?

reST+latex rocks!

--

-- 
Michele Simionato - Dept. of Physics and Astronomy
210 Allen Hall Pittsburgh PA 15260 U.S.A.
Phone: 001-412-624-9041 Fax: 001-412-624-9163
Home-page: http://www.phyast.pitt.edu/~micheles/

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
(Continue reading)

James Brokenbek | 2 May 2003 20:28

Text-based graphics "overridable" in output formats?

I've enjoyed using reST for some of my documentation needs.  My thanks
to Dave and all the reST developers for a great tool.

A couple of questions:

1)  I'm unfamiliar with both CVS usage and policy (having exclusively
used ClearCase).  The former I'm working on by reading some HOW-TOs, and
I've just now successfully retrieved the sources.  I don't know,
however, if I should (policy-wise) expect the sources I've retrieved to
be stable, or if I should retrieve sources against some "tag" in order
to have some assurance of stability.  (I hope I'm using the term
correctly; I mean something like a ClearCase "label".)  Are the sources
retrieved from a default checkout stable?

2)  Since reST is meant to be readable as plain-text, I often do simple
diagrams in text.  When I want to render a document into HTML I will
also occasionally create a PNG diagram in order to have a more polished
appearance for that medium.  I'd like text-based browsers (e.g., lynx)
to show the text diagram, but graphical browsers to show *only* the PNG
diagram, *not* the text diagram.  I tried something like this:

.. figure:: protocol_stack.png
   :alt: +----------+
         |   SNMP   |
         +----------+
         |   UDP    |
         +----------+
         |    IP    |
         +----------+
         | Ethernet |
(Continue reading)

Patrick K. O'Brien | 2 May 2003 20:49

Re: Text-based graphics "overridable" in output formats?

"James Brokenbek" <jbrokenbek <at> celion.com> writes:

> I've enjoyed using reST for some of my documentation needs.  My thanks
> to Dave and all the reST developers for a great tool.
> 
> A couple of questions:
> 
> 1)  I'm unfamiliar with both CVS usage and policy (having exclusively
> used ClearCase).  The former I'm working on by reading some HOW-TOs, and
> I've just now successfully retrieved the sources.  I don't know,
> however, if I should (policy-wise) expect the sources I've retrieved to
> be stable, or if I should retrieve sources against some "tag" in order
> to have some assurance of stability.  (I hope I'm using the term
> correctly; I mean something like a ClearCase "label".)  Are the sources
> retrieved from a default checkout stable?

In general, CVS supports tags, and you can check out certain tags or
certain branches.  But the use of these features varies by project.  I
happen to always run the latest and greatest version of docutils, and
have for some time now.  So my advice would be to keep it simple and
check out the default project from CVS (which gets you the main trunk,
or whatever CVS calls it).  I suspect that how most people who work
from the CVS version of docutils are doing it.

Hope that helps.

--

-- 
Patrick K. O'Brien
Orbtech      http://www.orbtech.com/web/pobrien
-----------------------------------------------
(Continue reading)

Aahz | 2 May 2003 20:47

Re: Text-based graphics "overridable" in output formats?

On Fri, May 02, 2003, James Brokenbek wrote:
> 
> 1)  I'm unfamiliar with both CVS usage and policy (having exclusively
> used ClearCase).  The former I'm working on by reading some HOW-TOs, and
> I've just now successfully retrieved the sources.  I don't know,
> however, if I should (policy-wise) expect the sources I've retrieved to
> be stable, or if I should retrieve sources against some "tag" in order
> to have some assurance of stability.  (I hope I'm using the term
> correctly; I mean something like a ClearCase "label".)  Are the sources
> retrieved from a default checkout stable?

They're reasonably stable; more importantly, they're your only useful
option because the last point release was done last July, and there have
been many changes since then.  However, I'd recommend not mucking with
CVS unless you intend to do development work on reST; just use the
snapshot at http://docutils.sourceforge.net/docutils-snapshot.tgz
(which gets automatically generated from CVS).

If someone wants to take charge of doing the grunt work for the next
point release, I'm sure David Goodger would love to hear from you.
--

-- 
Aahz (aahz <at> pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles:  boring syntax, unsurprising semantics,
few automatic coercions, etc etc.  But that's one of the things I like
about it."  --Tim Peters on Python, 16 Sep 93

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
(Continue reading)


Gmane