remark42
remark42 copied to clipboard
Publish client library to npm
It would be nice to be able to use remark client library directly instead of dropping script tags on the page
Something like this
const remark = require('remark')
remark.embed(node, options)
remark.counter(node, options)
remark.lastComments(node, options)
Yep, we'll do it after switching from iframe widget to iframe-less (https://github.com/umputun/remark/issues/218#issuecomment-438005245). Right now it's overengineering to try to extract things from current widget to the package and to the iframe widget.
I'm leaving this issue open as a reminder. Thanks.
Possible Requirements:
- pack code by widget with ability to lazy load the module out of the box
- provide all of the necessary methods for controlling the widgets
- pack file with API methods separately and expose API methods for outside use
Ideas:
- create wrappers for JS frameworks (for example remark42-react) for easier integration with them
- provide theme context which provides ability to modify theme of comments
- provide ability to replace components with user's own implementation