remark42 icon indicating copy to clipboard operation
remark42 copied to clipboard

Publish client library to npm

Open webkonstantin opened this issue 7 years ago • 2 comments

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)

webkonstantin avatar Jan 05 '19 13:01 webkonstantin

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.

igoradamenko avatar Jan 06 '19 19:01 igoradamenko

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

akellbl4 avatar Jun 09 '22 21:06 akellbl4