-
Notifications
You must be signed in to change notification settings - Fork 120
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
Provide access to the sourceDir value as attribute #292
Comments
Could you solve this with the |
Thank you for your feedback. I am not sure what you mean with I have something similar to the setup described here in this project: doc-as-code-demo. Each files "knows" its location because I add following on top of each of my files: // {root} shoud point to the `docs/` folder:
ifndef::root[]
:root: ../
endif::[] The But my setup goes a little bit further, next to the I run gradle either with sourceDir set to
And in this case, because of my definition of NB: this current approach has also some drawbacks, so I might change it in the future... |
Will add this to 2.1.0. The attribute will be called |
Add this attribute to show the relative path of the containing directory of the current document that is being processed, to the source root (i.e. `asciidoctor.sourceDir`).
Hi, is it possible to use attributes = [
'snippets' : snippetsDir,
'source-highlighter': 'highlight.js',
'highlightjs-theme' : 'gruvbox-dark',
'highlightjsdir' : '{gradle-relative-srcdir}/highlight',
'stylesheet' : 'asciidark.css',
'stylesdir' : '{gradle-relative-srcdir}',
'linkcss' : 'true',
'encoding' : 'utf-8'
] |
Similar to
gradle-rootdir
, it would be great if the gradle plugin could provide access to the configuredsourceDir
.Use case:
With this configuration in
build.gradle
:When using highlightjs, the output looks like this:
The value of
highlightjsdir
depends from the position of the file relatively to the sourceDir value.The generated output should be:
For
index.html
:For
other/other.html
it should be:It the gradle plugin would provide a
gradle-sourcedir
attribute with following value (relative path ofsourceDir
for thedocfile
being converted):docs/index.adoc
../
fordocs/other/other.adoc
It would be possible to use it like this:
:highlightjsdir: {gradle-sourcedir}highlight
In the mean time, I have solved it with a preprocessor: https://jmini.github.io/asciidoctorj-sourcedir/
The text was updated successfully, but these errors were encountered: