Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Strings for TableStyle delimiters. #21

Merged
merged 4 commits into from
Sep 26, 2021
Merged

Conversation

Xitian9
Copy link
Collaborator

@Xitian9 Xitian9 commented Sep 4, 2021

Fixes #17.

This allows a greater range of delimiters allowed in tables, including multi-character delimiters like ||, or null delimiters "". This furthermore allows us to create tables with no outer borders.

Here are two examples of new table styles created with this.

Using asciiDoubleS:

├────────────────────────────┼───────────────────────────────────────────────────────────────────┤
│                            │        ++-------------------++-------------------++-----++        │
│  len spec: expand          │        ||     Some text     ||   Some numbers    ||  X  ||        │
│  position: left            │        ++-------------------++-------------------++-----++        │
│ alignment: no align        │        || This is long text || 4.20000000        || foo ||        │
│                            │        || Short             || 200300400500600.2 || bar ||        │
│                            │        ++-------------------++-------------------++-----++        │
├────────────────────────────┼───────────────────────────────────────────────────────────────────┤

Using withoutBorders unicodeS:

├────────────────────────────┼───────────────────────────────────────────────────────────────────┤
│  len spec: expand          │                Some text     │   Some numbers    │  X             │
│  position: left            │           ═══════════════════╪═══════════════════╪═════           │
│ alignment: no align        │            This is long text │ 4.20000000        │ foo            │
│                            │            Short             │ 200300400500600.2 │ bar            │
├────────────────────────────┼───────────────────────────────────────────────────────────────────┤

@Xitian9 Xitian9 changed the title Allow Strings for TableStyle delimeters. Allow Strings for TableStyle delimiters. Sep 5, 2021
src/Text/Layout/Table/Style.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Style.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Style.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Style.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Primitives/Table.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Primitives/Table.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table.hs Show resolved Hide resolved
src/Text/Layout/Table.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table.hs Outdated Show resolved Hide resolved
@Xitian9 Xitian9 force-pushed the stringsep branch 3 times, most recently from f50d3cf to 6246380 Compare September 12, 2021 12:37
@Xitian9
Copy link
Collaborator Author

Xitian9 commented Sep 12, 2021

I think I've addressed all the comments. Let me know if you'd like other changes.

Copy link
Owner

@muesli4 muesli4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it seems fine to me. After those small changes are done I will merge it.

And I wanted to take the chance to say thank you again for your work and your patience. I know how much it sucks having to wait for a review on open source projects. I promised myself to never do it this way but I guess I understand the reasons why this happens now. ;)

src/Text/Layout/Table.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Primitives/Table.hs Outdated Show resolved Hide resolved
src/Text/Layout/Table/Style.hs Outdated Show resolved Hide resolved
In TableStyle, split vertical separators into left, centre, and right variants.

groupV -> groupL, groupC, and groupR
headerV -> headerL, headerC, and headerR
@Xitian9
Copy link
Collaborator Author

Xitian9 commented Sep 26, 2021

Updated. Let me know if that's satisfactory.

And don't worry about the wait; thank you for maintaining this wonderful library!

@muesli4 muesli4 merged commit 8ed880a into muesli4:master Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Strings in TableStyle
2 participants