本文整理汇总了Java中org.markdownj.MarkdownProcessor类的典型用法代码示例。如果您正苦于以下问题:Java MarkdownProcessor类的具体用法?Java MarkdownProcessor怎么用?Java MarkdownProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MarkdownProcessor类属于org.markdownj包,在下文中一共展示了MarkdownProcessor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: viewMarkdown
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
private void viewMarkdown()
{
MarkdownProcessor mark = new MarkdownProcessor();
String text = textView.getText().toString();
String html = mark.markdown(text);
try
{
File file = new File(getExternalCacheDir(), HTML_FILE);
file.deleteOnExit();
FileWriter writer = new FileWriter(file);
writer.write(html);
writer.close();
Uri uri = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, TEXT_HTML);
startActivity(intent);
}
catch (Exception e) {}
}
开发者ID:billthefarmer,项目名称:editor,代码行数:24,代码来源:Editor.java
示例2: onRepoContentLoaded
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
@Override
public void onRepoContentLoaded(String content) {
Log.v(TAG, "onRepoContentLoaded");
Log.v(TAG, "content " + content);
if (content != null) {
Log.v(TAG, "if content " + content);
MarkdownProcessor processor = new MarkdownProcessor();
String html = processor.markdown(content);
mv.setVisibility(View.VISIBLE);
mv.loadData(html, "text/html; charset=UTF-8", null);
}
}
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:13,代码来源:RepositoryActivity.java
示例3: getContent
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
@Override
public String getContent()
{
String css = cssDocument.getContent();
String markdown = markdownDocument.getContent();
String title = MarkdownUtils.getTitleFromMarkdown(markdown);
String body = new MarkdownProcessor().markdown(markdown);
return String.format(HTML_FORMAT, title, css, body);
}
开发者ID:silare,项目名称:Scratchpad,代码行数:10,代码来源:WebDocument.java
示例4: useMarkDownJ
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
private String useMarkDownJ(String text) {
MarkdownProcessor markdown = new MarkdownProcessor();
return markdown.markdown(text);
}
开发者ID:grosenberg,项目名称:fluentmark,代码行数:5,代码来源:FluentMkConverter.java
示例5: getReadmeHtml
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
public String getReadmeHtml() {
MarkdownProcessor processor = new MarkdownProcessor();
return processor.markdown(this.getReadme());
}
开发者ID:geops,项目名称:trafimage-geoserver-transformations,代码行数:5,代码来源:TrafimageTransformInfo.java
示例6: performLoad
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
@Override protected List<DisplayItem> performLoad() {
List<DisplayItem> tmp = new ArrayList<>();
List<CDAField> fields = contentType.fields();
MarkdownProcessor processor = new MarkdownProcessor();
// Iterate Entry fields
for (CDAField f : fields) {
String id = f.id();
Object value = entry.getField(id);
// Skip if the value is empty
if (value == null) {
continue;
}
// Construct a new DisplayItem
DisplayItem displayItem = new DisplayItem();
// CDAFieldType of this item
displayItem.fieldType = f.type();
// Original field ID (from Content Type)
displayItem.key = id;
if ("Text".equals(displayItem.fieldType)) {
prepareTextItem(displayItem, value, processor);
} else if ("Link".equals(displayItem.fieldType)) {
prepareLinkItem(displayItem, value);
} else if ("Location".equals(displayItem.fieldType)) {
prepareLocationItem(displayItem, value);
} else if ("Array".equals(displayItem.fieldType)) {
prepareArrayItem(displayItem, value, f.items());
} else {
prepareDefaultItem(displayItem, value);
}
tmp.add(displayItem);
}
return tmp;
}
开发者ID:contentful,项目名称:discovery-app-android,代码行数:43,代码来源:EntryPreviewLoader.java
示例7: prepareTextItem
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
/**
* Prepares item of type {@code Text}.
*/
private void prepareTextItem(DisplayItem displayItem, Object value, MarkdownProcessor processor) {
displayItem.displayValue = TextProcessorLoader.wrapHtml(processor.markdown((String) value));
}
开发者ID:contentful,项目名称:discovery-app-android,代码行数:7,代码来源:EntryPreviewLoader.java
示例8: performLoad
import org.markdownj.MarkdownProcessor; //导入依赖的package包/类
@Override protected String performLoad() {
return wrapHtml(new MarkdownProcessor().markdown(text));
}
开发者ID:contentful,项目名称:discovery-app-android,代码行数:4,代码来源:TextProcessorLoader.java
注:本文中的org.markdownj.MarkdownProcessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论