Skip to content

Commit 670dec5

Browse files
committed
Migrate documentation to Antora.
1 parent 2bc92b7 commit 670dec5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+977
-888
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ target/
3232
.flattened-pom.xml
3333
dependency-reduced-pom.xml
3434
.gradle
35+
36+
build/
37+
node_modules
38+
node
39+
package.json
40+
package-lock.json
41+

README.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ class MyService {
146146

147147
=== Building SDN
148148

149-
Please have a look at the documentation: https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#building-sdn-rx[Building SDN].
149+
Please have a look at the documentation: https://docs.spring.io/spring-data/neo4j/reference/#building-sdn-rx[Building SDN].
150150

151151
== Getting Help
152152

153153
Having trouble with Spring Data? We’d love to help!
154154

155155
* Check the
156-
https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/neo4j/docs/current/api/[Javadocs].
156+
https://docs.spring.io/spring-data/neo4j/reference/[reference documentation], and https://docs.spring.io/spring-data/neo4j/docs/current/api/[Javadocs].
157157
* Learn the Spring basics – Spring Data builds on Spring Framework, check the https://spring.io[spring.io] web-site for a wealth of reference documentation.
158158
If you are just starting out with Spring, try one of the https://spring.io/guides[guides].
159159
* If you are upgrading, check out the https://docs.spring.io/spring-data/neo4j/docs/current/changelog.txt[changelog] for "`new and noteworthy`" features.
@@ -166,7 +166,7 @@ Spring Data uses GitHub as issue tracking system to record bugs and feature requ
166166

167167
* Before you log a bug, please search the
168168
https://github.com/spring-projects/spring-data-neo4j/issues[issue tracker] to see if someone has already reported the problem.
169-
* If the issue doesnt already exist, https://github.com/spring-projects/spring-data-neo4j/issues/new[create a new issue].
169+
* If the issue doesn't already exist, https://github.com/spring-projects/spring-data-neo4j/issues/new[create a new issue].
170170
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data Neo4j, the database version and the JVM version that you are using.
171171
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
172172
* If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.

pom.xml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@
6868
</developers>
6969

7070
<properties>
71+
<antora.playbook>${project.basedir}/src/main/antora/antora-playbook.yml</antora.playbook>
7172
<apiguardian.version>1.1.1</apiguardian.version>
7273
<archunit.version>0.23.1</archunit.version>
73-
<asciidoctor-maven-plugin.version>2.1.0</asciidoctor-maven-plugin.version>
74-
<asciidoctorj-diagram.version>2.1.0</asciidoctorj-diagram.version>
7574
<blockhound.version>1.0.8.RELEASE</blockhound.version>
7675
<byte-buddy.version>1.14.3</byte-buddy.version>
7776
<cdi>3.0.1</cdi>
@@ -115,7 +114,6 @@
115114

116115
<skipUnitTests>${skipTests}</skipUnitTests>
117116

118-
<spring-data-commons-docs.dir>../../../../spring-data-commons/src/main/asciidoc</spring-data-commons-docs.dir>
119117
<springdata.commons>3.2.0-SNAPSHOT</springdata.commons>
120118
</properties>
121119

@@ -725,34 +723,41 @@
725723
</execution>
726724
</executions>
727725
</plugin>
726+
<plugin>
727+
<groupId>org.apache.maven.plugins</groupId>
728+
<artifactId>maven-resources-plugin</artifactId>
729+
<executions>
730+
<execution>
731+
<goals>
732+
<goal>resources</goal>
733+
</goals>
734+
</execution>
735+
</executions>
736+
</plugin>
728737
</plugins>
729738

730739
</build>
731740

732741
<profiles>
733742
<profile>
734-
<id>distribute</id>
743+
<id>antora-process-resources</id>
744+
<build>
745+
<resources>
746+
<resource>
747+
<directory>src/main/antora/resources/antora-resources</directory>
748+
<filtering>true</filtering>
749+
</resource>
750+
</resources>
751+
</build>
752+
</profile>
753+
754+
<profile>
755+
<id>antora</id>
735756
<build>
736757
<plugins>
737758
<plugin>
738-
<groupId>org.asciidoctor</groupId>
739-
<artifactId>asciidoctor-maven-plugin</artifactId>
740-
<version>${asciidoctor-maven-plugin.version}</version>
741-
<dependencies>
742-
<dependency>
743-
<groupId>org.asciidoctor</groupId>
744-
<artifactId>asciidoctorj-diagram</artifactId>
745-
<version>${asciidoctorj-diagram.version}</version>
746-
</dependency>
747-
</dependencies>
748-
<configuration combine.self="append">
749-
<attributes>
750-
<spring-data-commons-docs>${spring-data-commons-docs.dir}</spring-data-commons-docs>
751-
</attributes>
752-
<requires>
753-
<require>asciidoctor-diagram</require>
754-
</requires>
755-
</configuration>
759+
<groupId>io.spring.maven.antora</groupId>
760+
<artifactId>antora-maven-plugin</artifactId>
756761
</plugin>
757762
</plugins>
758763
</build>

src/main/antora/antora-playbook.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PACKAGES [email protected] @antora/atlas-extension:1.0.0-alpha.1 @antora/[email protected] @springio/[email protected] @asciidoctor/[email protected] @opendevise/[email protected]
2+
#
3+
# The purpose of this Antora playbook is to build the docs in the current branch.
4+
antora:
5+
extensions:
6+
- '@antora/collector-extension'
7+
- require: '@springio/antora-extensions/root-component-extension'
8+
root_component_name: 'data-neo4j'
9+
site:
10+
title: Spring Data Neo4j
11+
url: https://docs.spring.io/spring-data/neo4j/reference/
12+
content:
13+
sources:
14+
- url: ./../../..
15+
branches: HEAD
16+
start_path: src/main/antora
17+
worktrees: true
18+
- url: https://github.com/spring-projects/spring-data-commons
19+
# Refname matching:
20+
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
21+
branches: [ main, 3.2.x ]
22+
start_path: src/main/antora
23+
asciidoc:
24+
attributes:
25+
page-pagination: ''
26+
hide-uri-scheme: '@'
27+
tabs-sync-option: '@'
28+
chomp: 'all'
29+
extensions:
30+
- '@asciidoctor/tabs'
31+
- '@springio/asciidoctor-extensions'
32+
sourcemap: true
33+
urls:
34+
latest_version_segment: ''
35+
runtime:
36+
log:
37+
failure_level: warn
38+
format: pretty
39+
ui:
40+
bundle:
41+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
42+
snapshot: true

src/main/antora/antora.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: data-neo4j
2+
version: true
3+
title: Spring Data Neo4j
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
- run:
9+
command: ./mvnw validate process-resources -am -Pantora-process-resources
10+
local: true
11+
scan:
12+
dir: target/classes/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../java/org/springframework/data/neo4j/config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../java/org/springframework/data/neo4j/core
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../test/java/org/springframework/data/neo4j/documentation
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../test/java/org/springframework/data/neo4j/integration
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../java/org/springframework/data/neo4j/repository
Loading

src/main/antora/modules/ROOT/nav.adoc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
* xref:introduction-and-preface/index.adoc[Preface]
2+
** xref:introduction-and-preface/preface-neo4j.adoc[]
3+
** xref:introduction-and-preface/preface-sd.adoc[]
4+
** xref:introduction-and-preface/preface-sdn.adoc[]
5+
** xref:introduction-and-preface/building-blocks.adoc[]
6+
** xref:introduction-and-preface/new-and-noteworthy.adoc[]
7+
** xref:dependencies.adoc[]
8+
9+
* xref:getting-started.adoc[]
10+
* xref:object-mapping.adoc[]
11+
** xref:object-mapping/metadata-based-mapping.adoc[]
12+
** xref:object-mapping/mapping-ids.adoc[]
13+
** xref:object-mapping/sdc-object-mapping.adoc[]
14+
15+
* xref:repositories.adoc[]
16+
** xref:repositories/core-concepts.adoc[]
17+
** xref:repositories/query-methods.adoc[]
18+
** xref:repositories/definition.adoc[]
19+
** xref:repositories/query-methods-details.adoc[]
20+
** xref:repositories/create-instances.adoc[]
21+
** xref:repositories/custom-implementations.adoc[]
22+
** xref:repositories/core-domain-events.adoc[]
23+
** xref:repositories/core-extensions.adoc[]
24+
** xref:query-by-example.adoc[]
25+
** xref:repositories/scrolling.adoc[]
26+
** xref:repositories/sdn-extension.adoc[]
27+
** xref:repositories/query-keywords-reference.adoc
28+
** xref:repositories/query-return-types-reference.adoc
29+
30+
* xref:repositories/projections.adoc[]
31+
** xref:projections/sdn-projections.adoc[]
32+
33+
* xref:testing.adoc[]
34+
** xref:testing/testing-without-spring-boot.adoc[]
35+
** xref:testing/testing-with-spring-boot.adoc[]
36+
37+
* xref:auditing.adoc[]
38+
39+
* xref:faq.adoc[]
40+
41+
* xref:appendix/index.adoc[]
42+
43+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]

