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

Add more custom format specifiers #85

Merged
merged 9 commits into from
Feb 9, 2024

Conversation

merlinz01
Copy link
Contributor

Add {x0} through {x10} custom format specifiers to enable finer format customizations.
Also add a {nl} specifier to insert a newline for multiline formats.

Example custom format:
// __NAME__ {B}{nl}const __NAME__: GUID = GUID {data1: 0x{x0}, data2: 0x{x1}, data3: 0x{x2}, data4: [0x{x3}, 0x{x4}, 0x{x5}, 0x{x6}, 0x{x7}, 0x{x8}, 0x{x9}, 0x{x10}]};

Result:

// __NAME__ {C6156C70-C766-4962-AFF1-30C56AAAA892}
const __NAME__: GUID = GUID {data1: 0xc6156c70, data2: 0xc766, data3: 0x4962, data4: [0xaf, 0xf1, 0x30, 0xc5, 0x6a, 0xaa, 0xa8, 0x92]};

@merlinz01 merlinz01 mentioned this pull request Feb 8, 2024
Copy link
Owner

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Thanks! This is great. Could you add some tests for guid.ts changes, though? I'll make a few adjustments to the docs - I should've documented that better in the README.md when those changes were added - but will then go ahead and merge this.

@merlinz01
Copy link
Contributor Author

I added tests, see this commit.

Copy link
Owner

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Thank you! I'm going to clean up docs a little - something I should've done before - and get this merged.

@heaths heaths changed the title add more custom format specifiers Add more custom format specifiers Feb 9, 2024
@heaths heaths force-pushed the more-custom-formats branch 4 times, most recently from dd33e89 to 09c9802 Compare February 9, 2024 03:10
@heaths heaths enabled auto-merge (squash) February 9, 2024 03:12
@heaths heaths merged commit b5c7f5f into heaths:main Feb 9, 2024
8 checks passed
@heaths
Copy link
Owner

heaths commented Feb 9, 2024

v1.9.0 with this change has been released. Thank you again!

@heaths heaths mentioned this pull request Feb 9, 2024
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.

2 participants