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

Images not rendered in documentation #838

Closed
ericbottard opened this issue Aug 26, 2016 · 3 comments
Closed

Images not rendered in documentation #838

ericbottard opened this issue Aug 26, 2016 · 3 comments
Assignees
Labels
area/documentation Belongs to documentation
Milestone

Comments

@ericbottard
Copy link
Contributor

ericbottard commented Aug 26, 2016

Images linked as image::images/foo.png do not show in the rendered (htmlsingle, pdf) doc.

The issue is that the images/ part of the path appears twice

@jvalkeal
Copy link
Contributor

I tried to get this working a long time ago. It's something to do with that fact that images is a default place to locate images and then adding images/foo.png adds directory twice. I couldn't find a correct combination of settings as either pdf/epub or html got broken. Somehow this all works with gradle as we have a plugin for it https://github.com/spring-gradle-plugins/docbook-reference-plugin/blob/master/src/main/groovy/DocbookReferencePlugin.groovy.

If we add images to asciidoc sources which gets imported into other docs, then those images would not work anymore as physical image files are not present. This current docs model is not sustainable anymore.

@jvalkeal
Copy link
Contributor

I think I finally figured out what going on here. In a nutshell asciidoctor plugin for maven vs. gradle works differently what comes for importing images.

I tried this with one image:

$ git diff
diff --git a/spring-cloud-dataflow-docs/src/main/asciidoc/architecture.adoc b/spring-cloud-dataflow-docs/src/main/asciidoc/architecture.adoc
index 6854698..4391879 100644
--- a/spring-cloud-dataflow-docs/src/main/asciidoc/architecture.adoc
+++ b/spring-cloud-dataflow-docs/src/main/asciidoc/architecture.adoc
@@ -1,3 +1,6 @@
+ifndef::imagesdir[:imagesdir: images]
+ifndef::dataflow-asciidoc-images[:dataflow-asciidoc-images: ]
+
 [[architecture]]
 = Architecture

@@ -48,7 +51,7 @@ In the case of Kafka, when deploying the stream, the Data Flow server is respons
 The interaction of the main components is shown below

 .The Spring Cloud Data High Level Architecure
-image::{dataflow-asciidoc}/images/dataflow-arch.png[The Spring Cloud Data Flow High Level Architecture, scaledwidth="60%"]
+image::{dataflow-asciidoc-images}dataflow-arch.png[The Spring Cloud Data Flow High Level Architecture, scaledwidth="60%"]

 In this diagram a DSL description of a stream is POSTed to the Data Flow Server.  Based on the mapping of DSL application names to Maven and Docker artifacts, the http source and cassandra sink application are deployed on the target runtime.

On default {dataflow-asciidoc-images} is empty and then actual images will be resolved from images dir and asciidoctor add base images path and html/pdf seem to work ok. Manually seeing adoc files also work as imagesdir attribute is now in place. I assume that {dataflow-asciidoc-images} can then be used from other docs(which import these adoc files) to resolve images from correct github branch/tag otherwise image doesn't exist in a local project.

This would still have a problem that for imported docs images are served from github rather than docs.spring.io but for that we could possible try to import/link images from there(docs.spring.io).

@sabbyanandan
Copy link
Contributor

Depends on #1009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Belongs to documentation
Projects
None yet
Development

No branches or pull requests

3 participants