You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/10/24 19:07:11 UTC
[1/3] lucene-solr:master: SOLR-11539: use page shortnames as explicit
anchors in generated pdf-main-body.adoc
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7_1 da1c5fa5a -> 2d8c34b31
refs/heads/branch_7x 4c5ce2d64 -> 1225c9dcc
refs/heads/master ea36f5040 -> ab388fa3a
SOLR-11539: use page shortnames as explicit anchors in generated pdf-main-body.adoc
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ab388fa3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ab388fa3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ab388fa3
Branch: refs/heads/master
Commit: ab388fa3a723ec59c80567c3c0448e16b985d20b
Parents: ea36f50
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Oct 24 11:57:20 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Oct 24 11:57:20 2017 -0700
----------------------------------------------------------------------
solr/solr-ref-guide/tools/BuildNavAndPDFBody.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ab388fa3/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
index 75638a9..b1f0cf3 100644
--- a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
+++ b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
@@ -103,7 +103,9 @@ public class BuildNavAndPDFBody {
}
previous.set(page);
-
+ // use an explicit anchor, since the auto-generated ID from the "title" might not match
+ // the shortname/filename
+ w.append("[[").append(page.shortname).append("]]\n");
// HACK: where this file actually lives will determine what we need here...
w.write("include::../");
w.write(page.file.getName());
@@ -223,6 +225,16 @@ public class BuildNavAndPDFBody {
Map<String,Object> attrs = header.getAttributes();
this.shortname = (String) attrs.get("page-shortname");
this.permalink = (String) attrs.get("page-permalink");
+
+ // TODO: SOLR-11531: we should eliminate these attributes and not depend on them in jekyll, ...
+ // ...but for now at least be sure they are consistent with the filename
+ if (! file.getName().equals(shortname + ".adoc") ) {
+ throw new RuntimeException(file + " has a mismatched shortname: " + shortname);
+ }
+ if (! permalink.equals(shortname + ".html") ) {
+ throw new RuntimeException(file + " has a mismatched permalink: " + permalink);
+ }
+
if (attrs.containsKey("page-children")) {
String kidsString = ((String) attrs.get("page-children")).trim();
[2/3] lucene-solr:branch_7x: SOLR-11539: use page shortnames as
explicit anchors in generated pdf-main-body.adoc
Posted by ho...@apache.org.
SOLR-11539: use page shortnames as explicit anchors in generated pdf-main-body.adoc
(cherry picked from commit ab388fa3a723ec59c80567c3c0448e16b985d20b)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1225c9dc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1225c9dc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1225c9dc
Branch: refs/heads/branch_7x
Commit: 1225c9dcc610c2bce55e6f8c09308c6af378fe66
Parents: 4c5ce2d
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Oct 24 11:57:20 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Oct 24 11:57:34 2017 -0700
----------------------------------------------------------------------
solr/solr-ref-guide/tools/BuildNavAndPDFBody.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1225c9dc/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
index 75638a9..b1f0cf3 100644
--- a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
+++ b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
@@ -103,7 +103,9 @@ public class BuildNavAndPDFBody {
}
previous.set(page);
-
+ // use an explicit anchor, since the auto-generated ID from the "title" might not match
+ // the shortname/filename
+ w.append("[[").append(page.shortname).append("]]\n");
// HACK: where this file actually lives will determine what we need here...
w.write("include::../");
w.write(page.file.getName());
@@ -223,6 +225,16 @@ public class BuildNavAndPDFBody {
Map<String,Object> attrs = header.getAttributes();
this.shortname = (String) attrs.get("page-shortname");
this.permalink = (String) attrs.get("page-permalink");
+
+ // TODO: SOLR-11531: we should eliminate these attributes and not depend on them in jekyll, ...
+ // ...but for now at least be sure they are consistent with the filename
+ if (! file.getName().equals(shortname + ".adoc") ) {
+ throw new RuntimeException(file + " has a mismatched shortname: " + shortname);
+ }
+ if (! permalink.equals(shortname + ".html") ) {
+ throw new RuntimeException(file + " has a mismatched permalink: " + permalink);
+ }
+
if (attrs.containsKey("page-children")) {
String kidsString = ((String) attrs.get("page-children")).trim();
[3/3] lucene-solr:branch_7_1: SOLR-11539: use page shortnames as
explicit anchors in generated pdf-main-body.adoc
Posted by ho...@apache.org.
SOLR-11539: use page shortnames as explicit anchors in generated pdf-main-body.adoc
(cherry picked from commit ab388fa3a723ec59c80567c3c0448e16b985d20b)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2d8c34b3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2d8c34b3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2d8c34b3
Branch: refs/heads/branch_7_1
Commit: 2d8c34b316c3ec655e073daab812644c24a09d0b
Parents: da1c5fa
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Oct 24 11:57:20 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Oct 24 12:01:24 2017 -0700
----------------------------------------------------------------------
solr/solr-ref-guide/tools/BuildNavAndPDFBody.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2d8c34b3/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
index 75638a9..b1f0cf3 100644
--- a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
+++ b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
@@ -103,7 +103,9 @@ public class BuildNavAndPDFBody {
}
previous.set(page);
-
+ // use an explicit anchor, since the auto-generated ID from the "title" might not match
+ // the shortname/filename
+ w.append("[[").append(page.shortname).append("]]\n");
// HACK: where this file actually lives will determine what we need here...
w.write("include::../");
w.write(page.file.getName());
@@ -223,6 +225,16 @@ public class BuildNavAndPDFBody {
Map<String,Object> attrs = header.getAttributes();
this.shortname = (String) attrs.get("page-shortname");
this.permalink = (String) attrs.get("page-permalink");
+
+ // TODO: SOLR-11531: we should eliminate these attributes and not depend on them in jekyll, ...
+ // ...but for now at least be sure they are consistent with the filename
+ if (! file.getName().equals(shortname + ".adoc") ) {
+ throw new RuntimeException(file + " has a mismatched shortname: " + shortname);
+ }
+ if (! permalink.equals(shortname + ".html") ) {
+ throw new RuntimeException(file + " has a mismatched permalink: " + permalink);
+ }
+
if (attrs.containsKey("page-children")) {
String kidsString = ((String) attrs.get("page-children")).trim();