This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 48d8a526399e5726c28b22e533f5d35126330ebd Author: Zoran Regvart <zregv...@apache.org> AuthorDate: Mon Jul 29 17:16:57 2019 +0200 CAMEL-13798: code changes to re-level headings Unless we start the document with a level 1 heading the document's title when rendered as HTML will be `Untitled`. This includes just the code changes in the camel-package Maven plugin needed to re-level headings. Till now we started at level 2 headings so ll headings have been decreased by one. --- docs/gulpfile.js | 4 ++-- .../java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java | 6 +++--- .../src/main/resources/endpoint-options.mvel | 4 ++-- .../src/main/resources/spring-boot-auto-configure-options.mvel | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/gulpfile.js b/docs/gulpfile.js index 900c920..810ce72 100644 --- a/docs/gulpfile.js +++ b/docs/gulpfile.js @@ -68,9 +68,9 @@ function createUserManualSymlinks() { } function titleFrom(file) { - const maybeName = /(?:==|##) (.*)/.exec(file.contents.toString()) + const maybeName = /(?:=|#) (.*)/.exec(file.contents.toString()) if (maybeName == null) { - throw new Error(`${file.path} doesn't contain Asciidoc heading ('== <Title>') or ('## <Title')`); + throw new Error(`${file.path} doesn't contain Asciidoc heading ('= <Title>') or ('# <Title')`); } return maybeName[1]; diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java index b6ef434..f935145 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java @@ -435,7 +435,7 @@ public class UpdateReadmeMojo extends AbstractMojo { if (i == 1) { // first line is the title to make the text less noisy we use level 2 - String newLine = "== " + title; + String newLine = "= " + title; newLines.add(newLine); updated = !line.equals(newLine); continue; @@ -443,7 +443,7 @@ public class UpdateReadmeMojo extends AbstractMojo { // use single line headers with # as level instead of the cumbersome adoc weird style if (line.startsWith("^^^") || line.startsWith("~~~") || line.startsWith("+++")) { - String level = line.startsWith("+++") ? "====" : "==="; + String level = line.startsWith("+++") ? "===" : "=="; // transform legacy heading into new style int idx = newLines.size() - 1; @@ -507,7 +507,7 @@ public class UpdateReadmeMojo extends AbstractMojo { newLines.addAll(Arrays.asList(lines)); // check the first four lines - boolean title = lines[1].startsWith("##") || lines[1].startsWith("=="); + boolean title = lines[1].startsWith("#") || lines[1].startsWith("="); boolean empty = lines[2].trim().isEmpty(); boolean availableFrom = lines[3].trim().contains("Available as of") || lines[3].trim().contains("Available in"); boolean empty2 = lines[4].trim().isEmpty(); diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel index 1c9e33b..52be028 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel @@ -6,7 +6,7 @@ The @{title} endpoint is configured using URI syntax: with the following path and query parameters: -==== Path Parameters (@{endpointPathOptions.size()} parameters): +=== Path Parameters (@{endpointPathOptions.size()} parameters): @if{endpointPathOptions.isEmpty()} The @{title} endpoint has no path parameters. @@ -18,7 +18,7 @@ The @{title} endpoint has no path parameters. @end{}|=== @end{} -==== Query Parameters (@{endpointOptions.size()} parameters): +=== Query Parameters (@{endpointOptions.size()} parameters): @if{endpointOptions.isEmpty()} The @{title} endpoint has no query parameters. diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-auto-configure-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-auto-configure-options.mvel index 690708d..77a93a0 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-auto-configure-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-auto-configure-options.mvel @@ -1,4 +1,4 @@ -=== Spring Boot Auto-Configuration +== Spring Boot Auto-Configuration When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration: @@ -24,4 +24,4 @@ The component supports @{options.size()} options, which are listed below. | Name | Description | Default | Type @foreach{row : options}| *@{row.name}* | @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} @end{}|=== -@end{} \ No newline at end of file +@end{}