jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
191 stars 61 forks source link

🐌 Fix slug generation for `.myst.json` files #1473

Closed agoose77 closed 3 weeks ago

agoose77 commented 3 weeks ago

Presently we use path.parse to strip away file extensions before slug generation. This PR replaces that logic with a custom parse function that understands the MyST extension list.

I'm not 100% sure whether talking about .myst.json as an extension rather than a "suffix" is a poor choice of language, but we're walking down this path for now.

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: fbd3ee850aa4a76eb29eefd6e3fd8ecf3ac729f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | -------- | ----- | | myst-cli | Patch | | mystmd | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

rowanc1 commented 3 weeks ago

Can you add a test case on the function!

This is something that we are doing in parseFile as well right - and I think there was custom logic for the extensions there that we had a fall through case or something - not sure if it is related?

agoose77 commented 3 weeks ago

@rowanc1 ah, brilliant -- well remembered. I've updated that method.