iainbrighton / PScribo

PowerShell documentation framework
MIT License
230 stars 35 forks source link

Support for lists #105

Open iainbrighton opened 4 years ago

iainbrighton commented 4 years ago

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

iainbrighton commented 4 years ago

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?

tpcarman commented 4 years ago

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

iainbrighton commented 4 years ago

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

tpcarman commented 4 years ago

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

image

iainbrighton commented 4 years ago

@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.

tpcarman commented 4 years ago

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.

iainbrighton commented 1 year ago

@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"!

tpcarman commented 1 year ago

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. :wink: