Community
Participate
Working Groups
API is needed to convert content to wiki markup. Content source format could be HTML, other markup languages, or some arbitrary format. DocumentBuilder provides a great API and abstraction for driving content generation in the target output format. By using this common API, 3rd parties would be able to support new source formats simply by implementing a parser driving the document builder API. The current use case it to target Textile markup, however targeting other markup languages could also be needed. Each target output format would need its own implementation of DocumentBuilder in much the same way as we have subclasses for all of the currently supported output formats (such as HTML, Dita, DocBook, XSL-FO).
pushed commit e600cfbb5cc970a65b5dca509027a5f82411760d new API introduced: * @org.eclipse.mylyn.wikitext.core.parser.HtmlParser@ - parses XHTML and drives the DocumentBuilder API * @org.eclipse.mylyn.wikitext.textile.core.TextileDocumentBuilder@ - emits content as Textile markup
Created attachment 203097 [details] mylyn/context/zip
David, not sure what you're planning to use for parser, but JSoup is really nice to use, especially for wonky html.
The changes broke the build on 3.5. I think you need to depend on org.junit4 (3.5 ships version 4.5.0) if you want to use org.junit.Assert instead of junit.framework.Assert. [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.12.0:compile (default-compile) on project org.eclipse.mylyn.wikitext.tests: Compilation failure: Compilation failure: [ERROR] /opt/users/hudsonbuild/workspace/mylyn-integration-e3.5/org.eclipse.mylyn.docs/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/textile/core/TextileDocumentBuilderTest.java (at line 23):[-1,-1] [ERROR] import org.junit.Assert; [ERROR] ^^^^^^^^^ [ERROR] The import org.junit cannot be resolved [ERROR]
Thanks Miles, JSoup looks great! The current implementation in WikiText is using SAX, which has some obvious shortcomings (such as requiring that the source input be well-formed XML). We're looking for a more reliable parsing solution. JSoup related links: * http://jsoup.org/ * "MIT License":http://jsoup.org/license
Another advantage is that the selector interface and other API features makes parsing much less nicer than using the IMO very fiddly DOM API. http://jsoup.org/cookbook/extracting-data/selector-syntax
(In reply to comment #6) > Another advantage is that the selector interface and other API features makes > parsing much less nicer than using the IMO very fiddly DOM API. > http://jsoup.org/cookbook/extracting-data/selector-syntax "much less nicer" -> "much nicer" :)
Filed "CQ 5559":https://dev.eclipse.org/ipzilla/show_bug.cgi?id=5559
CQ has been approved. The next step is to get jsoup into orbit.
I updated the poms to use the latest Orbit S-build and added jsoup to the target definitions. You should be able to consume it in WikiText now.
Thanks Steffen.
implemented.
In case you didn't notice, a few tests are now failing on the build server: https://hudson.eclipse.org/hudson/job/mylyn-docs-nightly/.
These are now fixed.
I added the jsoup bundle to the WikiText SDK to ensure that it gets published to the update site.
Great, thanks