Skip to content

Commit

Permalink
Leave asciidoc attributes as default wherever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewesweet authored and rmpestano committed Apr 13, 2021
1 parent a58fb5c commit 4b94d1d
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 111 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void shouldSaveDocumentationIntoDisk(){
DocumentAttributes attrs = GlobalConfig.getInstance().getDocumentAttributes;
attrs.toc("left").backend("html5")
.docType("book")
.icons("font").numbered(false)
.icons("font")
.sourceHighlighter("coderay")
.docTitle("Documentation Title")
.sectAnchors(true).sectLink(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DocumentAttributes {
private String versionLabel = "Version";
private String stem = null;
private Boolean allowUriRead = null;
private Boolean dataUri = false;
private Boolean dataUri = null;

public DocumentAttributes() {
}
Expand Down Expand Up @@ -139,7 +139,7 @@ public DocumentAttributes allowUriRead(Boolean allowUriRead) {
return this;
}

public DocumentAttributes dataUri(boolean dataUri) {
public DocumentAttributes dataUri(Boolean dataUri) {
this.dataUri = dataUri;
return this;
}
Expand Down Expand Up @@ -304,7 +304,9 @@ public void setAllowUriRead(Boolean allowUriRead) {
this.allowUriRead = allowUriRead;
}

public void setDataUri(boolean dataUri) { this.dataUri = dataUri; }
public void setDataUri(Boolean dataUri) {
this.dataUri = dataUri;
}

public Map<String, Object> toMap() {
return createAttributesMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ public AttributesBuilder allowUriRead(Boolean value) {

@Override
public AttributesBuilder dataUri(Boolean value) {
if (value != null && value) {
docBuilder.textLine(Constants.Attributes.dataUri(true));
if (value != null) {
docBuilder.textLine(Constants.Attributes.dataUri(value));
}

return this;
}

Expand Down
2 changes: 0 additions & 2 deletions cukedoctor-converter/src/main/resources/config/cukedoctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ documentAttributes:
toc: "right"
icons: "font"
tocLevels: 3
linkCss: false
sectAnchors: true
sectLink: true
numbered: false
docInfo: true
pdfStyle:
sourceHighlighter: "highlightjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public void shouldGeneratePdfTheme() {
":doctitle: Living Documentation" + newLine() +
":doctype: book" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand Down Expand Up @@ -145,7 +143,7 @@ public void shouldRenderDocumentationForOneFeature() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand Down Expand Up @@ -174,7 +172,7 @@ public void shouldRenderDocumentationForMultipleFeatures() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand Down Expand Up @@ -206,7 +204,7 @@ public void shouldRenderDocumentationWithoutFeaturesSection() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand Down Expand Up @@ -236,7 +234,7 @@ public void shouldRenderDocumentationWithoutFeaturesAndSummarySection() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter");

Expand All @@ -263,7 +261,7 @@ public void shouldRenderDocumentationWithoutScenarioKeyword() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand All @@ -283,7 +281,7 @@ public void shouldRenderDocumentationWithoutStepTime() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand All @@ -304,7 +302,7 @@ public void shouldRenderDocumentationWithoutTags() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("left").backend("html5")
.docType("book").docTitle("Living Documentation")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void shouldRenderAttributes() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("right").backend("html5")
.docType("article").docTitle("Title")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand All @@ -31,8 +31,6 @@ public void shouldRenderAttributes() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -52,8 +50,6 @@ public void shouldRenderAttributesUsingDefaultConfig() {
":doctitle: Living Documentation" + newLine() +
":doctype: book" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -72,8 +68,6 @@ public void shouldRenderAttributesUsingGlobalConfig() {
":doctitle: Living Documentation" + newLine() +
":doctype: book" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand Down Expand Up @@ -102,7 +96,7 @@ public void shouldRenderAttributesWithoutToc() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("").backend("html5")
.docType("article").docTitle("Title")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand All @@ -112,8 +106,6 @@ public void shouldRenderAttributesWithoutToc() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -130,7 +122,7 @@ public void shouldRenderAttributesWithoutHardbreaks() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("").backend("html5")
.docType("article").docTitle("Title")
.icons("font").numbered(false)
.icons("font")
.hardBreaks(false)
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter");
Expand All @@ -140,8 +132,6 @@ public void shouldRenderAttributesWithoutHardbreaks() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -158,7 +148,7 @@ public void shouldRenderAttributesWithTocLevels2() {
DocumentAttributes attrs = new DocumentAttributes();
attrs.toc("").backend("html5")
.docType("article").docTitle("Title")
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.tocLevels("2")
.chapterLabel("Chapter")
Expand All @@ -170,8 +160,6 @@ public void shouldRenderAttributesWithTocLevels2() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -191,7 +179,7 @@ public void shouldUseDocumentationTitleAsDocTitleAttribute() {
attrs.toc("right").backend("html5")
.docType("book").docTitle("Documentation Title")
.linkCss(true)
.icons("font").numbered(false)
.icons("font")
.sectAnchors(true).sectLink(true)
.chapterLabel("Chapter")
.versionLabel("Version");
Expand All @@ -202,7 +190,6 @@ public void shouldUseDocumentationTitleAsDocTitleAttribute() {
":doctitle: Documentation Title" + newLine() +
":doctype: book" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
Expand All @@ -226,7 +213,6 @@ public void shouldRenderStemAttribute() {
.docType("article")
.docTitle("Title")
.icons("font")
.numbered(false)
.sectAnchors(true)
.sectLink(true)
.chapterLabel("Chapter")
Expand All @@ -238,8 +224,6 @@ public void shouldRenderStemAttribute() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -263,7 +247,6 @@ public void shouldRenderAllowUriAttribute() {
.docType("article")
.docTitle("Title")
.icons("font")
.numbered(false)
.sectAnchors(true)
.sectLink(true)
.allowUriRead(true)
Expand All @@ -276,8 +259,6 @@ public void shouldRenderAllowUriAttribute() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -302,7 +283,6 @@ public void shouldDisableAllowUriAttribute() {
.docType("article")
.docTitle("Title")
.icons("font")
.numbered(false)
.sectAnchors(true)
.sectLink(true)
.allowUriRead(false)
Expand All @@ -315,8 +295,6 @@ public void shouldDisableAllowUriAttribute() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -341,7 +319,6 @@ public void shouldNotRenderAllowUriAttribute() {
.docType("article")
.docTitle("Title")
.icons("font")
.numbered(false)
.sectAnchors(true)
.sectLink(true)
.chapterLabel("Chapter")
Expand All @@ -353,8 +330,6 @@ public void shouldNotRenderAllowUriAttribute() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -377,8 +352,6 @@ public void shouldRenderDocumentationHeader() {
":doctitle: Living Documentation" + newLine() +
":doctype: book" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -398,7 +371,6 @@ public void shouldRenderDataUriAttributeIfDataUriSet() {
.docType("article")
.docTitle("Title")
.icons("font")
.numbered(false)
.sectAnchors(true)
.sectLink(true)
.chapterLabel("Chapter")
Expand All @@ -410,8 +382,6 @@ public void shouldRenderDataUriAttributeIfDataUriSet() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand All @@ -435,7 +405,6 @@ public void shouldNotRenderDataUriAttributeIfDataUriNotSet() {
.docType("article")
.docTitle("Title")
.icons("font")
.numbered(false)
.sectAnchors(true)
.sectLink(true)
.chapterLabel("Chapter")
Expand All @@ -447,8 +416,6 @@ public void shouldNotRenderDataUriAttributeIfDataUriNotSet() {
":doctitle: Title" + newLine() +
":doctype: article" + newLine() +
":icons: font" + newLine() +
":!numbered:" + newLine() +
":!linkcss:" + newLine() +
":sectanchors:" + newLine() +
":sectlink:" + newLine() +
":docinfo:" + newLine() +
Expand Down
Loading

0 comments on commit 4b94d1d

Please sign in to comment.