@Before public void setUp() { this.options.setAttributes(getAttributes()); }
@Test public void operationWithParameterizedName() throws Exception { Attributes attributes = getAttributes(); attributes.setAttribute("name", "some"); this.options.setAttributes(attributes); String result = this.asciidoctor.convert( "operation::{name}-operation[snippets='curl-request']", this.options); assertThat(result).isEqualTo(getExpectedContentFromFile("snippet-simple")); }
@Test public void snippetsAttributeIsSet() { Options options = new Options(); options.setAttributes(new Attributes("projectdir=../../..")); String converted = Asciidoctor.Factory.create().convert("{snippets}", options); assertThat(converted) .contains("build" + File.separatorChar + "generated-snippets"); }
@Test public void snippetsAttributeFromConvertArgumentIsNotOverridden() { Options options = new Options(); options.setAttributes(new Attributes("snippets=custom projectdir=../../..")); String converted = Asciidoctor.Factory.create().convert("{snippets}", options); assertThat(converted).contains("custom"); }
@Test public void snippetsAttributeFromDocumentPreambleIsNotOverridden() { Options options = new Options(); options.setAttributes(new Attributes("projectdir=../../..")); String converted = Asciidoctor.Factory.create() .convert(":snippets: custom\n{snippets}", options); assertThat(converted).contains("custom"); }
/** * Sets attributes used for rendering input. * * @param attributes * map. * @return this instance. */ public OptionsBuilder attributes(Map<String, Object> attributes) { this.options.setAttributes(attributes); return this; }
/** * Sets attributes used for rendering input. * @param attributes map. * @return this instance. */ public OptionsBuilder attributes(Map<String, Object> attributes) { this.options.setAttributes(attributes); return this; }
/** * Sets attributes used for rendering input. * * @param attributes * map. * @return this instance. */ public OptionsBuilder attributes(Map<String, Object> attributes) { this.options.setAttributes(attributes); return this; }
/** * Sets attributes used for rendering input. * * @param attributes * map. * @return this instance. */ public OptionsBuilder attributes(Attributes attributes) { this.options.setAttributes(attributes.map()); return this; }
/** * Sets attributes used for rendering input. * * @param attributes * builder. * @return this instance. */ public OptionsBuilder attributes(AttributesBuilder attributes) { this.options.setAttributes(attributes.asMap()); return this; }
/** * Sets attributes used for rendering input. * @param attributes map. * @return this instance. */ public OptionsBuilder attributes(Attributes attributes) { this.options.setAttributes(attributes.map()); return this; }
/** * Sets attributes used for rendering input. * * @param attributes * map. * @return this instance. */ public OptionsBuilder attributes(Attributes attributes) { this.options.setAttributes(attributes.map()); return this; }
/** * Sets attributes used for rendering input. * * @param attributes * builder. * @return this instance. */ public OptionsBuilder attributes(AttributesBuilder attributes) { this.options.setAttributes(attributes.asMap()); return this; }
public String toHtml(String text) { // Create the options: Options options = new Options(); options.setAttributes(configuration.getAttributes()); // Perform the rendering: return doctor.convert(text, options); } }
private Options getOptions() { Options options = new Options(); options.setCompact(true); options.setDocType("inline"); Attributes attributes = new Attributes(); attributes.setExperimental(true); attributes.setDataUri(true); options.setAttributes(attributes); return options; } }
private Options getOptions() { Options options = new Options(); options.setCompact(true); options.setDocType("inline"); Attributes attributes = new Attributes(); attributes.setExperimental(true); attributes.setDataUri(true); options.setAttributes(attributes); return options; } }
private Options getOptions() { Options options = new Options(); options.setCompact(true); options.setDocType("inline"); Attributes attributes = new Attributes(); attributes.setExperimental(true); attributes.setDataUri(true); options.setAttributes(attributes); return options; } }
options.setTemplateEngine(template_engine); if (attributes != null) options.setAttributes(attributes);