Re: Single CSS for multiple, nested adoc files

Posted by mojavelinux on
URL: https://discuss.asciidoctor.org/Single-CSS-for-multiple-nested-adoc-files-tp552p606.html




On Thu, Sep 12, 2013 at 1:54 AM, ChrLipp [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Solution E ::

- Copy the CSS manually.
- Link to the stylesheet with stylesdir and linkcss
- Provide an additional flag like useRelativeCssLinking which takes the adoc path and the css path and tries to compute a relative path. If this is possible, use it. If not, stick to the absolute path.

As I started to say in a previous response, the problem with something like useRelativeCssLinking is that this is not just an issue with CSS. The issue is with asset references in the output file.

I think we need to explore the following two solutions, and see which one plays out as most viable:

a. Provide a "docrootdir" attribute that can be used, perhaps in various ways, to keep the asset path consistent with the current directory level.
b. Recognize a relative directory for any attribute that ends with "dir" and adjust the value to reflect the current directory level

Instinct tells me that (b) is going to be very fragile and likely to confuse users that weren't on the design committee :) Although it seems like an extra step, using an attribute makes the intent very clear and gives us *lots* of room for doing smart things.

Now, we *could* still have a flag that implicitly adds "docrootdir" to the beginning of known asset path attributes, making it unnecessary to manually add the attribute...but under the covers it would still work as though it had been added explicitly.

-Dan


--