Login  Register

Auto Increment Label

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

Auto Increment Label

asotobu
Today has come an idea which I think that it is supported yet by Asciidoctor, and moreover it is not in AsciiDoc standard, but I think can be useful in some circumstances. I am thinking in next scenario:

Let's suppose we are writing SRS of a product, and probably I want to give them a number, for example SRS-1, SRS-2, ....

how about creating an auto increment label so for example we can create an attribute which must ends with counter:

:srs-identification-counter: 1

and then each time this attribute is used, value is incremented by one, so for example:

== Fluidic System

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-{srs-identification-counter}
|bla bla bla

|SRS-{srs-identification-counter}
|bla bla bla
|===

which will be equivalent to:

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-1
|bla bla bla

|SRS-2
|bla bla bla
|===

Of course there are some problems to resolve, for example what's happen when you include another AsciiDoc file that are already using the same counter, but I think can simplify of having to maintain manually incremental values, or for example defining twice.

WDYT?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Auto Increment Label

LightGuardjp
That sounds very interesting, but I'm not sure I'd want it in Asciidoctor, or actually have it be something that comes out of the box. I'd much rather see this as something you could do with a macro. I can certainly see the need in macros containing some sort of state.


On Thu, Jul 25, 2013 at 9:48 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Today has come an idea which I think that it is supported yet by Asciidoctor, and moreover it is not in AsciiDoc standard, but I think can be useful in some circumstances. I am thinking in next scenario:

Let's suppose we are writing SRS of a product, and probably I want to give them a number, for example SRS-1, SRS-2, ....

how about creating an auto increment label so for example we can create an attribute which must ends with counter:

:srs-identification-counter: 1

and then each time this attribute is used, value is incremented by one, so for example:

== Fluidic System

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-{srs-identification-counter}
|bla bla bla

|SRS-{srs-identification-counter}
|bla bla bla
|===

which will be equivalent to:

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-1
|bla bla bla

|SRS-2
|bla bla bla
|===

Of course there are some problems to resolve, for example what's happen when you include another AsciiDoc file that are already using the same counter, but I think can simplify of having to maintain manually incremental values, or for example defining twice.

WDYT?


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



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

Re: Auto Increment Label

asotobu
Yes macros could be another way but I don t know if it would be possible with current implementation. For now I am waiting for having extensions support on asciidoctor master branch to implement it on asciidoctor java integration project. And then we can decide what to do

El dijous 25 de juliol de 2013, LightGuardjp [via Asciidoctor :: Discussion] ha escrit:
That sounds very interesting, but I'm not sure I'd want it in Asciidoctor, or actually have it be something that comes out of the box. I'd much rather see this as something you could do with a macro. I can certainly see the need in macros containing some sort of state.


On Thu, Jul 25, 2013 at 9:48 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Today has come an idea which I think that it is supported yet by Asciidoctor, and moreover it is not in AsciiDoc standard, but I think can be useful in some circumstances. I am thinking in next scenario:

Let's suppose we are writing SRS of a product, and probably I want to give them a number, for example SRS-1, SRS-2, ....

how about creating an auto increment label so for example we can create an attribute which must ends with counter:

:srs-identification-counter: 1

and then each time this attribute is used, value is incremented by one, so for example:

== Fluidic System

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-{srs-identification-counter}
|bla bla bla

|SRS-{srs-identification-counter}
|bla bla bla
|===

which will be equivalent to:

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-1
|bla bla bla

|SRS-2
|bla bla bla
|===

Of course there are some problems to resolve, for example what's happen when you include another AsciiDoc file that are already using the same counter, but I think can simplify of having to maintain manually incremental values, or for example defining twice.

WDYT?


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



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Auto-Increment-Label-tp393p395.html
To unsubscribe from Auto Increment Label, click here.
NAML


--
Enviat amb Gmail Mobile
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Auto Increment Label

mojavelinux
Administrator
In reply to this post by LightGuardjp
It's already available today as I describe in this issue:


I'm glad you brought the idea forward because it's a nice feature and needed to be documented.

-Dan


On Thu, Jul 25, 2013 at 10:45 AM, LightGuardjp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
That sounds very interesting, but I'm not sure I'd want it in Asciidoctor, or actually have it be something that comes out of the box. I'd much rather see this as something you could do with a macro. I can certainly see the need in macros containing some sort of state.


On Thu, Jul 25, 2013 at 9:48 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Today has come an idea which I think that it is supported yet by Asciidoctor, and moreover it is not in AsciiDoc standard, but I think can be useful in some circumstances. I am thinking in next scenario:

Let's suppose we are writing SRS of a product, and probably I want to give them a number, for example SRS-1, SRS-2, ....

how about creating an auto increment label so for example we can create an attribute which must ends with counter:

:srs-identification-counter: 1

and then each time this attribute is used, value is incremented by one, so for example:

== Fluidic System

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-{srs-identification-counter}
|bla bla bla

|SRS-{srs-identification-counter}
|bla bla bla
|===

which will be equivalent to:

[cols="1,2" options="header"]
.Fluidic SRS
|===
|SRS
|Description

|SRS-1
|bla bla bla

|SRS-2
|bla bla bla
|===

Of course there are some problems to resolve, for example what's happen when you include another AsciiDoc file that are already using the same counter, but I think can simplify of having to maintain manually incremental values, or for example defining twice.

WDYT?


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



--



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



--