|
From: Andreas J. <an...@an...> - 2002-11-04 17:17:45
|
Hi,
I am currently working on the integration of reStructuredText into Zope.
I have currently two unresolved issues:
- Zope includes (re)STX documents into an existing document with a starting
level of 3 (means it starts with the <H3> header)
- included (re)STX documents must not contain HTML header and footer
Is there a way with docutils to create partitial HTML docs?
Thanks in advance,
Andreas
---------------------------------------------------------------------
- Andreas Jung http://www.andreas-jung.com -
- EMail: andreas at andreas-jung.com -
- "Life is too short to (re)write parsers" -
---------------------------------------------------------------------
|
|
From: David G. <go...@us...> - 2002-11-05 05:20:18
|
Andreas Jung wrote: > I am currently working on the integration of reStructuredText into > Zope. I know almost nothing about Zope, but I believe "integration" may need qualification here. What exactly are you trying to do? Have you looked at Richard Jones' ZReST work? See http://www.zope.org/Members/richard/ZReST (locally at http://docutils.sf.net/sandbox/richard/ZReST/). > I have currently two unresolved issues: > > - Zope includes (re)STX documents into an existing document with a > starting level of 3 (means it starts with the <H3> header) Sorry, I don't know exactly what you mean or what you want here. I can guess, but I'd rather not. Please give examples and ask questions. > - included (re)STX documents must not contain HTML header and footer > > Is there a way with docutils to create partitial HTML docs? Yes. Look at the docutils/writers/html4css1.py module's Writer class. In the "translate" method, it copies several attributes from its "visitor" (HTMLTranslator object), from "head_prefix" to "body_suffix". These are pieces of HTML that may or may not be broken up the way you want. See Ollie Rutherfurd's Writer for ht2html for an example: http://docutils.sf.net/sandbox/oliverr/ht/hthtml.py . -- David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |
|
From: <gr...@us...> - 2002-11-05 07:30:32
|
On Tue, 5 Nov 2002, David Goodger wrote:
> Andreas Jung wrote:
> > I am currently working on the integration of reStructuredText into
> > Zope.
>
> > I have currently two unresolved issues:
> >
> > - Zope includes (re)STX documents into an existing document with a
> > starting level of 3 (means it starts with the <H3> header)
>
> Sorry, I don't know exactly what you mean or what you want here.
> I can guess, but I'd rather not. Please give examples and ask questions.
i used stx from zope prior to reST. AFAIR when converting stx to html
one can set the level for top level sections.
in stx::
My Chapter
my top level.
sub section to chapter
some text.
means for rst file::
My Chapter
==========
my top level.
sub section to chapter
----------------------
some text.
the Chapter should become <h3>Chapter</h3> section would become <h4>section</h4>
so that one can produce sites from several documents.
>
> > - included (re)STX documents must not contain HTML header and footer
> >
> > Is there a way with docutils to create partitial HTML docs?
>
--
BINGO: next-generation Outsourcing
--- Engelbert Gruber -------+
SSG Fintl,Gruber,Lassnig /
A6410 Telfs Untermarkt 9 /
Tel. ++43-5262-64727 ----+
|
|
From: David G. <go...@us...> - 2002-11-06 02:37:06
|
[Andreas Jung] >>> I am currently working on the integration of reStructuredText into >>> Zope. >>> >>> I have currently two unresolved issues: >>> >>> - Zope includes (re)STX documents into an existing document with >>> a starting level of 3 (means it starts with the <H3> header) [David] >> Sorry, I don't know exactly what you mean or what you want here. I >> can guess, but I'd rather not. Please give examples and ask >> questions. [Engelbert] > i used stx from zope prior to reST. AFAIR when converting stx to > html one can set the level for top level sections. > > in stx:: > > My Chapter > > my top level. > > sub section to chapter > > some text. > > means for rst file:: > > My Chapter > ========== > > my top level. > > sub section to chapter > ---------------------- > > some text. > > the Chapter should become <h3>Chapter</h3> section would become > <h4>section</h4> > > so that one can produce sites from several documents. This is what I thought might be the case. The functionality isn't implemented now, but it easily could be. A runtime setting & command-line option could be introduced to modify the current behavior. -- David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |
|
From: Andreas J. <an...@an...> - 2002-11-05 20:35:25
|
--On Dienstag, 5. November 2002 00:20 -0500 David Goodger <go...@us...> wrote: > > Yes. Look at the docutils/writers/html4css1.py module's Writer class. > In the "translate" method, it copies several attributes from its > "visitor" (HTMLTranslator object), from "head_prefix" to > "body_suffix". These are pieces of HTML that may or may not be broken > up the way you want. See Ollie Rutherfurd's Writer for ht2html for an > example: http://docutils.sf.net/sandbox/oliverr/ht/hthtml.py . > Meanwhile I resolved the problems with a derived Writer class (from html4css1). Zope btw. now supports reSTX both inside DTML and with Richards reSTX product. Andreas --------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - --------------------------------------------------------------------- |
|
From: David G. <go...@us...> - 2002-11-06 02:37:43
|
Andreas Jung wrote: > Meanwhile I resolved the problems with a derived Writer class (from > html4css1). Zope btw. now supports reSTX both inside DTML and with > Richards reSTX product. Great! Does that code live in Zope or in Docutils? Could you share it with us? (BTW we don't say "reSTX". Please use "reST" instead.) -- David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |
|
From: Andreas J. <an...@an...> - 2002-11-06 05:39:27
|
The code is in the ajung-restructuredtext-integration-branch of Zope (available from cvs.zope.org). docutils is checked in into the CVS and I made some extensions to the DTML code. There will be further changes to include support reST into CMF. Also Richards ZreST product lives in the branch. -aj --On Dienstag, 5. November 2002 21:38 -0500 David Goodger <go...@us...> wrote: > Andreas Jung wrote: >> Meanwhile I resolved the problems with a derived Writer class (from >> html4css1). Zope btw. now supports reSTX both inside DTML and with >> Richards reSTX product. > > Great! Does that code live in Zope or in Docutils? Could you share > it with us? (BTW we don't say "reSTX". Please use "reST" instead.) > > -- > David Goodger <go...@us...> Open-source projects: > - Python Docutils: http://docutils.sourceforge.net/ > (includes reStructuredText: http://docutils.sf.net/rst.html) > - The Go Tools Project: http://gotools.sourceforge.net/ > > --------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - --------------------------------------------------------------------- |
|
From: David G. <go...@py...> - 2002-11-07 02:20:41
|
[David] >> Does that code live in Zope or in Docutils? Perhaps I should have asked: Where *should* that code live? [Andreas] > The code is in the ajung-restructuredtext-integration-branch > of Zope I see the docutils/writers/html4zope.py module. Any other additions or changes? Would these files be maintained there? Or is that just a snapshot of the Docutils package, to be updated from time to time? I hope the latter. Docutils is still very much in the experimentation/exploration stage of development. As I've discovered flaws in the design of Docutils, I've make some sweeping changes to its internals. Although never without good reason, APIs *are* subject to change, sometimes breaking client code. If the Zope integration code were part of Docutils itself, there's a much better chance (>0 vs. 0) that API changes will be applied to that code as well. Code in the main package must continue to work; any bugs are fixed ASAP. I try to update code in the sandbox where I can. Code in another CVS repository won't be seen by me. So I think that html4zope.py ought to live in Docutils. However, if we implement the changes it needs in html4css1.py (HTML header tags starting at <h3>), it could be that there is no need for it. -- David Goodger <go...@py...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |