Support xref aka cross reference link fix in adoc #649
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I use JBake version 2.6.5 and adoc to write some blog. JBake has two configuration properties to fix relative image src. And they are
img.path.update
andimg.path.prepend.host
. These two properties only affectimg
tag and it'ssrc
attribute.But in adoc, we can add a reference in one doc to another by for example
xref:a-gentle-introduction-to-multithreading.adoc[introduction]
, like image , this will generate a<a href='a-gentle-introduction-to-multithreading.html''>...</>
tag with relative path. This need fix too.I introduce three new properties,
relative.path.update
,relative.path.prepend.host
andrelative.tag.attribute
.relative.path.update
andrelative.path.prepend.host
are for configuring all relative paths updates, not justimg
tag. And the third propertyrelative.tag.attribute
defines which tags need fix, for examplerelative.tag.attribute=img=src,a=href
.For backward compatible, both the new and old properties should work.
With a false default value, we should use the properties this way
boolean pathUpdate = config.getImgPathUpdate() || config.getRelativePathUpdate()
With a true default value, we should use the properties this way:
boolean prependSiteHost = configuration.getImgPathPrependHost() && configuration.getRelativePathPrependHost();