Edgewall Software

Ticket #4431 (assigned enhancement)

Opened 21 months ago

Last modified 8 months ago

wiki_to_wikidom

Reported by: ittayd@… Owned by: cboos
Priority: highest Milestone: 0.13
Component: wiki system Version: 0.10.3
Severity: major Keywords: engine parser formatter
Cc: Martin.vGagern@…

Description

It would be good for plugins if parsing of wiki text will be broken to two stages. first take the text and convert to some data object tree (ala DOM, but with wiki orientation, so nodes are 'text', 'macro', 'link' etc.), then different formatters can go over the tree and format it, and plugins can search it.

Attachments

Change History

Changed 21 months ago by eblot

I'm pretty sure there is alreay one ticket for this.

This feature is expected for email formatting, for example. Please search the DB and close this ticket if/when you find the duplicate.

Changed 21 months ago by ittayd@…

sorry, couldn't find a duplicate

Changed 21 months ago by cboos

  • severity changed from normal to major
  • component changed from general to wiki
  • priority changed from normal to high
  • owner changed from jonas to cboos
  • milestone set to 0.11
  • keywords engine parser formatter added

Well, I'm not sure there's been a specific ticket for this, but references to this are scattered through wiki-related tickets.

So, yes, generating a Wiki-DOM tree is the plan. More specifically, the wiki parser would yield a tree of Element nodes, which can be traversed by the wiki formatters to render either as another tree of (HTML) Element nodes or serialized to various other formats (plain text, LaTeX, etc.).

Some related tickets are:

  • #3925 (build <pre> elements)
  • #3895 (build <link> elements)
  • #3089 (retrieve <heading> elements from macros, needs 2 passes)
  • #2296 (formatting to LaTeX)
  • #4270 (formatting to plain text)
  • #2064 (better truncating when generating one-liner content)

... and probably others.

Let's focus this ticket on the parsing/formatting split itself, and the specifics of the WikiDom?.

Changed 20 months ago by cboos

Some other requirements (from #4139): a macro should be able to return some more Wiki content, instead of simply some rendered output.

If we split the macro rendering in two phases, one corresponding to the parsing, the other to the rendering (by the way of the expand_macro recently introduced in r4621), then this would be possible, as the first phase could return the additional wiki text source, which could then be recursively parsed.

Changed 19 months ago by cboos

  • status changed from new to assigned

Ok, I've now started to work on the parser/formatter split, stay tuned ;)

Changed 19 months ago by anonymous

  • cc Martin.vGagern@… added

Changed 17 months ago by cboos

  • priority changed from high to highest

Changed 16 months ago by cboos

  • milestone changed from 0.11 to 0.12

Probably not for 0.11 - too many things left to do for that release.

Changed 8 months ago by Zoran Isailovski

Just a hint: If the "DOM" you have in mind represents the input domain, then it is a sort of an abstract syntax tree (AST). There are parser generators out there which generate parsers able to do just that: Generate AST's. They would require a formal definition of the input lange syntax though, which I have not seen yet for wikis (but I think the project would definitely benefit from formally defining the wiki syntax anyway, so it might very well be worth the effort).

Cheers -- Zoran

Add/Change #4431 (wiki_to_wikidom)

Author



Change Properties
<Author field>
Action
as assigned
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.