private Attributes getAttributes() { Attributes attributes = new Attributes(); attributes.setAttribute("projectdir", new File(".").getAbsolutePath()); return attributes; }
@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")); }
/** * Sets custom or unlisted attribute to the default value, empty string. * * @param attributeName * A flag-only attribute, such as "icons" * @return this instance. */ public AttributesBuilder attribute(String attributeName) { this.attributes.setAttribute(attributeName, ""); return this; }
/** * Sets custom or unlisted attribute * * @param attributeName * @param attributeValue * @return this instance. */ public AttributesBuilder attribute(String attributeName, Object attributeValue) { this.attributes.setAttribute(attributeName, attributeValue); return this; }
/** * Sets custom or unlisted attribute to the default value, empty string. * * @param attributeName * A flag-only attribute, such as "icons" * @return this instance. */ public AttributesBuilder attribute(String attributeName) { this.attributes.setAttribute(attributeName, ""); return this; }
/** * Sets custom or unlisted attribute * * @param attributeName * @param attributeValue * @return this instance. */ public AttributesBuilder attribute(String attributeName, Object attributeValue) { this.attributes.setAttribute(attributeName, attributeValue); return this; }
/** * Sets custom or unlisted attribute to the default value, empty string. * * @param attributeName * A flag-only attribute, such as "icons" * @return this instance. */ public AttributesBuilder attribute(String attributeName) { this.attributes.setAttribute(attributeName, ""); return this; }
/** * Sets custom or unlisted attribute * * @param attributeName * @param attributeValue * @return this instance. */ public AttributesBuilder attribute(String attributeName, Object attributeValue) { this.attributes.setAttribute(attributeName, attributeValue); return this; }
public void setAttribute(String name, String value) { attributes.setAttribute(name, value); }