[groovy] branch master updated: overcome asciidoc multi-level link limitations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated: overcome asciidoc multi-level link limitations

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

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 688134a  overcome asciidoc multi-level link limitations
688134a is described below

commit 688134a073f646b6796d79546863c8576372680f
Author: Paul King <[hidden email]>
AuthorDate: Tue Oct 13 21:36:10 2020 +1000

    overcome asciidoc multi-level link limitations
---
 src/spec/doc/core-semantics.adoc                  | 20 ++++++++++++++++----
 src/spec/doc/core-syntax.adoc                     | 14 ++++++++++----
 subprojects/groovy-binary/src/spec/doc/index.adoc |  5 +++++
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/src/spec/doc/core-semantics.adoc b/src/spec/doc/core-semantics.adoc
index d31c8c4..ee0abde 100644
--- a/src/spec/doc/core-semantics.adoc
+++ b/src/spec/doc/core-semantics.adoc
@@ -18,6 +18,18 @@
   under the License.
 
 //////////////////////////////////////////
+ifndef::core-object-orientation[]
+:core-object-orientation: core-object-orientation.adoc
+endif::[]
+ifndef::core-operators[]
+:core-operators: core-operators.adoc
+endif::[]
+ifndef::xml-userguide[]
+:xml-userguide: xml-userguide.adoc
+endif::[]
+ifndef::core-syntax[]
+:core-syntax: core-syntax.adoc
+endif::[]
 
 = Semantics
 
@@ -49,7 +61,7 @@ in which case it's like having a declaration and assignment (which we cover next
 
 [NOTE]
 Variable definition types can be refined by using generics, like in `List<String> names`.
-To learn more about the generics support, please read the <<core-object-orientation.adoc#generics,generics section>>.
+To learn more about the generics support, please read the <<{core-object-orientation}#generics,generics section>>.
 
 === Variable assignment
 
@@ -109,7 +121,7 @@ include::../test/SemanticsTest.groovy[tags=multiple_assignment_underflow,indent=
 ==== Object destructuring with multiple assignment
 
 In the section describing Groovy's operators,
-the case of the <<core-operators.adoc#subscript-operator,subscript operator>> has been covered,
+the case of the <<{core-operators}#subscript-operator,subscript operator>> has been covered,
 explaining how you can override the `getAt()`/`putAt()` method.
 
 With this technique, we can combine multiple assignments and the subscript operator methods to implement _object destructuring_.
@@ -463,7 +475,7 @@ As an example, you can specify a path to an object or element of interest:
 
 In both cases, the GPath expression can be viewed as a query on an object graph.  For POJOs, the object graph is most often built by the
 program being written through object instantiation and composition; for XML processing, the object graph is the result of `parsing`
-the XML text, most often with classes like XmlParser or XmlSlurper. See <<xml-userguide.adoc#Processing XML,Processing XML>>
+the XML text, most often with classes like XmlParser or XmlSlurper. See <<{xml-userguide}#Processing XML,Processing XML>>
 for more in-depth details on consuming XML in Groovy.
 
 [TIP]
@@ -557,7 +569,7 @@ include::../test/semantics/GPathTest.groovy[tags=gpath_on_xml_1,indent=0]
 
 === Number promotion
 
-The rules of number promotion are specified in the section on <<core-syntax.adoc#_math_operations,math operations>>.
+The rules of number promotion are specified in the section on <<{core-syntax}#_math_operations,math operations>>.
 
 
 [[closure-coercion]]
diff --git a/src/spec/doc/core-syntax.adoc b/src/spec/doc/core-syntax.adoc
index b5c0230..af0a688 100644
--- a/src/spec/doc/core-syntax.adoc
+++ b/src/spec/doc/core-syntax.adoc
@@ -18,6 +18,12 @@
   under the License.
 
 //////////////////////////////////////////
+ifndef::core-operators[]
+:core-operators: core-operators.adoc
+endif::[]
+ifndef::core-semantics[]
+:core-semantics: core-semantics.adoc
+endif::[]
 
 = Syntax
 
@@ -812,7 +818,7 @@ include::../test/SyntaxTest.groovy[tags=number_type_suffixes_example,indent=0]
 
 === Math operations
 
-Although <<core-operators.adoc#groovy-operators,operators>> are covered in more detail elsewhere, it's important to discuss the behavior of math operations
+Although <<{core-operators}#groovy-operators,operators>> are covered in more detail elsewhere, it's important to discuss the behavior of math operations
 and what their resulting types are.
 
 Division and power binary operations aside (covered below),
@@ -993,7 +999,7 @@ include::../test/SyntaxTest.groovy[tags=number_power,indent=0]
 == Booleans
 
 Boolean is a special data type that is used to represent truth values: `true` and `false`.
-Use this data type for simple flags that track true/false <<core-operators.adoc#_conditional_operators,conditions>>.
+Use this data type for simple flags that track true/false <<{core-operators}#_conditional_operators,conditions>>.
 
 Boolean values can be stored in variables, assigned into fields, just like any other data type:
 
@@ -1003,9 +1009,9 @@ include::../test/SyntaxTest.groovy[tags=variable_store_boolean_value,indent=0]
 ----
 
 `true` and `false` are the only two primitive boolean values.
-But more complex boolean expressions can be represented using <<core-operators.adoc#_logical_operators,logical operators>>.
+But more complex boolean expressions can be represented using <<{core-operators}#_logical_operators,logical operators>>.
 
-In addition, Groovy has <<core-semantics.adoc#Groovy-Truth,special rules>> (often referred to as _Groovy Truth_)
+In addition, Groovy has <<{core-semantics}#Groovy-Truth,special rules>> (often referred to as _Groovy Truth_)
 for coercing non-boolean objects to a boolean value.
 
 == Lists
diff --git a/subprojects/groovy-binary/src/spec/doc/index.adoc b/subprojects/groovy-binary/src/spec/doc/index.adoc
index 9586c2a..74c6743 100644
--- a/subprojects/groovy-binary/src/spec/doc/index.adoc
+++ b/subprojects/groovy-binary/src/spec/doc/index.adoc
@@ -27,12 +27,17 @@ include::{reldir_root}/core-introduction.adoc[]
 
 == Groovy Language Specification
 
+:core-semantics:
+:core-operators:
 include::{reldir_root}/core-syntax.adoc[leveloffset=+2]
 
 include::{reldir_root}/core-operators.adoc[leveloffset=+2]
 
 include::{reldir_root}/core-program-structure.adoc[leveloffset=+2]
 
+:core-object-orientation:
+:core-syntax:
+:xml-userguide:
 include::{reldir_root}/core-object-orientation.adoc[leveloffset=+2]
 
 include::{reldir_root}/core-closures.adoc[leveloffset=+2]