Re: Re-2: Tabs for pier

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Re-2: Tabs for pier

Lukas Renggli-2
Hi Frank,

> With some easy things in css I was able to realize what I want in  
> HTML. But what do you think about syntax extension of pier to do  
> such things like
> :indented_text.
> I found this behavior in another wiki and it helps for readability  
> of the text.
> Sure I can use HTML but writing of such things written above is  
> much easier.

I tried to keep the syntax as simple as possible. However there were  
several requests lately for that kind of things. I don't really know,  
how we could implement that the simplest without bloating the wiki-
syntax and while keeping the visitors small that transform the AST  
into different output-formats (HTML, Text, Latex, etc).

The best idea I cam up so far is to add some sort of XML-Tags that  
can be parsed in a generic fashion, so that extensions can register  
their own tags. Something along ...

<pier:indented>
The time is now: <pier:smalltalk>Time now</pier:smalltalk>
</pier:indented>

Would that help? Is something like that of generic interest?

> I've been searching in the code for the place of translation from  
> *..* and others to HTML and coming down to PRDocumentScanner  
> scanForToken and see the scannerDefinitionComment on class-side.  
> The next step to define a new element would be very interesting.

The scanner and parser is automatically generated from the respective  
definitions using SmaCC, so you probably don't want to change these  
methods manually ;-)

If you only want to do some simple string transformations when  
generating HTML you could simply patch the methods from the protocol  
#visiting-document in the class PRViewRenderer.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Re-2: Tabs for pier

Philippe Marschall
> I tried to keep the syntax as simple as possible. However there were
> several requests lately for that kind of things. I don't really know,
> how we could implement that the simplest without bloating the wiki-
> syntax and while keeping the visitors small that transform the AST
> into different output-formats (HTML, Text, Latex, etc).
>
> The best idea I cam up so far is to add some sort of XML-Tags that
> can be parsed in a generic fashion, so that extensions can register
> their own tags. Something along ...
>
> <pier:indented>
> The time is now: <pier:smalltalk>Time now</pier:smalltalk>
> </pier:indented>
>
> Would that help? Is something like that of generic interest?

I like the idea of having the possibility to hook into the document
model without having to change the syntax/scanner/parser. Only this
makes it possible to combine several of these exentions. Dokuwiki uses
a very similar model for it's plugins:
http://wiki.splitbrain.org/wiki%3Aplugins

I understand you want to keep the syntax as simple as possible but
still to differ extensions (or pulgings or whatever we will call them)
from normal XML markup I'd like to have a different syntax. Eg:
[indented]
The time is now: [smalltalk]Time now[/smalltalk]
[/indented]
They would be parsed into an ExtensionNode or whatever. You could also
search the subclasses for the one with the correct tag (eg:
"indented") and instantiate this one directly instead of the
superclass (ExtensionNode).

Cheers
Philippe


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki