Skip to content

Block selection in docs only works in single page HTML #23709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
philwebb opened this issue Oct 15, 2020 · 4 comments
Closed

Block selection in docs only works in single page HTML #23709

philwebb opened this issue Oct 15, 2020 · 4 comments
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Oct 15, 2020

It seems to be working on other pages on the multi-pages variant: https://docs.spring.io/spring-boot/docs/2.4.0-SNAPSHOT/reference/html/using-spring-boot.html#using-boot

This reminds me of a discussion with @wilkinsona where we found out that extensions were only applied to a subset of pages. In the end, overriding the asciidoctorj made it work. Does that ring a bell Andy?

@philwebb philwebb added the type: documentation A documentation update label Oct 15, 2020
@philwebb philwebb added this to the 2.1.x milestone Oct 15, 2020
@wilkinsona
Copy link
Member

wilkinsona commented Oct 15, 2020

It does indeed. IIRC, we tracked it down to AsciidoctorJ only including the extension on the first call to convert. Subsequent calls wouldn't use the extension. It doesn't show up with the single-page docs as there's only a single convert call under the covers. With the multi-page docs, the extension only runs once (on the first page that's converted) so you get the block selection tabs only on that first page.

@philwebb
Copy link
Member Author

I tried this, but it didn't work:

diff --git a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java
index 503a83cf1c1..495493d0223 100644
--- a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java
+++ b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java
@@ -69,9 +69,12 @@ import org.springframework.util.StringUtils;
  */
 class AsciidoctorConventions {
 
+       private static final String ASCIIDOCTORJ_VERSION = "2.4.1";
+
        void apply(Project project) {
                project.getPlugins().withType(AsciidoctorJPlugin.class, (asciidoctorPlugin) -> {
                        configureDocResourcesRepository(project);
+                       upgradeAsciidoctorJVersion(project);
                        makeAllWarningsFatal(project);
                        UnzipDocumentationResources unzipResources = createUnzipDocumentationResourcesTask(project);
                        project.getTasks().withType(AbstractAsciidoctorTask.class, (asciidoctorTask) -> {
@@ -106,6 +109,10 @@ class AsciidoctorConventions {
                });
        }
 
+       private void upgradeAsciidoctorJVersion(Project project) {
+               project.getExtensions().getByType(AsciidoctorJExtension.class).setVersion(ASCIIDOCTORJ_VERSION);
+       }
+
        private void makeAllWarningsFatal(Project project) {
                project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(".*");
        }

@wilkinsona
Copy link
Member

That fix works for me.

@wilkinsona wilkinsona self-assigned this Oct 16, 2020
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.4.0-RC1 Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants