Skip to content

Document CommentDelimiters configuration option#64

Merged
jdkato merged 5 commits intovale-cli:masterfrom
fviolette:master
Nov 5, 2024
Merged

Document CommentDelimiters configuration option#64
jdkato merged 5 commits intovale-cli:masterfrom
fviolette:master

Conversation

@fviolette
Copy link

Featured in 3.8.0.
Original code contribution is vale-cli/vale#900

@netlify
Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for eclectic-semifreddo-be083c ready!

Name Link
🔨 Latest commit 4a85b76
🔍 Latest deploy log https://app.netlify.com/sites/eclectic-semifreddo-be083c/deploys/6729e19524069f0009054e99
😎 Deploy Preview https://deploy-preview-64--eclectic-semifreddo-be083c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jdkato
Copy link
Member

jdkato commented Nov 4, 2024

Thanks for working on this.

The intended use case for this is to replace the use of HTML syntax, so an example would look something like this:

[formats]
mdx = md

[*.mdx]
BasedOnStyles = Vale

CommentDelimiters = {/*, */}

and then it would be used like so:

{/* vale off */}

This is some text ACT test

This is some text ACT test

{/* vale on */}

{/* vale vale.Redundancy = NO */}

This is some text ACT test

{/* vale vale.Redundancy = YES */}

See testdata/fixtures/comments for a complete example.

@fviolette
Copy link
Author

fviolette commented Nov 5, 2024

Glad to hear this is how it should work (without the double HTML and the custom comment delimiters).

This is not working for me at the moment. I'm on macOS and using Vale 3.8.0.
The example I added was the only way to get it working (as a passthrough) but I'll update it as per your suggestion.

StylesPath = vale-styles

[formats]
mdx = md

[*.md]
BasedOnStyles = Vale

CommentDelimiters = {/*, */}

^ FWIW, [.mdx] or [.md] above produce the same. I also tried wrapping quotes around each comment delimiters.

{/* vale off */}

This is some text ACT test

This is some text ACT test

{/* vale on */}

{/* vale vale.Redundancy = NO */}

This is some text ACT test

{/* vale vale.Redundancy = YES */}

This is some text ACT test

This is some text ACT test

All 'ACT test' occurrences are firing for me.

Is there anything I'm doing wrong?

@fviolette
Copy link
Author

I got the testdata to work so it is on my side. I'll update the document after I fix this.
Thanks for leading me into the right direction 👍

@fviolette
Copy link
Author

Example updated.

@jdkato jdkato merged commit 3f212cf into vale-cli:master Nov 5, 2024
@fviolette fviolette mentioned this pull request Nov 6, 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