[英]create my own multily block in mylyn wiki text
我正在尋找一個如何擴展mylyn(獨立)wiki解析器的示例。 我想制作自己的多行塊即
%%%
my super text processed by my code
%%%
我試圖通過查看mylyn源代碼和搜索網絡來弄明白。 我真的不知道該怎么做。 文檔也不是很有幫助。 也許另一個圖書館對我的需求更好? 我只需要一個wiki-text到html解析器,我可以擴展它來嵌入我自己的東西。
我沒有讓mylyin使用自定義擴展。 任何對這種功能感興趣的人都切換到bliki,有一些例子如何擴展解析器: bliki 。
即:
public class SampleTag extends NowikiTag implements INoBodyParsingTag {
private final static String HEADER = "<div id=\"sample\">\n"
+ "<a href=\"#\" id=\"show\" onclick=\"$(\'evalframe\').show();$(\'hide\').show();$(\'show\').hide();\" />Show Sample</a> \n"
+ "<a href=\"#\" style=\"display: none;\" id=\"hide\" onclick=\"$(\'evalframe\').hide();;$(\'hide\').hide();$(\'show\').show();\" />Hide Sample</a><br />\n"
+ "<iframe src=\"";
private final static String FOOTER = "\" style=\"display: none;\" id=\"evalframe\" width=\"480\" height=\"160\" \n"
+ " scrolling=\"yes\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"1\">\n"
+ " <p>You browser doesn\'t support IFRAMEs</p>\n" + "</iframe>\n" + "</div>";
public SampleTag() {
super("sample");
}
@Override
public void renderHTML(ITextConverter converter, Appendable buf, IWikiModel model) throws IOException {
TagNode node = this;
Map<String, String> tagAtttributes = node.getAttributes();
StringBuilder evalUrl = new StringBuilder(512);
// sample input fields/textareas
Utils.appendAmpersandEscapedAttribute(evalUrl, "ci", tagAtttributes);
// sample actions
Utils.appendAmpersandEscapedAttribute(evalUrl, "ca", tagAtttributes);
buf.append(HEADER);
// URL points to http://matheclipse.org/eval.jsp
buf.append("../eval.jsp?");
buf.append(evalUrl);
// renderHTMLWithoutTag(converter, buf, model);
buf.append(FOOTER);
}
@Override
public boolean isReduceTokenStack() {
return true;
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.