本文整理汇总了Java中com.github.rjeschke.txtmark.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于com.github.rjeschke.txtmark包,在下文中一共展示了Configuration类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: useTxtMark
import com.github.rjeschke.txtmark.Configuration; //导入依赖的package包/类
private String useTxtMark(String text) {
boolean safeMode = store.getBoolean(Prefs.EDITOR_TXTMARK_SAFEMODE);
boolean extended = store.getBoolean(Prefs.EDITOR_TXTMARK_EXTENDED);
boolean dotMode = store.getBoolean(Prefs.EDITOR_DOTMODE_ENABLED);
Builder builder = Configuration.builder();
if (safeMode) builder.enableSafeMode();
if (extended || dotMode) builder.forceExtentedProfile();
if (dotMode) builder.setCodeBlockEmitter(emitter);
Configuration config = builder.build();
return Processor.process(text, config);
}
示例2: getBody
import com.github.rjeschke.txtmark.Configuration; //导入依赖的package包/类
private String getBody(String filepath) throws IOException {
if(filepath.startsWith("file:///android_asset")) {
String fileName = filepath.substring(filepath.lastIndexOf('/')+1);
InputStream inputStream = getContext().getAssets().open(fileName);
return Processor.process(inputStream, Configuration.builder().forceExtentedProfile().build());
} else {
File file = new File(filepath);
return Processor.process(file, Configuration.builder().forceExtentedProfile().build());
}
}
示例3: Parser
import com.github.rjeschke.txtmark.Configuration; //导入依赖的package包/类
/**
* creates a parser with configuration set to enable safe mode HTML with
* extended profile from txtmark, allowing spaces in fenced code blocks and
* encoding set to UTF-8.
*
* @throws java.io.IOException the exception
*/
public Parser() throws IOException {
indexer = new Indexer();
renderer = new HandlebarsRenderer();
renderConfig = Configuration.builder().enableSafeMode()
.forceExtentedProfile()
.setAllowSpacesInFencedCodeBlockDelimiters(true)
.setEncoding("UTF-8")
.setCodeBlockEmitter(new CodeBlockEmitter())
.build();
indexer.initIndexes();
}
示例4: setSite
import com.github.rjeschke.txtmark.Configuration; //导入依赖的package包/类
@Override
public void setSite(Site site) {
this.highlighter = site.getFactory().getHighlighter();
if (this.highlighter == null) {
log.warn("This converter might be need a Highlighter.");
} else {
config = Configuration.builder()
.setCodeBlockEmitter(new BlockEmitterImpl(highlighter))
.forceExtentedProfile()
.build();
}
}
示例5: builder
import com.github.rjeschke.txtmark.Configuration; //导入依赖的package包/类
protected Builder builder() {
decorator = new ExtDecorator();
return Configuration.builder().forceExtentedProfile().convertNewline2Br().registerPlugins(new YumlPlugin()).setDecorator(decorator)
.setCodeBlockEmitter(codeBlockEmitter()).setSpecialLinkEmitter(spanEmitter()).setEmojiEmitter(emojiEmitter());
}
示例6: builder
import com.github.rjeschke.txtmark.Configuration; //导入依赖的package包/类
private Builder builder() {
decorator = new ExtDecorator();
return Configuration.builder().forceExtentedProfile().registerPlugins(new YumlPlugin(), new WebSequencePlugin(), new IncludePlugin()).convertNewline2Br().setDecorator(decorator).setCodeBlockEmitter(new CodeBlockEmitter());
}