lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject [1/3] lucene-solr:jira/solr-10290: SOLR-10640: change the html page layout to include an id with teh page shortname (just like the pdf effectively does) and remove the HACK in CheckLinksAndAnchors that faked this
Date Tue, 09 May 2017 21:05:18 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-10290 96058f824 -> 296c2f48e


SOLR-10640: change the html page layout to include an id with teh page shortname (just like
the pdf effectively does) and remove the HACK in CheckLinksAndAnchors that faked this

only one page had a dup anchor that needed fixed as a result


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

Branch: refs/heads/jira/solr-10290
Commit: add32b39ff051330c99f1ec8bc04cc3c4144a061
Parents: 96058f8
Author: Chris Hostetter <hossman@apache.org>
Authored: Tue May 9 13:47:28 2017 -0700
Committer: Chris Hostetter <hossman@apache.org>
Committed: Tue May 9 13:47:28 2017 -0700

----------------------------------------------------------------------
 solr/solr-ref-guide/src/_layouts/page.html      |  2 +-
 solr/solr-ref-guide/src/installing-solr.adoc    |  1 +
 .../tools/CheckLinksAndAnchors.java             | 25 ++++----------------
 3 files changed, 6 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/add32b39/solr/solr-ref-guide/src/_layouts/page.html
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/_layouts/page.html b/solr/solr-ref-guide/src/_layouts/page.html
index 8c8f94e..5818cdb 100755
--- a/solr/solr-ref-guide/src/_layouts/page.html
+++ b/solr/solr-ref-guide/src/_layouts/page.html
@@ -38,7 +38,7 @@ layout: default
     {% include toc.html %}
     {% endunless %}
 
-<div id="main-content">
+<div id="{{ page.shortname }}" class="main-content">
   {{content}}
 </div>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/add32b39/solr/solr-ref-guide/src/installing-solr.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/installing-solr.adoc b/solr/solr-ref-guide/src/installing-solr.adoc
index 44a7993..e38a2d6 100644
--- a/solr/solr-ref-guide/src/installing-solr.adoc
+++ b/solr/solr-ref-guide/src/installing-solr.adoc
@@ -20,6 +20,7 @@ Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
 
 The exact output will vary, but you need to make sure you meet the minimum version requirement.
We also recommend choosing a version that is not end-of-life from its vendor. If you don't
have the required version, or if the java command is not found, download and install the latest
version from Oracle at http://www.oracle.com/technetwork/java/javase/downloads/index.html.
 
+[[install-command]]
 == Installing Solr
 
 Solr is available from the Solr website at http://lucene.apache.org/solr/.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/add32b39/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java b/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
index 9d9daeb..6bdf218 100644
--- a/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
+++ b/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
@@ -42,6 +42,8 @@ import org.jsoup.select.NodeVisitor;
  * files/anchors actaully exist.
  * </p>
  * 
+ * TODO: build a list of all known external links so that some other tool could (optionally)
ping them all for 200 status?
+ *
  * @see https://github.com/asciidoctor/asciidoctor/issues/1865
  * @see https://github.com/asciidoctor/asciidoctor/issues/1866
  */
@@ -81,7 +83,7 @@ public class CheckLinksAndAnchors {
       
       final String fileContents = readFile(file.getPath());
       final Document doc = Jsoup.parse(fileContents);
-      final Element mainContent = doc.select("#main-content").first();
+      final Element mainContent = doc.select(".main-content").first();
       if (mainContent == null) {
         throw new RuntimeException(file.getName() + " has no main-content div");
       }
@@ -94,7 +96,7 @@ public class CheckLinksAndAnchors {
         assert 0 != id.length();
 
         // special case ids that we ignore
-        if (id.equals("preamble") || id.equals("main-content")) {
+        if (id.equals("preamble")) {
           continue;
         }
         
@@ -106,25 +108,6 @@ public class CheckLinksAndAnchors {
         idsToFiles.get(id).add(file);
       }
 
-      {
-        // special case: implicitly assume each file contains an id matching it's filename
-        // since that's the convention used in linking - for the HTML links these ID's don't
-        // exist but we don't care since #frags pointed at non-existend IDs are ignored br
browsers.
-        // in the PDF these *will* exist and we need to ensure there won't be any dups /
misdirected links
-        // in that case.
-        final String id = file.getName().substring(0, file.getName().lastIndexOf("."));
-        if (0 == mainContent.select("[id=\""+id+"\"]").size()) {
-          if (idsToFiles.containsKey(id)) {
-            idsInMultiFiles.add(id);
-          } else {
-            idsToFiles.put(id, new ArrayList<File>(1));
-          }
-          idsToFiles.get(id).add(file);
-        }
-      }
-          
-      
-      
       // check for (relative) links that don't include a fragment
       final Elements links = mainContent.select("a[href]");
       for (Element link : links) {


Mime
View raw message