*Magnify*
SPONSORED LINKS
Printed from https://www.writing.com/main/forums/action/view/message_id/2546370
Rated: ASR · Message Forum · Writing.Com · #102362
Drop your new ideas into the Writing.Com Suggestion Box!
<< Previous  •  Message List  •  Next >>
Reply  •  Post New
Jul 22, 2013 at 3:25am
#2546370
Edited: July 23, 2013 at 1:02am
Re: Automatic Numbering ML?
*Dollar* 12,345 GPs were sent to Princess Zelda with this post.
This is now done! *Smile*

I was going to post this whole thing as a note in my notebook but it got too long...
Here's the full post... and I'm going to make a mini-post about it in my notebook.


So I was sitting here more or less having a seemingly endless internal fight about the best way to continue with some WDC code I'm working on when I note "Automatic Numbering ML?"  . It was just what the muse ordered for a diversion! I remember SMs requesting something like this as she was begrudgingly creating the outline in "Writing.Com 101... I checked 101 to make sure we didn't create it for that and then just forgot to release it! *Wink* Anyway...

A basic numberer just wouldn't do, so I bring you a beta release of the just-born multifaceted:
          {list} ML tag. *Cool*

Of course, you can do the simple "list"...
{list} first
{list} second
{list} third
And get:
1 first
2 second
3 third

But, you can also do...
{A-list} first
{A-list} second
{A-list} third
And get this:
A first
B second
C third

Or, you can also do...
{a-list} first
{a-list} second
{a-list} third
And get this:
a first
b second
c third

You can even mix-n-match and do this...
{A1-list} first
{A1-list} second
{A1-list} third
And get this:
A1 first
A2 second
A3 third

Or start from anywhere...
{119-list} first
{119-list} second
{119-list} third
And get this:
119 first
120 second
121 third

Or try this...
{Y-list} first
{Y-list} second
{Y-list} third
And get this:
Y first
Z second
AA third


Then it gets more interesting.
You can have multiple lists in the same WritingML area by "naming" them by adding the : to the tag.
For example, {list:this} counts separate from {list:that} and {list:thensome}.
They can be different sub-types (1, a, A) or the same.

{list:THIS} first
{indent}{a-list:THAT}) sub-first
{indent}{a-list:THAT}) sub-second
{indent}{a-list:THAT}) sub-third
{list:THIS} second
{list:THIS} third

And get this:
1 first
         a) sub-first
         b) sub-second
         c) sub-third
2 second
3 third


You can have many different lists in one WritingML area...
This post is a perfect example of that as each example is it's own list.
But here's one more example:
{list:List1} first {list:List2} first
{list:List1} second {list:List2} second
{list:List1} third {list:List2} third

And get this...
1 first 1 first
2 second 2 second
3 third 3 third


Well... that's the gist of {list} for now. Again, this is fresh out of the box beta-ness. I think it works pretty well, though. *Wink*

Thanks for the muse-ness!
~~SM

[EDIT: Appending the other additions so the docs are in one place for now...]



Basically within the brace, the whole tag can be as simple as this:
         { list }

or as complete as this:
         { type-list:name:optional-format }


Quick demo of the optional formatting, then lights out for me!

1) xxxx
2) xxx
3) xxx

It carries through once set for a given list (tracked by list name).
You can change the formatting at any point...
4. xxxx
5. xxx
6. xxx

Use % to indicate where the "list" data should go and get crazy...
<--< 7. >--> xxxx
<--< 8. >--> xxx
<--< 9. >--> xxx

[[10.]] xxx
[[11.]] xxxx
[[12.]] xxxx

[[13-13.]] xxx
[[14-14.]] xxxx
[[15-15.]] xxxx


Raw code:


{list:MyList:)} xxxx
{list:MyList} xxx
{list:MyList} xxx

It carries through once set for a given list (tracked by list name).
You can change the formatting at any point...
{list:MyList:.} xxxx
{list:MyList} xxx
{list:MyList} xxx

Use {b}%{/b} to indicate where the "list" data should go and get crazy...
{list:MyList:<--< %. >-->} xxxx
{list:MyList} xxx
{list:MyList} xxx

{list:MyList:[[%.]]} xxx
{list:MyList} xxxx
{list:MyList} xxxx

{list:MyList:[[%-%.]]} xxx
{list:MyList} xxxx
{list:MyList} xxxx





{b}Animals that are cool:{/b}
{100-list:animals:%--> } Cats
Cows
Sheep
Horses
Monkeys
Elephants
Hippos{/100-list}


Animals that are cool:
100--> Cats
101--> Cows
102--> Sheep
103--> Horses
104--> Monkeys
105--> Elephants
106--> Hippos
MESSAGE THREAD
Automatic Numbering ML? · 07-22-13 1:29am
by Princess Zelda
Re: Automatic Numbering ML? · 07-22-13 1:50am
by LostGhost: Seeking & Learning
*Star* Re: Automatic Numbering ML? · 07-22-13 3:25am
by The ScaryMaster
Re: Re: Automatic Numbering ML? · 07-22-13 3:51am
by Princess Zelda
Re: Re: Re: Automatic Numbering ML? · 07-22-13 3:59am
by The ScaryMaster
Re: Re: Automatic Numbering ML? · 07-22-13 4:08am
by LostGhost: Seeking & Learning
Re: Re: Automatic Numbering ML? · 07-22-13 4:22am
by LostGhost: Seeking & Learning
Re: Re: Re: Automatic Numbering ML? · 07-22-13 11:58pm
by The ScaryMaster
Re: Re: Re: Re: Automatic Numbering ML? · 07-23-13 12:50am
by LostGhost: Seeking & Learning

The following section applies to this forum item as a whole, not this individual post.
Any feedback sent through it will go to the forum's owner, The StoryWitchress.
Printed from https://www.writing.com/main/forums/action/view/message_id/2546370