src/main/asciidoc/appendix/custom-queries.adoc renamed to src/main/antora/modules/ROOT/pages/appendix/custom-queries.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Those come in handy if you cannot express the finder logic via derived query fun
77
Because Spring Data Neo4j works heavily record-oriented under the hood, it is important to keep this in mind and not build up a result set with multiple records for the same "root node".
88

99
TIP: Please have a look in the FAQ as well to learn about alternative forms of using custom queries from repositories, especially
10-
how to use custom queries with custom mappings: <<faq.custom-queries-and-custom-mappings>>.
10+
how to use custom queries with custom mappings: xref:faq.adoc#faq.custom-queries-and-custom-mappings[Custom queries and custom mappings].
1111

1212
[[custom-queries.for-relationships]]
1313
== Queries with relationships
@@ -59,7 +59,7 @@ There are two ways to achieve this: Database-side or client-side reduction.
5959
For this the example from above should also contain `Movies` on the `Persons` that get returned with the initial `Movie`.
6060

6161
.Example for 'The Matrix' and 'Keanu Reeves'
62-
image::movie-graph-deep.png[]
62+
image::image$movie-graph-deep.png[]
6363

6464
[[custom-queries.for-relationships.long-paths.database]]
6565
==== Database-side reduction
@@ -132,17 +132,17 @@ Given are a graph that looks like this:
132132

133133
[[custom-query.paths.g]]
134134
.graph with outgoing relationships
135-
image::custom-query.paths.png[]
135+
image::image$custom-query.paths.png[]
136136

137137
and a domain model as shown in the <<custom-query.paths.dm,mapping>> (Constructors and accessors have been omitted for brevity):
138138

139139
[[custom-query.paths.dm]]
140140
[source,java,indent=0,tabsize=4]
141141
.Domain model for a <<custom-query.paths.g>>.
142142
----
143-
include::../../../../src/test/java/org/springframework/data/neo4j/integration/issues/gh2210/SomeEntity.java[tag=custom-query.paths.dm]
143+
include::example$integration/issues/gh2210/SomeEntity.java[tag=custom-query.paths.dm]
144144
145-
include::../../../../src/test/java/org/springframework/data/neo4j/integration/issues/gh2210/SomeRelation.java[tag=custom-query.paths.dm]
145+
include::example$integration/issues/gh2210/SomeRelation.java[tag=custom-query.paths.dm]
146146
----
147147

148148
As you see, the relationships are only outgoing. Generated finder methods (including `findById`) will always try to match
@@ -177,12 +177,12 @@ populated, linked together and returned.
177177
== Parameters in custom queries
178178

179179
You do this exactly the same way as in a standard Cypher query issued in the Neo4j Browser or the Cypher-Shell,
180-
with the `$` syntax (from Neo4j 4.0 on upwards, the old `{foo}` syntax for Cypher parameters has been removed from the database).
180+
with the `$` syntax (from Neo4j 4.0 on upwards, the old `$\{foo\}` syntax for Cypher parameters has been removed from the database).
181181

182182
[source,java,indent=0]
183183
.ARepository.java
184184
----
185-
include::../../../../src/test/java/org/springframework/data/neo4j/documentation/repositories/domain_events/ARepository.java[tags=standard-parameter]
185+
include::example$documentation/repositories/domain_events/ARepository.java[tags=standard-parameter]
186186
----
187187
<.> Here we are referring to the parameter by its name.
188188
You can also use `$0` etc. instead.
@@ -370,7 +370,7 @@ One way to do this are correlated subqueries (Neo4j 4.1+ required).
370370
[[custom-queries.spel]]
371371
== Spring Expression Language in custom queries
372372

373-
{spring-framework-ref}/core.html#expressions[Spring Expression Language (SpEL)] can be used in custom queries inside `:#{}`.
373+
{springdocsurl}/core/expressions.html[Spring Expression Language (SpEL)] can be used in custom queries inside `:#{}`.
374374
The colon here refers to a parameter and such an expression should be used where parameters make sense.
375375
However, when using our <<literal-extension,literal extension>> you can use SpEL expression in places where standard Cypher
376376
won't allow parameters (such as for labels or relationship types).
@@ -382,16 +382,16 @@ The following example basically defines the same query as above, but uses a `WHE
382382
[[custom-queries-with-spel-parameter-example]]
383383
.ARepository.java
384384
----
385-
include::../../../../src/test/java/org/springframework/data/neo4j/documentation/repositories/domain_events/ARepository.java[tags=spel]
385+
include::example$documentation/repositories/domain_events/ARepository.java[tags=spel]
386386
----
387387

388388
The SpEL blocked starts with `:#{` and then refers to the given `String` parameters by name (`#pt1`).
389389
Don't confuse this with the above Cypher syntax!
390-
The SpEL expression concatenates both parameters into one single value that is eventually passed on to the <<neo4j-client>>.
390+
The SpEL expression concatenates both parameters into one single value that is eventually passed on to the xref:appendix/neo4j-client.adoc#neo4j-client[].
391391
The SpEL block ends with `}`.
392392

393393
SpEL also solves two additional problems. We provide two extensions that allow to pass in a `Sort` object into custom queries.
394-
Remember <<custom-queries-with-page-and-slice-examples>> from <<faq.custom-queries-with-page-and-slice,custom queries>>?
394+
Remember xref:faq.adoc#custom-queries-with-page-and-slice-examples[] from xref:faq.adoc#faq.custom-queries-with-page-and-slice[custom queries]?
395395
With the `orderBy` extension you can pass in a `Pageable` with a dynamic sort to a custom query:
396396

397397
[[custom-queries.spel.source]]

src/main/asciidoc/appendix/index.adoc renamed to src/main/antora/modules/ROOT/pages/appendix/index.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[[sdn-appendix]]
22
[appendix]
3-
= Spring Data Neo4j
3+
= Appendix
44

55
:leveloffset: +1
66

7-
include::conversions.adoc[]
8-
97
include::neo4j-client.adoc[]
108

119
include::query-creation.adoc[]

src/main/asciidoc/appendix/migrating.adoc renamed to src/main/antora/modules/ROOT/pages/appendix/migrating.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ spring.neo4j.authentication.password=secret
9393

9494
WARNING: Those new properties might change in the future again when SDN and the driver eventually fully replace the old setup.
9595

96-
And finally, add the new dependency, see <<getting-started>> for both Gradle and Maven.
96+
And finally, add the new dependency, see xref:getting-started.adoc[Getting started] for both Gradle and Maven.
9797

9898
You're then ready to replace annotations:
9999

@@ -125,7 +125,7 @@ You're then ready to replace annotations:
125125
|No replacement, not needed
126126

127127
|`org.springframework.data.neo4j.annotation.QueryResult`
128-
|Use <<projections, projections>>; arbitrary result mapping not supported anymore
128+
|Use xref:repositories/projections.adoc[projections]; arbitrary result mapping not supported anymore
129129

130130
|===
131131

@@ -141,7 +141,7 @@ interface and its only implementation `org.springframework.data.neo4j.bookmark.C
141141
SDN uses bookmarks for all transactions, without configuration.
142142
You can remove the bean declaration of `CaffeineBookmarkManager` as well as the dependency to `com.github.ben-manes.caffeine:caffeine`.
143143

144-
If you absolutely must, you can disable the automatic bookmark management by following <<faq.bookmarks.noop, these instructions>>.
144+
If you absolutely must, you can disable the automatic bookmark management by following xref:faq.adoc#faq.bookmarks.noop[these instructions].
145145

146146
[[migrating.autoindex]]
147147
=== Automatic creation of constraints and indexes

src/main/asciidoc/appendix/neo4j-client.adoc renamed to src/main/antora/modules/ROOT/pages/appendix/neo4j-client.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The client has the following main goals
1616

1717
SDN relies on all those features and uses them to fulfill its entity mapping features.
1818

19-
Have a look at the <<sdn-building-blocks, SDN building blocks>> for where both the imperative and reactive Neo4 clients are positioned in our stack.
19+
Have a look at the xref:introduction-and-preface/building-blocks.adoc#sdn-building-blocks[SDN building blocks] for where both the imperative and reactive Neo4 clients are positioned in our stack.
2020

2121
The Neo4j Client comes in two flavors:
2222

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[[auditing]]
2+
include::{commons}@data-commons::page$auditing.adoc[]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include::{commons}@data-commons::page$dependencies.adoc[]

0 commit comments

Comments
 (0)