Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jgitVersion = 6.0.0.202111291000-r
logbackVersion = 1.2.10
orientDbVersion = 3.1.20
pebbleVersion = 3.1.5
reflectionsVersion = 0.10.2
slf4jVersion = 1.7.32
snakeYamlVersion = 1.30
thymeleafVersion = 3.0.14.RELEASE
Expand Down
11 changes: 11 additions & 0 deletions jbake-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
exclude group: "junit", module: "junit"
}
implementation "com.orientechnologies:orientdb-core:$orientDbVersion"
implementation "org.reflections:reflections:$reflectionsVersion"
api "org.asciidoctor:asciidoctorj:$asciidoctorjVersion", optional
api "org.codehaus.groovy:groovy:$groovyVersion", optional
api "org.codehaus.groovy:groovy-templates:$groovyVersion", optional
Expand All @@ -47,6 +48,16 @@ dependencies {
api "org.thymeleaf:thymeleaf:$thymeleafVersion", optional
api "de.neuland-bfi:jade4j:$jade4jVersion", optional
api "com.vladsch.flexmark:flexmark:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-attributes:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-admonition:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-aside:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-emoji:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-enumerated-reference:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-gfm-issues:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-gfm-strikethrough", optional
api "com.vladsch.flexmark:flexmark-ext-gfm-tasklist", optional
api "com.vladsch.flexmark:flexmark-ext-gfm-users:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-ext-gitlab:$flexmarkVersion", optional
api "com.vladsch.flexmark:flexmark-profile-pegdown:$flexmarkVersion", optional
api "io.pebbletemplates:pebble:$pebbleVersion", optional
implementation "org.jsoup:jsoup:$jsoupVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,29 @@ public List<String> getMarkdownExtensions() {
public void setMarkdownExtensions(String... extensions) {
setProperty(MARKDOWN_EXTENSIONS.getKey(), StringUtils.join(extensions, ","));
}

@Override
public Map<String, String> getMarkdownOptions() {
Map<String, String> options = new HashMap<String, String>();
List<String> optionsList = getAsList(MARKDOWN_OPTIONS.getKey());

if(null != optionsList) {
for (String optionAndValue : optionsList) {
String[] splited = optionAndValue.split("=(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)", -1);
if(splited.length == 2) {
options.put(splited[0], splited[1]);
}else {
logger.warn("Not valid MarkDown Option '{}' no '=' String to delimit name and value", optionAndValue);
}
}
}

return options;
}

public void setMarkdownOptions(String... extensions) {
setProperty(MARKDOWN_OPTIONS.getKey(), StringUtils.join(extensions, ","));
}

@Override
public String getOutputExtension() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,24 @@ public interface JBakeConfiguration {
* @return an iterator of configuration keys
*/
Iterator<String> getKeys();

/**
* A list of markdown extensions
* A list of markdown options for extension or Parser
* <p>
* <code>markdown.extension=HARDWRAPS,AUTOLINKS,FENCED_CODE_BLOCKS,DEFINITIONS</code>
*
* @return list of markdown extensions as string
* @return list of markdown options as string
*/
List<String> getMarkdownExtensions();

/**
* A list of markdown extensions
* <p>
* <code>markdown.options=ROOT_IMAGE_PATH=/images/emoji,AN_OTHER_OPTION=true</code>
*
* @return list of markdown extensions as key => value
*/
Map<String, String> getMarkdownOptions();

/**
* @return file extension to be used for all output files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public abstract class PropertyList {
"markdown.extensions",
"comma delimited default markdown extensions; for available extensions: http://www.decodified.com/pegdown/api/org/pegdown/Extensions.html"
);

public static final Property MARKDOWN_OPTIONS = new Property(
"markdown.options",
"comma delimited markdown options; for information for options : https://github.com/vsch/flexmark-java/wiki/Extensions"
);

public static final Property OUTPUT_ENCODING = new Property(
"freemarker.outputencoding",
Expand Down
Loading