iainbrighton/PScribo

Support for lists

Opened this issue · 8 comments

Would be handy to support numbered or bullet list - with nesting/indenting,

I envisage the implementation to be something like this:

## Create a single-level bullet list of items
List [-Items] [string[]]

## Create a single-level numbered list of items
List [-Items] [string[]] -Numbered

## Create a multi-level bullet list
List [-ScriptBlock] {
    Item 'apples'
    List {
        Item 'Granny smith'
        Item 'Pink lady'
    }
    Item 'bananas'
    Item 'oranges'
    List {
       Item 'Jaffa'
    }
}

## Create a multi-level numbered list
List -Numbered [-ScriptBlock] {
    Item 'apples' # 1
    List {
        Item 'Granny smith' # 1.1
        Item 'Pink lady' # 1.2
    }
    Item 'bananas' # 2
    Item 'oranges' # 3
    List {
        Item 'Jaffa' # 3.1
    }
}

Are there any other implementations or options that are needed?

An option for a custom format would be useful. I have a requirement in some of my documents to produce lists with a custom prefix and format.

e.g. XYZ-001, XYZ-002, XYZ-003

@tpcarman I'm not aware of bulleted lists can have custom formats. Can you provide an example of what you're after?

Within Word it's considered a custom numbered list, not bullet list.

image

@tpcarman Hmmm - I can't see how that could ever be implemented in Html and/or Markdown. Putting features in just for Word seems to be in conflict with the PScribo philosophy. I'll mull on it some more.

Don’t do it If it’s specifically for Word however if there is someway that you think of to make it work for all document formats then that would be fantastic.

@tpcarman this functionality is now available in the dev branch for testing (including custom number formats!). I won't publish it until I have confirmation from a few sources that it's not "broken"!

I hate to stretch the friendship @iainbrighton, but do you think it would be possible to include lists within tables at some point in the future? I can't actually see how this could work for all formats however I thought I should at least ask the question. 😉