While analyzing the claim in #29998, I became aware of our current settings for chomp and fold for spring-asciidoctor-backends in the reference documentation.
|
:chomp: default headers packages |
|
:fold: all |
Historically, we have maintained handcrafted code examples (in contrast to included snippets which we have recently introduced for AOT examples), sometimes with explicit package and import statements in order to assist the user in understanding the examples. For example, the CommonPointcuts class explicitly declares its package com.xyz.myapp to make it clear in subsequent examples where shared pointcuts are derived from (e.g., com.xyz.myapp.CommonPointcuts.businessService()).
As far as I understand the feature set of spring-asciidoctor-backends, it is not possible to "un-chomp" (i.e., show) chomped package statements; whereas, it is possible to un-fold folded import statements (even if not readily apparent to the user).
However, for handcrafted examples that intentionally include package and import statements I think we should show those by default, especially since the user has no way to show the package statements that have been chomped.
On the other hand, if the package statement is irrelevant -- for example, when including code snippets from a real source file in the framework-docs project -- it then makes sense to chomp package statements.
I am therefore creating this issue for the team to decide how to deal with chomping and folding defaults across the reference documentation, specifically with regard to handcrafted vs. included code snippets.
While analyzing the claim in #29998, I became aware of our current settings for
chompandfoldfor spring-asciidoctor-backends in the reference documentation.spring-framework/framework-docs/src/docs/asciidoc/attributes.adoc
Lines 1 to 2 in 8a44b64
Historically, we have maintained handcrafted code examples (in contrast to included snippets which we have recently introduced for AOT examples), sometimes with explicit
packageandimportstatements in order to assist the user in understanding the examples. For example, theCommonPointcutsclass explicitly declares its packagecom.xyz.myappto make it clear in subsequent examples where shared pointcuts are derived from (e.g.,com.xyz.myapp.CommonPointcuts.businessService()).As far as I understand the feature set of
spring-asciidoctor-backends, it is not possible to "un-chomp" (i.e., show) chompedpackagestatements; whereas, it is possible to un-fold foldedimportstatements (even if not readily apparent to the user).However, for handcrafted examples that intentionally include
packageandimportstatements I think we should show those by default, especially since the user has no way to show thepackagestatements that have been chomped.On the other hand, if the
packagestatement is irrelevant -- for example, when including code snippets from a real source file in theframework-docsproject -- it then makes sense to chomppackagestatements.I am therefore creating this issue for the team to decide how to deal with chomping and folding defaults across the reference documentation, specifically with regard to handcrafted vs. included code snippets.