Skip to content
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

add asciidoctor-diagram support #129

Merged
merged 3 commits into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name := "sbt-site"

organization := "com.typesafe.sbt"

version := "1.3.2"
version := "1.3.3-SNAPSHOT"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

crossSbtVersions := List("0.13.17", "1.0.4")

licenses += ("BSD 3-Clause", url("https://opensource.org/licenses/BSD-3-Clause"))
Expand All @@ -28,7 +28,8 @@ libraryDependencies ++= Seq(
"org.foundweekends" %% "pamflet-library" % "0.7.1",
"org.yaml" % "snakeyaml" % "1.13",
"com.typesafe" % "config" % "1.2.1", // Last version to support Java 1.6
"org.asciidoctor" % "asciidoctorj" % "1.5.4"
"org.asciidoctor" % "asciidoctorj" % "1.5.4",
"org.asciidoctor" % "asciidoctorj-diagram" % "1.5.4.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this using a different version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The different version wasn't intentional.

Should I downgrade the asciidoctorj-diagram dependency to 1.5.4, or upgrade the asciidoctorj dependecy to 1.5.4.1?

1.5.4.1 is a bugfix release https://github.com/asciidoctor/asciidoctorj/releases/tag/v1.5.4.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is a bugfix release then I suggest we go ahead and upgrade.

)

addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.3.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ object AsciidoctorPlugin extends AutoPlugin {
val oldContextClassLoader = Thread.currentThread().getContextClassLoader
Thread.currentThread().setContextClassLoader(this.getClass.getClassLoader)
val asciidoctor = Factory.create()
asciidoctor.requireLibrary("asciidoctor-diagram")
if (!output.exists) output.mkdirs()
val options = new Options
options.setToDir(output.getAbsolutePath)
Expand Down
2 changes: 2 additions & 0 deletions src/sbt-test/asciidoctor/can-use-asciidoctor/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Asciidoctor).value
val index = dest / "index.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
val diagram = dest / "asciidoctor-diagram-process.png"
assert(diagram.exists, s"${diagram.getAbsolutePath} did not exist")
val content = IO.readLines(index)
assert(content.exists(_.contains("sbt")), s"Did not find expected content in:\n${content.mkString("\n")}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,23 @@ This is passed from the sbt build: {project-version}

[source,ruby]
puts "Hello, World!"

[ditaa,asciidoctor-diagram-process]
....
+-------------+
| Asciidoctor |-------+
| diagram | |
+-------------+ | PNG out
^ |
| ditaa in |
| v
+--------+ +--------+----+ /---------------\
| |---+ Asciidoctor +--->| |
| Text | +-------------+ | Beautiful |
|Document| | !magic! | | Output |
| {d}| | | | |
+---+----+ +-------------+ \---------------/
: ^
| Lots of work |
+-----------------------------------+
....