Skip to content

Commit 1a8a69d

Browse files
committed
Refactor Asciidoctor attributes in reference docs
This commit reorganizes the asciidoctor attributes for the reference documentation. Instead of being contributed partially by the build and individual documents, attributes are now shared in common files that are included in top sections.
1 parent e16cdfe commit 1a8a69d

21 files changed

+56
-62
lines changed

framework-docs/framework-docs.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ rootProject.tasks.dokkaHtmlMultiModule.configure {
8080
}
8181

8282
asciidoctorj {
83-
def docRoot = 'https://docs.spring.io'
84-
def docsSpringFramework = "${docRoot}/spring-framework/docs/${project.version}"
8583
version = '2.4.3'
8684
fatalWarnings ".*"
8785
options doctype: 'book', eruby: 'erubis'
@@ -92,11 +90,7 @@ asciidoctorj {
9290
revnumber: project.version,
9391
sectanchors: '',
9492
sectnums: '',
95-
'spring-version': project.version,
96-
'spring-framework-main-code': 'https://github.com/spring-projects/spring-framework/tree/main',
97-
'doc-root': docRoot,
98-
'docs-spring-framework': docsSpringFramework,
99-
'api-spring-framework': "${docsSpringFramework}/javadoc-api/org/springframework"
93+
'spring-version': project.version
10094
])
10195
}
10296

framework-docs/src/docs/asciidoc/appendix.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[[appendix]]
22
= Appendix
3-
:toc: left
4-
:toclevels: 4
5-
:tabsize: 4
6-
:docinfo1:
3+
include::attributes.adoc[]
4+
include::page-layout.adoc[]
75

86
This part of the reference documentation covers topics that apply to multiple modules
97
within the core Spring Framework.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:docs-java: {docdir}/../../main/java/org/springframework/docs
2+
:docs-kotlin: {docdir}/../../main/kotlin/org/springframework/docs
3+
:docs-resources: {docdir}/../../main/resources
4+
:spring-framework-main-code: https://github.com/spring-projects/spring-framework/tree/main
5+
:docs-site: https://docs.spring.io
6+
:docs-spring-framework: {docs-site}/spring-framework/docs/{spring-version}
7+
:api-spring-framework: {docs-spring-framework}/javadoc-api/org/springframework
8+
:doc-spring-amqp: {docs-site}/spring-amqp/docs/current/reference
9+
:doc-spring-gemfire: {docs-site}/spring-gemfire/docs/current/reference
10+
:gh-rsocket: https://github.com/rsocket
11+
:gh-rsocket-java: {gh-rsocket}/rsocket-java
12+
:gh-rsocket-extensions: {gh-rsocket}/rsocket/blob/master/Extensions
13+
:doc-spring-boot: {docs-site}/spring-boot/docs/current/reference

framework-docs/src/docs/asciidoc/core.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[[spring-core]]
22
= Core Technologies
3-
:toc: left
4-
:toclevels: 4
5-
:tabsize: 4
6-
:docinfo1:
3+
include::attributes.adoc[]
4+
include::page-layout.adoc[]
75

86
This part of the reference documentation covers all the technologies that are
97
absolutely integral to the Spring Framework.

framework-docs/src/docs/asciidoc/core/core-aot.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[[aot]]
1+
[[core.aot]]
22
= Ahead of Time Optimizations
33

44
This chapter covers Spring's Ahead of Time (AOT) optimizations.
@@ -28,7 +28,7 @@ A Spring AOT processed application typically generates:
2828
NOTE: At the moment, AOT is focused on allowing Spring applications to be deployed as native images using GraalVM.
2929
We intend to support more JVM-based use cases in future generations.
3030

31-
[[aot-basics]]
31+
[[core.aot.basics]]
3232
== AOT engine overview
3333

3434
The entry point of the AOT engine for processing an `ApplicationContext` arrangement is `ApplicationContextAotGenerator`. It takes care of the following steps, based on a `GenericApplicationContext` that represents the application to optimize and a {api-spring-framework}/aot/generate/GenerationContext.html[`GenerationContext`]:
@@ -44,7 +44,7 @@ The `RuntimeHints` instance can also be used to generate the relevant GraalVM na
4444

4545
Those steps are covered in greater detail in the sections below.
4646

47-
[[aot-refresh]]
47+
[[core.aot.refresh]]
4848
== Refresh for AOT Processing
4949

5050
Refresh for AOT processing is supported on all `GenericApplicationContext` implementations.
@@ -88,7 +88,7 @@ This makes sure to create any proxy that will be required at runtime.
8888

8989
One this part completes, the `BeanFactory` contains the bean definitions that are necessary for the application to run. It does not trigger bean instantiation but allows the AOT engine to inspect the beans that will be created at runtime.
9090

91-
[[aot-bean-factory-initialization-contributions]]
91+
[[core.aot.bean-factory-initialization-contributions]]
9292
== Bean Factory Initialization AOT Contributions
9393

9494
Components that want to participate in this step can implement the {api-spring-framework}/beans/factory/aot/BeanFactoryInitializationAotProcessor.html[`BeanFactoryInitializationAotProcessor`] interface.
@@ -111,7 +111,7 @@ If such a bean is registered using an `@Bean` factory method, ensure the method
111111
====
112112

113113

114-
[[aot-bean-registration-contributions]]
114+
[[core.aot.bean-registration-contributions]]
115115
=== Bean Registration AOT Contributions
116116

117117
A core `BeanFactoryInitializationAotProcessor` implementation is responsible for collecting the necessary contributions for each candidate `BeanDefinition`.
@@ -198,7 +198,7 @@ When a `datasource` instance is required, a `BeanInstanceSupplier` is called.
198198
This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean.
199199

200200

201-
[[aot-hints]]
201+
[[core.aot.hints]]
202202
== Runtime Hints
203203

204204
Running an application as a native image requires additional information compared to a regular JVM runtime.
@@ -222,7 +222,7 @@ For cases that the core container cannot infer, you can register such hints prog
222222
A number of convenient annotations are also provided for common use cases.
223223

224224

225-
[[aot-hints-import-runtime-hints]]
225+
[[core.aot.hints.import-runtime-hints]]
226226
=== `@ImportRuntimeHints`
227227

228228
`RuntimeHintsRegistrar` implementations allow you to get a callback to the `RuntimeHints` instance managed by the AOT engine.
@@ -254,7 +254,7 @@ This way, if the component is not contributed to the `BeanFactory`, the hints wo
254254
It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equal to the fully qualified name of the `RuntimeHintsRegistrar` interface.
255255

256256

257-
[[aot-hints-reflective]]
257+
[[core.aot.hints.reflective]]
258258
=== `@Reflective`
259259

260260
{api-spring-framework}/aot/hint/annotation/Reflective.html[`@Reflective`] provides an idiomatic way to flag the need for reflection on an annotated element.
@@ -268,7 +268,7 @@ Library authors can reuse this annotation for their own purposes.
268268
If components other than Spring beans need to be processed, a `BeanFactoryInitializationAotProcessor` can detect the relevant types and use `ReflectiveRuntimeHintsRegistrar` to process them.
269269

270270

271-
[[aot-hints-register-reflection-for-binding]]
271+
[[core.aot.hints.register-reflection-for-binding]]
272272
=== `@RegisterReflectionForBinding`
273273

274274
{api-spring-framework}/aot/hint/annotation/RegisterReflectionForBinding.html[`@RegisterReflectionForBinding`] is a specialization of `@Reflective` that registers the need for serializing arbitrary types.

framework-docs/src/docs/asciidoc/data-access.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[[spring-data-tier]]
22
= Data Access
3-
:toc: left
4-
:toclevels: 4
5-
:tabsize: 4
6-
:docinfo1:
3+
include::attributes.adoc[]
4+
include::page-layout.adoc[]
75

86
This part of the reference documentation is concerned with data access and the
97
interaction between the data access layer and the business or service layer.

framework-docs/src/docs/asciidoc/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:noheader:
22
= Spring Framework Documentation
3+
include::attributes.adoc[]
34

45
[horizontal]
56
<<overview.adoc#overview, Overview>> :: history, design philosophy, feedback,

framework-docs/src/docs/asciidoc/integration.adoc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
[[spring-integration]]
22
= Integration
3-
:doc-spring-amqp: {doc-root}/spring-amqp/docs/current/reference
4-
:doc-spring-gemfire: {doc-root}/spring-gemfire/docs/current/reference
5-
:toc: left
6-
:toclevels: 4
7-
:tabsize: 4
8-
:docinfo1:
3+
include::attributes.adoc[]
4+
include::page-layout.adoc[]
95

106
This part of the reference documentation covers Spring Framework's integration with
117
a number of technologies.

framework-docs/src/docs/asciidoc/languages.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[[languages]]
22
= Language Support
3-
:toc: left
4-
:toclevels: 4
5-
:tabsize: 4
6-
:docinfo1:
3+
include::attributes.adoc[]
4+
include::page-layout.adoc[]
75

86
include::languages/kotlin.adoc[leveloffset=+1]
97

framework-docs/src/docs/asciidoc/overview.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[[overview]]
22
= Spring Framework Overview
3+
include::attributes.adoc[]
34
:toc: left
45
:toclevels: 1
56
:docinfo1:

0 commit comments

Comments
 (0)