This is an automated email from the ASF dual-hosted git repository. houston pushed a commit to branch jira/solr-15556-antora in repository https://gitbox.apache.org/repos/asf/solr.git
commit 0229e67ceb8cbe6bf3e33da7dfebe02553e70145 Author: Houston Putman <[email protected]> AuthorDate: Wed Feb 2 17:31:39 2022 -0500 Add in link checking to the gradle build. fix some links --- solr/solr-ref-guide/build.gradle | 34 ++++++++++++++++++++-- .../pages/indexing-nested-documents.adoc | 4 +-- .../query-guide/pages/block-join-query-parser.adoc | 2 +- .../pages/searching-nested-documents.adoc | 2 +- solr/solr-ref-guide/playbook.template.yml | 4 +-- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/solr/solr-ref-guide/build.gradle b/solr/solr-ref-guide/build.gradle index 3f42072..8c39909 100644 --- a/solr/solr-ref-guide/build.gradle +++ b/solr/solr-ref-guide/build.gradle @@ -378,6 +378,7 @@ task buildLocalAntoraPlaybookYaml(type: Copy) { into project.ext.playbooksDir expand([ + 'site_url' : "", 'source_url' : projectDir.parentFile.parentFile.path, 'source_branches' : "HEAD", 'ui_bundle_url' : "https://nightlies.apache.org/solr/draft-guides/ui-bundle.zip", @@ -395,6 +396,7 @@ task buildOfficialAntoraPlaybookYaml(type: Copy) { into project.ext.playbooksDir expand([ + 'site_url' : "https://solr.apache.org/guide", 'source_url' : "https://github.com/apache/solr.git", 'source_branches' : ["jira/solr-15556-antora"], 'ui_bundle_url' : "https://nightlies.apache.org/solr/draft-guides/ui-bundle.zip", @@ -446,6 +448,12 @@ task downloadAntoraLinkValidator(type: NpmTask) { args = ["install", "gitlab:antora/xref-validator"] } +task downloadLinkValidator(type: NpmTask) { + dependsOn tasks.downloadAntoraCli + + args = ["install", "linkinator"] +} + task validateSiteLinks(type: NpxTask) { dependsOn tasks.downloadAntoraLinkValidator dependsOn tasks.buildAntoraYaml @@ -473,9 +481,10 @@ task buildSiteNew(type: NpxTask) { // Use a local build of the Lucene and Solr javadocs if building a local refGuide extraArgs.addAll([ // This attribute should not include ":link", the other 2 should + // This attribute should also not be relative, because it is used in multiple path directories in the site "--attribute", "page-solr-javadocs=${project(':solr:documentation').docroot.toPath()}", - "--attribute", "solr-javadocs=link:${project(':solr:documentation').docroot.toPath()}", - "--attribute", "lucene-javadocs=link:${project(':solr:documentation').luceneDocsDir.toPath()}" + "--attribute", "solr-javadocs=link:../../../${file(project.ext.siteDir).relativePath(project(':solr:documentation').docroot)}", + "--attribute", "lucene-javadocs=link:../../../${file(project.ext.siteDir).relativePath(project(':solr:documentation').luceneDocsDir)}" ]) } args = [ @@ -484,3 +493,24 @@ task buildSiteNew(type: NpxTask) { "--to-dir=${buildDir}/site", ] + extraArgs } + +task validateJavadocsLinks(type: NpxTask) { + //dependsOn tasks.downloadLinkValidator + dependsOn tasks.buildSiteNew + + command = "link-checker" + args = [ + "${buildDir}/site", + "--url-ignore", "file:/", + "--mkdocs", + "--allow-hash-href", + "--disable-external", + "--debug", + // Ignore the java docs url in the header, since it is an absolute path + "--url-ignore", "${project(':solr:documentation').docroot.toPath()}/index\\.html", + //"--json", + "-v", + ] + + //inputs.files("${buildDir}/site") +} diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc index 799a4fc..94c66c7 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc @@ -25,7 +25,7 @@ The "top most" parent with all children is referred to as a "root" document or f document" and it explains some of the nomenclature of related features. At query time, the xref:query-guide:block-join-query-parser.adoc[] can search these relationships, and the xref:query-guide:document-transformers.adoc#child-childdoctransformerfactory[`[child]`] Document Transformer can attach child (or other "descendent") documents to the result documents. -In terms of performance, indexing the relationships between documents usually yields much faster queries than an equivalent xref:query-guide:join-query-parser["query time join"], +In terms of performance, indexing the relationships between documents usually yields much faster queries than an equivalent xref:query-guide:join-query-parser.adoc["query time join"], since the relationships are already stored in the index and do not need to be computed. However, nested documents are less flexible than query time joins as it imposes rules that some applications may not be able to accept. @@ -251,7 +251,7 @@ when using the xref:query-guide:searching-nested-documents.adoc#child-doc-transf ** If this field does not exist, the `[child]` transformer will return all descendent child documents as a flattened list -- just as if they had been <<indexing-anonymous-children,indexed as anonymous children>>. * If you do not use `\_nest_path_` it is strongly recommended that every document have some field that differentiates root documents from their nested children -- and differentiates different "types" of child documents. -This is not strictly necessary, so long as it's possible to write a "filter" query that can be used to isolate and select only parent documents for use in the xref:query-guide:block-join-query-parser[] and xref:query-guide:searching-nested-documents.adoc#child-doc-transformer[`[child]`] doc transformer +This is not strictly necessary, so long as it's possible to write a "filter" query that can be used to isolate and select only parent documents for use in the xref:query-guide:block-join-query-parser.adoc[] and xref:query-guide:searching-nested-documents.adoc#child-doc-transformer[`[child]`] doc transformer * It's possible to query on this field, although at present it's only documented how to in the context of `[child]`'s `childFilter` parameter. diff --git a/solr/solr-ref-guide/modules/query-guide/pages/block-join-query-parser.adoc b/solr/solr-ref-guide/modules/query-guide/pages/block-join-query-parser.adoc index b798ffe..95ad96d 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/block-join-query-parser.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/block-join-query-parser.adoc @@ -210,4 +210,4 @@ A similar problematic situation can arise when mixing parent/child documents wit ...then our simple `doc_type:parent` Block Mask would no longer be adequate. We would instead need to use `\*:* -doc_type:child` or `doc_type:(simple parent)` to prevent our "simple" document from mistakenly being treated as a "child" of an adjacent "parent" document. -The xref:query-guide:searching-nested-documents[] section contains more detailed examples of specifying Block Mask queries with non trivial hierarchies of documents. +The xref:query-guide:searching-nested-documents.adoc[] section contains more detailed examples of specifying Block Mask queries with non trivial hierarchies of documents. diff --git a/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc b/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc index c3ae864..2a92df2 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc @@ -176,7 +176,7 @@ Note that in the above example, the `/` characters in the `\_nest_path_` were "d (You can see that only a single level of of `\` escaping is needed in the body of the query string -- to prevent the Regex syntax -- because it's not a quoted string local param). -You may find it more convenient to use xref:local-params.adoc#parameter-dereferencing[parameter references] in conjunction with xref:other-parsers[other parsers] that do not treat `/` as a special character to express the same query in a more verbose form: +You may find it more convenient to use xref:local-params.adoc#parameter-dereferencing[parameter references] in conjunction with xref:other-parsers.adoc[other parsers] that do not treat `/` as a special character to express the same query in a more verbose form: [source,text] ---- diff --git a/solr/solr-ref-guide/playbook.template.yml b/solr/solr-ref-guide/playbook.template.yml index f3f5e9d..3f9404c 100644 --- a/solr/solr-ref-guide/playbook.template.yml +++ b/solr/solr-ref-guide/playbook.template.yml @@ -1,6 +1,6 @@ site: title: Apache Solr Reference Guide - url: https://solr.apache.org/guide + url: ${site_url} start_page: solr::index.adoc urls: latest_version_segment: latest @@ -25,7 +25,7 @@ ui: snapshot: true output: clean: true - dir: ./build + dir: ./build/site asciidoc: attributes: stem:
