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

Add remark-videos to list of plugins #1289

Closed
wants to merge 1 commit into from
Closed

Conversation

Chailotl
Copy link

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

I added a link to the remark-videos plugin that I developed.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Feb 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d993c7f) to head (52b8553).
Report is 23 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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

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

@remcohaszing
Copy link
Member

Thanks!

Some suggestions:

  • Generating HTML is better done in a rehype plugin.
  • It would be nice if the plugin accept an option to allow different file extensions.
  • It would be nice if the plugin handles alt descriptions.

@Chailotl
Copy link
Author

Generating HTML is better done in a rehype plugin.

I saw some remark plugins that generate HTML, such as remark-callouts, and to me it logically makes more sense as a remark plugin because it operates on markdown syntax, but I'll give it some thought.

It would be nice if the plugin accept an option to allow different file extensions.

The <video> tag already works with any video extension. This plugin just puts the video file link into the src attribute.

It would be nice if the plugin handles alt descriptions.

That's a fair suggestion, I'll look into adding it.

@ChristianMurphy
Copy link
Member

Welcome @Chailotl!
Thanks for sharing!

The <video> tag already works with any video extension.

The <video> tag does, this plugin currently only works for MP4.
https://github.com/Chailotl/remark-videos/blob/851c332993210e6f091453f7ed887be24492bcee/index.js#L7
There are a lot more, consider leveraging https://www.npmjs.com/package/is-video or https://github.com/sindresorhus/video-extensions

I saw some remark plugins that generate HTML, such as remark-callouts

Those add new syntax features to markdown, they need to integrate with the parser.
This plugin does not, it can work on the HTML syntax tree.

@Chailotl
Copy link
Author

Oh- right, my plugin only checks for the .mp4 extension 😅 I wrote the plugin well past midnight so forgive my memory

@ChristianMurphy
Copy link
Member

No worries!

Some other ideas:

  1. consider adding more automation like:
    1. adding some test cases with node:test to make it easier to confirm the plugin works and easier for others to contribute
    2. leveraging lint and formatting tools like xo and prettier for code style and structure consistency
    3. using GitHub actions to automatically run tests and lint checkers for new contributions
  2. consider leveraging JSDoc + TypeScript for automated option checking and better autocomplete https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html (this also benefits non-typescript users leveraging an IDE)
  3. consider annotating the project as side effect free for better optimization from build tools https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free

It would be nice if the plugin handles alt descriptions

Adding on to this.
Images have both alt and title text

![alternate text](http://example.com/url "title text")

alternate text


There could be an opportunity to offer some combination of:

@wooorm
Copy link
Member

wooorm commented Sep 27, 2024

Closing this as it seems abandoned. This also makes more sense as a rehype plugin I think!

@wooorm wooorm closed this Sep 27, 2024
@wooorm wooorm added the 🤷 no/invalid This cannot be acted upon label Sep 27, 2024

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

Successfully merging this pull request may close these issues.

5 participants