Repository: camel
Updated Branches:
  refs/heads/master 92da4bf49 -> 598272590


CAMEL-10655: Camel catalog - Include html copies of adoc documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/59827259
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/59827259
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/59827259

Branch: refs/heads/master
Commit: 5982725902209f06c8abdc1aaf704dad34a5d3d4
Parents: 92da4bf
Author: Claus Ibsen <[email protected]>
Authored: Wed Dec 28 18:00:57 2016 +0100
Committer: Claus Ibsen <[email protected]>
Committed: Wed Dec 28 18:00:57 2016 +0100

----------------------------------------------------------------------
 .../camel/maven/packaging/PrepareCatalogMojo.java | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/59827259/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
----------------------------------------------------------------------
diff --git 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
index 4b610f9..74cf646 100644
--- 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
+++ 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
@@ -830,6 +830,24 @@ public class PrepareCatalogMojo extends AbstractMojo {
                 asciidoctor.convertFile(file, 
OptionsBuilder.options().toFile(toHtml));
 
                 converted++;
+
+                try {
+                    // now fix the html file because we don't want to include 
certain lines
+                    List<String> lines = FileUtils.readLines(toHtml);
+                    List<String> output = new ArrayList<>();
+                    for (String line : lines) {
+                        // skip these lines
+                        if (line.contains("% raw %") || line.contains("% 
endraw %")) {
+                            continue;
+                        }
+                        output.add(line);
+                    }
+                    if (lines.size() != output.size()) {
+                        FileUtils.writeLines(toHtml, output, false);
+                    }
+                } catch (IOException e) {
+                    // ignore
+                }
             }
         }
 

Reply via email to