<classpathentry kind="lib" path="ext/tracwiki-core-1.4.jar" sourcepath="ext/src/tracwiki-core-1.4.jar" />
<classpathentry kind="lib" path="ext/mediawiki-core-1.4.jar" sourcepath="ext/src/mediawiki-core-1.4.jar" />
<classpathentry kind="lib" path="ext/confluence-core-1.4.jar" sourcepath="ext/src/confluence-core-1.4.jar" />
+ <classpathentry kind="lib" path="ext/asciidoctor-java-integration-0.1.4.jar" sourcepath="ext/src/asciidoctor-java-integration-0.1.4.jar" />
+ <classpathentry kind="lib" path="ext/jruby-complete-1.7.4.jar" sourcepath="ext/src/jruby-complete-1.7.4.jar" />
+ <classpathentry kind="lib" path="ext/jcommander-1.30.jar" sourcepath="ext/src/jcommander-1.30.jar" />
<classpathentry kind="lib" path="ext/org.eclipse.jgit-3.3.1.201403241930-r.jar" sourcepath="ext/src/org.eclipse.jgit-3.3.1.201403241930-r.jar" />
<classpathentry kind="lib" path="ext/jsch-0.1.50.jar" sourcepath="ext/src/jsch-0.1.50.jar" />
<classpathentry kind="lib" path="ext/JavaEWAH-0.7.9.jar" sourcepath="ext/src/JavaEWAH-0.7.9.jar" />
wikitext.version : 1.4
sshd.version: 0.11.0
mina.version: 2.0.7
+ asciidoctorj.version : 0.1.4
}
# Dependencies
- compile 'org.fusesource.wikitext:tracwiki-core:${wikitext.version}' :war
- compile 'org.fusesource.wikitext:mediawiki-core:${wikitext.version}' :war
- compile 'org.fusesource.wikitext:confluence-core:${wikitext.version}' :war
+- compile 'org.asciidoctor:asciidoctor-java-integration:${asciidoctorj.version}' :war
- compile 'org.eclipse.jgit:org.eclipse.jgit:${jgit.version}' :war :fedclient :manager :authority !junit
- compile 'org.eclipse.jgit:org.eclipse.jgit.http.server:${jgit.version}' :war :manager :authority !junit
- compile 'org.bouncycastle:bcprov-jdk15on:${bouncycastle.version}' :war :authority
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library name="asciidoctor-java-integration-0.1.4.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/ext/asciidoctor-java-integration-0.1.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/ext/src/asciidoctor-java-integration-0.1.4.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="jruby-complete-1.7.4.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/ext/jruby-complete-1.7.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/ext/src/jruby-complete-1.7.4.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="jcommander-1.30.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/ext/jcommander-1.30.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/ext/src/jcommander-1.30.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
<orderEntry type="module-library">
<library name="org.eclipse.jgit-3.3.1.201403241930-r.jar">
<CLASSES>
\r
import org.apache.wicket.Page;\r
import org.apache.wicket.RequestCycle;\r
+import org.asciidoctor.Asciidoctor;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
import org.eclipse.mylyn.wikitext.confluence.core.ConfluenceLanguage;\r
public class MarkupProcessor {\r
\r
public enum MarkupSyntax {\r
- PLAIN, MARKDOWN, TWIKI, TRACWIKI, TEXTILE, MEDIAWIKI, CONFLUENCE\r
+ PLAIN, MARKDOWN, TWIKI, TRACWIKI, TEXTILE, MEDIAWIKI, CONFLUENCE, ASCIIDOC\r
}\r
\r
private Logger logger = LoggerFactory.getLogger(getClass());\r
\r
public List<String> getMarkupExtensions() {\r
List<String> list = new ArrayList<String>();\r
+ list.addAll(settings.getStrings(Keys.web.asciidocExtensions));\r
list.addAll(settings.getStrings(Keys.web.confluenceExtensions));\r
list.addAll(settings.getStrings(Keys.web.markdownExtensions));\r
list.addAll(settings.getStrings(Keys.web.mediawikiExtensions));\r
return MarkupSyntax.PLAIN;\r
}\r
\r
- if (settings.getStrings(Keys.web.confluenceExtensions).contains(ext)) {\r
+ if (settings.getStrings(Keys.web.asciidocExtensions).contains(ext)) {\r
+ return MarkupSyntax.ASCIIDOC;\r
+ } else if (settings.getStrings(Keys.web.confluenceExtensions).contains(ext)) {\r
return MarkupSyntax.CONFLUENCE;\r
} else if (settings.getStrings(Keys.web.markdownExtensions).contains(ext)) {\r
return MarkupSyntax.MARKDOWN;\r
if (markupText != null) {\r
try {\r
switch (syntax){\r
+ case ASCIIDOC:\r
+ asciidoc(doc, repositoryName, commitId);\r
+ break;\r
case CONFLUENCE:\r
parse(doc, repositoryName, commitId, new ConfluenceLanguage());\r
break;\r
doc.html = MarkdownUtils.transformMarkdown(doc.markup, renderer);\r
}\r
\r
+ /**\r
+ * Parses the document as Asciidoc using Asciidoctor.\r
+ *\r
+ * @param doc\r
+ * @param repositoryName\r
+ * @param commitId\r
+ */\r
+ private void asciidoc(final MarkupDocument doc, final String repositoryName, final String commitId) {\r
+ Asciidoctor asciidoctor = org.asciidoctor.Asciidoctor.Factory.create();\r
+ doc.html = asciidoctor.render(doc.markup, new HashMap<String, Object>());\r
+ }\r
+\r
private String getWicketUrl(Class<? extends Page> pageClass, final String repositoryName, final String commitId, final String document) {\r
String fsc = settings.getString(Keys.web.forwardSlashCharacter, "/");\r
String encodedPath = document.replace(' ', '-');\r