iainbrighton/PScribo

new 'List' feature

Opened this issue · 7 comments

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?

Originally posted by @iainbrighton in #105 (comment)

Hello,

First of all, thank you for your work.
I saw in this post from 2020 that you were developing this feature.
Do you plan to release this feature?
For my part, I need two formats: Unordered and Ordered List

Thank you.

Cordially,

Thomas.

Sorry for the tardy response. Yes, I have this functionality working in the Issue105 branch (used internally) and will look to publish it soon.

Sorry for the tardy response. Yes, I have this functionality working in the Issue105 branch (used internally) and will look to publish it soon.

Hi, do you have a release date for the new version?
Thanks!

@datenschieber this functionality is now available in the dev branch for testing. I won't publish it until I have confirmation from numerous sources that it's not "broken"!

Great work @iainbrighton! 👏 I'm starting to test this now.

My initial feedback is that I think the following needs to be added to the comment based help to provide some clarity.

  • Bullet styles which can be used - Square, Dash, Disc, Circle. Are there any others?
  • The limitations for bullet/number formats in Word and HTML. The lack of Word support for the mixed bullet/number formats at the same level caught me out initially. I found the answer in the Example script, but not the command based help.
  • Bullet styles which can be used - Square, Dash, Disc, Circle. Are there any others?

Word supports pretty much anything, but these are unordered list options supported in the Html standard(s). I don't forsee any need to extend this functionality for only Word output. If we had a custom renderer (see below), this might be a possibility.

  • The limitations for bullet/number formats in Word and HTML. The lack of Word support for the mixed bullet/number formats at the same level caught me out initially. I found the answer in the Example script, but not the command based help.

I'll add some additional help here.

Word doesn't support mixed bullet/number types at the same level so there's not a lot we can do here.

As for supporting Html rendering of custom number formats; it's not insurmountable, but we'd have to create a custom Html table to support this. The current implementation uses the default ordered list option available in the Html standard(s) which is a good start - additional support could be added later.

Word supports pretty much anything, but these are unordered list options supported in the Html standard(s). I don't forsee any need to extend this functionality for only Word output. If we had a custom renderer (see below), this might be a possibility.

I'm not suggesting we extend it beyond the default bullet styles, just simply documenting what the default bullet styles are in the command based help.

@iainbrighton This works for me. Any plan to release this in a new version?