question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

operation:: doesn't work after upgrading to asciidoctor 3.3.2 version

See original GitHub issue

build.gradle.kts:

plugins {
	id("org.asciidoctor.base") version "3.3.2"
	id("org.asciidoctor.jvm.convert") version "3.3.2"
}
val snippetsDir by extra { file("build/generated-snippets") }
tasks {
	testI {
		outputs.dir(snippetsDir)
	}

	asciidoctor {
		sourceDir(file("$projectDir/src/docs"))
		setOutputDir(File(buildDir, "docs"))
		inputs.dir(snippetsDir)
		inputs.dir(file("src/docs"))
		attributes(mapOf("snippets" to snippetsDir))
		dependsOn(testI)
	}
}

source file

=== Get client

operation::client-get-by-id[snippets='curl-request,http-request,http-response']

resulting HTML file has following intstead of results of operation::* expansion

<h3 id="_get_client"><a class="link" href="#_get_client">Get client</a></h3>
<div class="paragraph">
<p>operation::client-get-by-id[snippets='curl-request,http-request,http-response']</p>
</div>

This worked before upgrading to latest asciidoctor plugin. When the source adoc file is opened in IntelliJ with asciidoctor plugin installed, all the snippets show up in the preview pane.

NOTE: testI is just a test task for a custom source set.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wilkinsonacommented, Jul 22, 2021

Glad to hear you got it working. https://github.com/spring-projects/spring-restdocs/issues/680 is tracking some documentation updates to show how to configure the newer versions of the Asciidoctor Gradle Plugin.

1reaction
wilkinsonacommented, Jul 22, 2021

I’ve just checked the rest-notes-spring-hateoas sample in this repository. It uses 3.3.2 of the org.asciidoctor.jvm.convert plugin and the operation macro without any problems.

isn’t operation:: a rest-docs concept? How do I check if there is a regression?

Yes, but it’s not responsible for the macro being called. That’s done by Asciidoctor.

Looking at your example, I can’t see any sign of the spring-restdocs-asciidoctor dependency. Have you set up that dependency and configured Asciidoctor to use it? You can see an example of that in the sample that I linked to above.

If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

File not found errors when trying to setup asciidoctor
I am upgrading it from org.asciidoctor.convert to org.asciidoctor.jvm.convert but am getting the error that it can't find the pages and load the ...
Read more >
Asciidoctor - Bountysource
Hello,. I am using Gradle, Asciidoctor Gradle plugin, Asciidoctorj, and Mermaid to generate diagrams. Since an upgrade to version 3.3.2 of the plugin...
Read more >
spring-projects/spring-restdocs - Gitter
I tried with the following code but it doesn't work like I would like ... A simple update from 1.5.9.2 breaks my build...
Read more >
Asciidoctor | A fast, open source text processor and publishing ...
A comprehensive and user-friendly publishing toolchain for the AsciiDoc writing format. Converts AsciiDoc to HTML5, DocBook, PDF, and other formats.
Read more >
Gradle 7.5 not working with Gradle Sonarqube Plugin 3.4 ...
I recently upgraded my gradle version from 7.4.2 to 7.5. But now the sonarqube task in my builds fail with the following error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found