Skip to content

Add @m2d/remark-docx to the plugins list#1431

Merged
wooorm merged 3 commits intoremarkjs:mainfrom
tiny-md:update-plugins
Apr 9, 2025
Merged

Add @m2d/remark-docx to the plugins list#1431
wooorm merged 3 commits intoremarkjs:mainfrom
tiny-md:update-plugins

Conversation

@mayank1513
Copy link
Contributor

@mayank1513 mayank1513 commented Mar 24, 2025

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

  • 🟢 @m2d/remark-docx
    — compile markdown to docx with support for GFM, tables, html, and more.

* 🟢 [`@m2d/remark-docx`](https://github.com/inokawa/remark-docx)
  — compile markdown to docx with support for GFM, tables, html, and more.
@github-actions github-actions bot added the 👋 phase/new Post is being triaged automatically label Mar 24, 2025
@github-actions

This comment has been minimized.

@codecov
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a185821) to head (6349f8d).
Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1431   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          142       138    -4     
=========================================
- Hits           142       138    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ChristianMurphy
Copy link
Member

Thanks for sharing @mayank1513! 🙇
A few thoughts:

@mayank1513
Copy link
Contributor Author

Thank you for the feedback.

  1. I am trying to support both, node.js and browser environments. In my case, I needed to convert to docx on client side. However, the package supports both client and server. With a few more features on client side compared to server side at the moment.

  2. Thanks for the suggestion. Can you please let me know a bit more about the hazards.

  3. Thanks, Will fix ASAP

  4. @m2d/mdast is extended version of @types/mdast to support fragments and a few other custom nodes. This is used only internally and for @m2d/* plugins.

  5. I will go through the visitor pattern and see if I can implement it here. The idea here is to support extending the functionality of core engine via plugins. Example of official plugins - @m2d/html, @m2d/table, @m2d/image, etc. A few more handling yaml, code styling, etc. are planned to be released soon.

@mayank1513
Copy link
Contributor Author

Publish a patch - moving docx to deps instead of peerDeps

@JounQin
Copy link
Member

JounQin commented Mar 27, 2025

@mayank1513
The link in PR description is wrong.
Please change the PR title more meaningful.

@ChristianMurphy
Copy link
Member

Thanks for the suggestion. Can you please let me know a bit more about the hazards.

https://github.com/GeoffreyBooth/dual-package-hazard?tab=readme-ov-file#dual-package-hazard

mayank1513 added a commit to md2docx/remark-docx that referenced this pull request Mar 28, 2025
@mayank1513
Copy link
Contributor Author

https://github.com/GeoffreyBooth/dual-package-hazard?tab=readme-ov-file#dual-package-hazard

Thanks, for now I think going with both CJS and ESM is good option. I do not find this very likely to happen. Besides, I have seen some companies still using some packages that are officially discontinued. So, I find it safer to allow both ESM and CJS as long as docx is supporting both.

@mayank1513 mayank1513 changed the title Add Add @m2d/remark-docx to the plugins list Mar 28, 2025
Signed-off-by: Mayank <mayank.srmu@gmail.com>
@mayank1513
Copy link
Contributor Author

@mayank1513 The link in PR description is wrong. Please change the PR title more meaningful.

Done. Thank you!

@ChristianMurphy
Copy link
Member

Thanks, for now I think going with both CJS and ESM is good option. I do not find this very likely to happen. Besides, I have seen some companies still using some packages that are officially discontinued. So, I find it safer to allow both ESM and CJS as long as docx is supporting both.

ESM only exports supports both CJS and ESM, in node 20+ https://nodejs.org/en/blog/release/v20.19.0#requireesm-is-now-enabled-by-default

@mayank1513
Copy link
Contributor Author

mayank1513 commented Mar 28, 2025 via email

@JounQin
Copy link
Member

JounQin commented Mar 28, 2025

I personally think dual package is fine vs ESM only in near future.

@ChristianMurphy
Copy link
Member

Agree, but not everyone is on or above node 20

Node 18 is days away from being unsupported
https://nodejs.org/en/about/previous-releases#release-schedule

If you want to take time to support releases the Node foundation no longer support, you can 🤷

@mayank1513
Copy link
Contributor Author

Thanks. Will rethink in a month or two.

@github-actions github-actions bot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Apr 9, 2025
@wooorm wooorm merged commit 40b8a37 into remarkjs:main Apr 9, 2025
8 checks passed
@github-actions

This comment has been minimized.

@wooorm wooorm added the 💪 phase/solved Post is done label Apr 9, 2025
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 phase/solved Post is done

Development

Successfully merging this pull request may close these issues.

4 participants