Login  Register

Overriding built-in attributes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Overriding built-in attributes

daveb
Not sure if built-in attributes and intrinsic attributes are the same thing and you can override one but not the other.

I wish to override docdate and doctime (or docdatetime) and I have tried as an experiment using:

:docdate:   my date

in the document and also via the API, but I am not able to get it to change.

The reason why I want to do this is because the final document is composed of several adoc files (some auto generated) and I would like the last updated message in the footer to reflect the newest of all the adoc files making up the document and not just the 'master' document.  My build system will find the latest date and pass it in through the API so I am not expecting asciidoctor determine this for me.

The user manual says you can override the intrinsic attributes but it doesn't seem to be working for me.  I am using version 1.5.2

Thanks,

Dave.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

LightGuardjp
Have you tried using the command line -a to override?

On Thursday, October 1, 2015, daveb [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Not sure if built-in attributes and intrinsic attributes are the same thing and you can override one but not the other.

I wish to override docdate and doctime (or docdatetime) and I have tried as an experiment using:

:docdate:   my date

in the document and also via the API, but I am not able to get it to change.

The reason why I want to do this is because the final document is composed of several adoc files (some auto generated) and I would like the last updated message in the footer to reflect the newest of all the adoc files making up the document and not just the 'master' document.  My build system will find the latest date and pass it in through the API so I am not expecting asciidoctor determine this for me.

The user manual says you can override the intrinsic attributes but it doesn't seem to be working for me.  I am using version 1.5.2

Thanks,

Dave.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Overriding-built-in-attributes-tp3784.html
To start a new topic under Asciidoctor :: Discussion, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs49171n1h37@n6.nabble.com&#39;);" target="_blank">ml-node+s49171n1h37@...
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Sent from Gmail Mobile
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

daveb
Just tried

asciidoctor -a docdatetime=XXX test.adoc

and the footer didn't change.

I need to do this via the API in any event.

Dave.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

mojavelinux
Administrator
The docdate, doctime and docdatetime attributes were not meant to be overridden. What you probably want to do is disable the automatic footer text. You can do that by undefining the last-update-label attribute:

:last-update-label!:

That just drops the date part. Another solution is to disable the footer altogether:

:nofooter:

You can then add your own footer in using a footer docinfo file.

There is an open issue to set the doc date/time attributes to the timestamp of the most recent include.

Cheers,

-Dan

On Thu, Oct 1, 2015 at 9:25 AM, daveb [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Just tried

asciidoctor -a docdatetime=XXX test.adoc

and the footer didn't change.

I need to do this via the API in any event.

Dave.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Overriding-built-in-attributes-tp3784p3788.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

daveb
Hi Dan,

I realise I could 'roll my own' but using docdate and doctime would be very convenient.

mojavelinux wrote
There is an open issue to set the doc date/time attributes to the timestamp
of the most recent include.
--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
This would be a welcome addition, however it doesn't cope with the case when content is injected using an extension and the source of this contented is dated, as in my case.

Allowing docdate and doctime to be user mutable would seem to give the best of all worlds.  

Dave.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

mojavelinux
Administrator

On Fri, Oct 2, 2015 at 1:03 AM, daveb [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Allowing docdate and doctime to be user mutable would seem to give the best of all worlds.  

Could you file an issue? I hadn't considered the case before, but it's pretty clear that there are cases when only the API will know the right doc date/time (usually when it is sourced from another location such as a database or web service).

-Dan


--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

daveb
Issue raised together with the fix I have applied to my local version of asciidoctor.

Dave.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Overriding built-in attributes

mojavelinux
Administrator
Thanks Dave!

-Dan

On Fri, Oct 2, 2015 at 4:50 AM, daveb [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Issue raised together with the fix I have applied to my local version of asciidoctor.

Dave.



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Overriding-built-in-attributes-tp3784p3800.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen