org.asciidoctor.Options Maven / Gradle / Ivy
package org.asciidoctor;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Options {
public static final String IN_PLACE = "in_place";
public static final String ATTRIBUTES = "attributes";
public static final String HEADER_FOOTER = "header_footer";
public static final String TEMPLATE_DIRS = "template_dirs";
public static final String TEMPLATE_ENGINE = "template_engine";
public static final String TO_FILE = "to_file";
public static final String TO_DIR = "to_dir";
public static final String MKDIRS = "mkdirs";
public static final String SAFE = "safe";
public static final String SOURCEMAP = "sourcemap";
public static final String STANDALONE = "standalone";
public static final String ERUBY = "eruby";
public static final String CATALOG_ASSETS = "catalog_assets";
public static final String COMPACT = "compact";
public static final String DESTINATION_DIR = "destination_dir";
public static final String SOURCE_DIR = "source_dir";
public static final String BACKEND = "backend";
public static final String DOCTYPE = "doctype";
public static final String BASEDIR = "base_dir";
public static final String TEMPLATE_CACHE = "template_cache";
public static final String SOURCE = "source";
public static final String PARSE = "parse";
public static final String PARSE_HEADER_ONLY = "parse_header_only";
private Map options = new HashMap<>();
/**
* @deprecated Use {@link Options#builder()} instead.
*/
@Deprecated
public Options() {
super();
}
/**
* @deprecated Use {@link Options#builder()} instead.
*/
@Deprecated
public Options(Map options) {
this.options = options;
}
/**
* @return Empty OptionsBuilder instance.
*/
public static OptionsBuilder builder() {
return new OptionsBuilder();
}
public void setInPlace(boolean inPlace) {
this.options.put(IN_PLACE, inPlace);
}
public void setAttributes(Attributes attributes) {
this.options.put(ATTRIBUTES, attributes.map());
}
public void setAttributes(Map attributes) {
this.options.put(ATTRIBUTES, attributes);
}
/**
* Toggle including header and footer into the output.
*
* @param standalone true
to generate a standalone output document
* (which includes the shell around the body content, such
* as the header and footer).
* Defaults to true
when converting a file only,
* otherwise is false
.
*/
public void setStandalone(boolean standalone) {
this.options.put(STANDALONE, standalone);
}
/**
* Toggle including header and footer into the output.
*
* @param headerFooter If true, include header and footer into the output,
* otherwise exclude them. This overrides any output-specific defaults.
*
*/
public void setHeaderFooter(boolean headerFooter) {
this.options.put(HEADER_FOOTER, headerFooter);
}
public void setTemplateDirs(String... templateDirs) {
if (!this.options.containsKey(TEMPLATE_DIRS)) {
this.options.put(TEMPLATE_DIRS, new ArrayList<>());
}
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy