Posted by
tigregalis on
Nov 23, 2018; 4:18am
URL: https://discuss.asciidoctor.org/Output-to-another-folder-with-image-and-css-links-tp6593.html
First up, great project. I've been following it for a while and only starting to use it to any serious degree.
I'm using VS Code with the extension to edit and preview my document. Within VS Code, the preview works perfectly. When exporting, however, due to the output location (one directory up), the images try to resolve to one directory further up.
I'm just wondering how I can output to a HTML file at a different level, without breaking the links to images and the styles (i.e. the links adapting).
My structure is as follows:
manual/
* images/
** image1.png
** image2.gif
** ... (other images)
* source/
** index.adoc (root file)
** overview.adoc (included into index.adoc)
** structure.adoc (included into index.adoc)
** ... (other source files)
* styles
** custom.css
* output.html (output)
In each of the source files, when I reference an image, I use:
// go one folder up to "manual", then down to "images", then get "image1.png"
image::../images/image1.png[]
This is what I have at the top of index.adoc:
= Title
:toc: left
:experimental: true
:sectlinks:
// even though the stylesheet follows the same structure, the stylesheet works
:stylesheet: ../styles/custom.css
:linkcss:
// :imagesdir: ../images/
// I've tried this attribute but it doesn't appear to help, and I probably don't understand it very well
I've tried a number of commands and attributes, and from different locations:
... manual\source> asciidoctor -n index.adoc -o ../output.html
from within the source folder, grab index.adoc, and output one folder up into output.html
... manual> asciidoctor -n ./source/index.adoc -o output.html
from the manual folder, go down one and grab index.adoc, and output into output.html
Additionally, this is a separate but maybe related query, but I'm still unsure how, if the included files as well as the root file have attributes set, how the processor deals with this.