Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hello,
I probably overlooked it while searching the docmentation, so sorry if it is an obvious answer. Having used the maven docbkx plugin up to now (where this feature was available), I am looking for a way to incorporate the project version number (a maven property) and pass it to a macro in asciidoc. What would be the best way to achieve that result ? Jmm |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
<plugin>
<groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-maven-plugin</artifactId> <version>${asciidoctor.version}</version> <configuration> <doctype>article</doctype> <backend>html5</backend> <attributes> <copycss>true</copycss> <version>${myproject.version}</version> <source-highlighter>highlightjs</source-highlighter> <idprefix></idprefix> <idseparator>-</idseparator> </attributes> </configuration> </plugin> Then in the document you can use: Document version: {version} |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks. It looks like what I am looking for. I will try it out.
Jmm |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by Jmm
Good news! This is possible using a custom attribute. The attribute is defined in the same way as built-in attributes the the source highlighter. The only difference is that the value needs to be a Maven property / variable reference. It should work just like you define other properties in Maven. Then you refer to it in AsciiDoc like {project-version}. I can get more specific if you need once I'm at my laptop. -Dan On Nov 14, 2013 2:04 PM, "Jmm [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
Hello, ... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
It works as advertised
![]() Thanks for the hints. Jmm |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Awesome! We'll get that documented. Jason, can you add that to the readme when you update it for the upcoming release? -Dan On Nov 14, 2013 9:43 PM, "Jmm [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
It works as advertised |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I see the issue, I'll get it out there (in the documentation) for 0.1.4 or 0.1.4.1 On Sat, Nov 16, 2013 at 2:32 AM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I'm trying to pass the maven ${project.version} to asciidoctor this way, and want to use it in my document header
If I put {version}, 2014-11-05 The variable does not get resolved. When I put {version} 2014-11-05 The variable *does* get resolved but this is not the standard revision line format so the document date no longer gets recognized properly. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
I've added this use case to the examples repository. You can see where I define the project-version attribute here: And where I use it in the document here: Unfortunately, attributes _are not_ resolved in the revnumber position in the implicit revision line: v{project-version}, 2014-01-01 Therefore, you have to assign the project-version to the revnumber attribute explicitly instead: 2014-01-01 :revnumber: {project-version} Then, the revision number of the document will match the version of the project. Cheers, -Dan On Wed, Nov 5, 2014 at 2:31 PM, jpraet [via Asciidoctor :: Discussion] <[hidden email]> wrote: I'm trying to pass the maven ${project.version} to asciidoctor this way, and want to use it in my document header ... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Free forum by Nabble | Edit this page |