On Mon, 2002-10-28 at 21:40, David Goodger wrote:
> > To serve as an instructional sample I'm making a very simply Wiki --
> > I'd like to use reST as the markup, since it's not an example in
> > parsing (and I like the reST markup more than most Wiki markups to
> > boot).
>
> Great! Please share the results if you can. I know that some
> intregration with MoinMoin has been done, although incomplete I
> believe. See
> http://twistedmatrix.com/users/jh.twistd/moin/moin.cgi/RestSample
I will, though I'm not really making a full Wiki -- I just thought it
was a good example web application that's neat, yet potentially very
simple (especially when you don't make your own parser).
> Perhaps the tools/pep2html.py module is a better example, function
> "fix_rst_pep". Docutils is called in one (logical) line of code::
>
> output = core.publish_string(
> source=''.join(input_lines),
> source_path=inpath,
> destination_path=outfile.name,
> reader_name='pep',
> parser_name='restructuredtext',
> writer_name='pep_html',
> settings=docutils_settings)
Thanks, that's just what I wanted.
> > Also -- is there a good hook in reST that I can use for Wiki links?
> > The linking mechanism reST has is fine for internal and external
> > links, but doesn't fit right for Wiki links (which fall somewhere in
> > between). If I could capture failed internal links and turn them
> > into inter-wiki-page links, that would be perfect. Failing that, if
> > there was some way I could introduce another markup easily that
> > would be great.
>
> There's mention of Wikis as an example potential Reader component in
> PEP 258 (http://docutils.sf.net/spec/pep-0258.html#readers). A Wiki
> Reader could subclass the standard parser, or we could build in hooks
> if they prove general enough. The PEP Reader
> (docutils/readers/pep.py) first subclassed the parser (still does,
> minimally: the "Inliner" class), but most of the code was moved into
> the parser proper for other client code to use.
>
> I would suggest that Wiki links retain the trailing "_" of regular
> reStructuredText links, and a mechanism be added to do some kind of
> lookup from a Wiki target database. The extra syntax (trailing "_")
> removes ambiguity inherent in CamelCase WikiLinks (such as anything
> written by Angus MacDuff).
That's definitely what I'd like to do -- I have never like WikiNames
anyway -- false positives and mangled case limit the medium, IMHO.
There isn't any database of Wiki targets -- it's important that you be
able to make a link to a page that does not yet exist. I think it would
be fine if Wiki links were made if no internal link could be found
(though with all the automatically-generated targets, there could be
some clashes). Otherwise I'd need some other punctuation -- like `wiki
link`^ or somesuch. There's a fair amount of seldom-used punctuation
that could be used.
In the case of Wiki links being a failback when no internal link was
found, it seems like the easiest way to handle it would be some sort of
error handler... maybe you already have something like this. As to
adding new punctuation-based markup, I have no idea what interface would
make sense, except to somehow subclass the parser. If the parser made
it easy to add certain styles of markup (either trailing punctuation, or
enclosing punctuation), then subclassing doesn't seem like a big burden.
As I think about it, I'm leaning toward new punctuation. Where should I
look for this?
Ian
|