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

Remove .mbd / .mbdf #1672

Closed
ang-zeyu opened this issue Sep 18, 2021 · 11 comments · Fixed by #1762
Closed

Remove .mbd / .mbdf #1672

ang-zeyu opened this issue Sep 18, 2021 · 11 comments · Fixed by #1762

Comments

@ang-zeyu
Copy link
Contributor

I probably don't have the relevant context but this has been bugging me for a very long time now anyway =X
What's the purpose of these extra extensions?

.mbdf is used to denote "fragment" but really other than that, it dosen't provide any concrete value. My opinion thus is that file organisation / hierarchy here is a responsibility that should be left to the user. There are already many cases where you would need to <include> from a non .mbdf file.

.mbd files on the other hand don't really seem to have a use case.

I don't think we should be reinventing the wheel when it comes to file extensions here and should just stick with the canonical default (.md), for familiarity.

There's also the issue of syntax highlighting in ides that needs to be manually configured for mbd / mbdf files (which sometimes isn't even an option)

*This is a huge breaking change of course.

@ang-zeyu ang-zeyu added the s.UnderDiscussion The team will evaluate this issue to decide whether it is worth adding label Sep 18, 2021
@damithc
Copy link
Contributor

damithc commented Sep 18, 2021

Context:

  • .md is already used by Markdown, and ours is not strictly Markdown. We thought it's good to allow another extension in case an author wants to distinguish between the two (also, to avoid being accused of hijacking someone else's extension) while still allowing the use of .md.
  • .mbdf is useful to easily exclude fragments from page generation e.g.,
"pages": [
    {
      "glob": ["**/*.+(md|mbd)"]
    }

@ang-zeyu
Copy link
Contributor Author

.mbdf is useful to easily exclude fragments from page generation

That makes sense.

How about

"pagesExclude": ["xx_fragment_or_some_other-user-defined-suffix.md"],

?
This was introduced more recently with #1328

We can leave the definition of fragments to the user for more flexibility; or it can be defined on folder basis as well.

.md is already used by Markdown, and ours is not strictly Markdown. We thought it's good to allow another extension in case an author wants to distinguish between the two (also, to avoid being accused of hijacking someone else's extension) while still allowing the use of .md.

Is this for .mbd?

@damithc
Copy link
Contributor

damithc commented Sep 18, 2021

How about

"pagesExclude": ["xx_fragment_or_some_other-user-defined-suffix.md"],

?
This was introduced more recently with #1328

yes, that can work too. We can tweak the default site.json to exclude *.mbdf so that the author has an example to follow.

.md is already used by Markdown, and ours is not strictly Markdown. We thought it's good to allow another extension in case an author wants to distinguish between the two (also, to avoid being accused of hijacking someone else's extension) while still allowing the use of .md.

Is this for .mbd?

Yup.

@ang-zeyu
Copy link
Contributor Author

Yup.

.md is already used by Markdown, and ours is not strictly Markdown

I think this is fine if that's the case; A lot of the other ssgs out there don't have custom file extensions as well. I feel that familiarity (and default syntax highlighting) should take priority here.

We thought it's good to allow another extension in case an author wants to distinguish between the two

I see, I might imagine someone might need to process canonical .md files differently inside a project at some time, but even then, there should probably be some very easy alternative for such a structure if that sort of flexibility is needed and present anyway (e.g. place all such "canonical" files in one folder and markbind specific ones in another). But it really depends on the toolchain / project / etc.

Even if not, I think we should be striving for familiarity and reducing markbind's complexity as these use cases are likely really rare.

to avoid being accused of hijacking someone else's extension

🤣🤣 really really low probability imo. .md is free real estate.

@damithc
Copy link
Contributor

damithc commented Sep 18, 2021

I almost never use .mbd (but I use mbdf sometimes). No objections to removing both if it helps.

@ang-zeyu
Copy link
Contributor Author

👍

Let's do that then if there's no objections; But we can slate this for v4 in a few more months time since its a breaking change

@ang-zeyu ang-zeyu added a-AuthorUsability d.easy p.Low and removed s.UnderDiscussion The team will evaluate this issue to decide whether it is worth adding labels Dec 23, 2021
@ang-zeyu ang-zeyu added this to the 4.0 milestone Dec 23, 2021
@ong6
Copy link
Contributor

ong6 commented Feb 11, 2022

Assuming we do remove .mbd and .mbdf users who are currently using these file names will have to go and rename them, would this be a big issue for the users? Or should the change still allow .mbd and .mbdf to exist?

@damithc
Copy link
Contributor

damithc commented Feb 11, 2022

How about

"pagesExclude": ["xx_fragment_or_some_other-user-defined-suffix.md"],

? This was introduced more recently with #1328

Just to be clear, after removing support for .mbd and mbdf, what's the best way to specify that I want all fragment files to be excluded from rendering.

  1. Can I use any extension I wish for such files, including .mbdf? I guess the answer is 'no'?
  2. If not, let's say I decide to use **-fragment.md pattern for such files. Is it possible to capture that into a single pagesExclude pattern? Asking because I'm not sure how flexible glob pattern syntax is. I don't think it's as flexible as regular expressions.

@ang-zeyu
Copy link
Contributor Author

Assuming we do remove .mbd and .mbdf users who are currently using these file names will have to go and rename them, would this be a big issue for the users? Or should the change still allow .mbd and .mbdf to exist?

Can I use any extension I wish for such files, including .mbdf? I guess the answer is 'no'?

Nope, its a breaking change

If not, let's say I decide to use **-fragment.md pattern for such files. Is it possible to capture that into a single pagesExclude pattern? Asking because I'm not sure how flexible glob pattern syntax is. I don't think it's as flexible as regular expressions.

Something like **/*-fragment.md should work

@ong6 ong6 mentioned this issue Feb 12, 2022
9 tasks
@damithc
Copy link
Contributor

damithc commented Feb 12, 2022

Assuming we do remove .mbd and .mbdf users who are currently using these file names will have to go and rename them, would this be a big issue for the users? Or should the change still allow .mbd and .mbdf to exist?

Can I use any extension I wish for such files, including .mbdf? I guess the answer is 'no'?

Nope, its a breaking change

If not, let's say I decide to use **-fragment.md pattern for such files. Is it possible to capture that into a single pagesExclude pattern? Asking because I'm not sure how flexible glob pattern syntax is. I don't think it's as flexible as regular expressions.

Something like **/*-fragment.md should work

Sounds good. Thanks for the clarification @ang-zeyu

@ong6
Copy link
Contributor

ong6 commented Feb 13, 2022

Something like **/*-fragment.md should work

I've just tested this out and it works. I will be adding this feature under a custom-fragments section in the ug

jonahtanjz pushed a commit that referenced this issue Feb 16, 2022
Syntax parsers do not work with `.mbdf` and `.mbd` and
this functionality could be implemented using other means (e.g. pagesExclude)

Refer to this for the full discussion #1672.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants