You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2019/09/04 21:02:02 UTC

[camel] 08/16: CAMEL-13798: code changes to re-level headings

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2c84b02606a795c3dae314a44ed403f8f01642fc
Author: Zoran Regvart <zr...@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.
    
    (cherry picked from commit 48d8a526399e5726c28b22e533f5d35126330ebd)
    
    # Conflicts:
    #	docs/gulpfile.js
---
 .../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 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

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 9ebcd443..992b0ca 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
@@ -436,7 +436,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;
@@ -444,7 +444,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;
@@ -508,7 +508,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{}