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 .mbdf and .mbd #1762

Merged
merged 46 commits into from
Feb 16, 2022
Merged

Remove .mbdf and .mbd #1762

merged 46 commits into from
Feb 16, 2022

Conversation

ong6
Copy link
Contributor

@ong6 ong6 commented Feb 12, 2022

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

Fixes #1672

Overview of changes:

Removes allowing of .mbdf and .mbd as file extension types.

  • Added new section in UG documentation under reusing contents called Creating Custom Fragments, view here
  • Updated all related core and cli files using .mbdf and .mbd
  • Updated all existing documentation referring to .mbdf and .mbd.
  • Updated existing test cases to remove .mbdf and .mbd
  • Added new test for custom-fragment.md
  • Fixed typos/errors in documentation found while updating docs (may be unrelated change)

Anything you'd like to highlight / discuss:

Some context for this PR:

  • .mbd was created with the intent of making our own extension called .markbind
  • .mbdf was created to easily exclude fragments from page generation
  • Since the addition of pagesExclude with PR Add site.json properties for file exclusions #1328, the definition of fragments can be described by the users hence rendering the first 2 points obsolete.

Testing instructions:

  • Run npm run test in packages/cli
  • All test cases should pass

Proposed commit message: (wrap lines at 72 characters)

Remove .mbdf and .mbd as markbind supported file extensions.

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 disscussion #1672.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

@ong6 ong6 changed the title Pulled from Master Remove .mbdf and .mbd Feb 12, 2022
@damithc
Copy link
Contributor

damithc commented Feb 12, 2022

As this is a breaking change, we won't be able to do any v3.* releases (unless as hot patches to previous release) after merging this PR, right?

@ong6
Copy link
Contributor Author

ong6 commented Feb 12, 2022

@damithc Actually I'm not too sure about this maybe @ang-zeyu can respond?

I think its good SWE practice to release this as a new version though? Since this will indeed remove all support for existing .mbdf and .mbd files.

Perhaps I can include a new markbind command to fix all the old .mbdf and .mbd files? Thoughts on this?

@ong6 ong6 marked this pull request as ready for review February 13, 2022 07:25
@ong6 ong6 marked this pull request as draft February 13, 2022 07:33
@damithc
Copy link
Contributor

damithc commented Feb 13, 2022

@ong6 at the same time, can you insert a tip somewhere in the user docs to guide authors on how to exclude fragment files from rendering?

@jonahtanjz
Copy link
Contributor

jonahtanjz commented Feb 13, 2022

As this is a breaking change, we won't be able to do any v3.* releases (unless as hot patches to previous release) after merging this PR, right?

Yup. Will need to create a separate branch for hot patches releases (if any) after this is merged.

@ong6
Copy link
Contributor Author

ong6 commented Feb 14, 2022

@ong6 Good work! I have highlighted some minor issues in the user guide. Since this PR is a breaking change, perhaps we can have a more detailed proposed commit message to explain a little bit more about the context?

@tlylt @jovyntls
Thanks spotting the errors! I've made the changes, perhaps instead of a more detailed explanation in the commit message, I will update the highlight/discussion part instead?

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Nice work @ong6!

Thanks @tlylt and @jovyntls for the reviews 👍

Since this PR is a breaking change, perhaps we can have a more detailed proposed commit message to explain a little bit more about the context?

I've made the changes, perhaps instead of a more detailed explanation in the commit message, I will update the highlight/discussion part instead?

I think it's better to put it in the commit message as it will be easier to track from the commit history.

packages/cli/index.js Outdated Show resolved Hide resolved
packages/cli/index.js Outdated Show resolved Hide resolved
packages/cli/index.js Show resolved Hide resolved
packages/core/src/utils/fsUtil.js Outdated Show resolved Hide resolved
@ong6
Copy link
Contributor Author

ong6 commented Feb 15, 2022

Nice work @ong6!

Thanks @tlylt and @jovyntls for the reviews 👍

Since this PR is a breaking change, perhaps we can have a more detailed proposed commit message to explain a little bit more about the context?

I've made the changes, perhaps instead of a more detailed explanation in the commit message, I will update the highlight/discussion part instead?

I think it's better to put it in the commit message as it will be easier to track from the commit history.

Thanks for the review @jonahtanjz I've made all the suggested changes!

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes @ong6

Just 2 more comments :)

@@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs-extra');
const ensurePosix = require('ensure-posix-path');

const markdownFileExts = ['.md', '.mbd', '.mbdf'];
const markdownFileExts = '.md';
Copy link
Contributor

Choose a reason for hiding this comment

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

Will have to update isMarkdownFileExt method as well since it is no longer an array. Can use === instead of includes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Includes will still work with strings, so there should be no issue with this particular case. Unless the change is for readability reasons?

image

Copy link
Contributor

@jonahtanjz jonahtanjz Feb 16, 2022

Choose a reason for hiding this comment

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

I believe this will give false positives? Although unlikely, but files with extension .m or having no extension will be returned as true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh ok I see, will implement the change then!

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Thanks @ong6 :) You may want to update the commit message as well following this template.

Other than that the rest looks good 👍

packages/cli/index.js Outdated Show resolved Hide resolved
@ong6
Copy link
Contributor Author

ong6 commented Feb 16, 2022

Thanks @ong6 :) You may want to update the commit message as well following this template.

Other than that the rest looks good 👍

Oh nice spot, didn't realize that issue also! Thanks for checking my PR once again. I have updated the commit message as well!

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Thanks @ong6 :)

LGTM 👍

@jonahtanjz jonahtanjz added this to the 4.0 milestone Feb 16, 2022
@jonahtanjz jonahtanjz merged commit 0554eda into MarkBind:master Feb 16, 2022
@jonahtanjz jonahtanjz added the breakingChange 💥 Feature will behave significantly different, or is made obsolete label Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakingChange 💥 Feature will behave significantly different, or is made obsolete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove .mbd / .mbdf
5 participants