-
Notifications
You must be signed in to change notification settings - Fork 2
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
Load markdown parser externally #17
Conversation
@caub this is how I think we can keep the markdown as an easy dependency |
ok, note it's good to use peerDependencies to tell "this lib is necessary, but installed apart" not mandatory, but good practice ok thanks |
oh actually no, in the way you've done it's completely independant, no peerDependencies peerDependencies would be if we import it from wurd-web but not bundle it, it's a little bit simpler (no need to pass it in .connect()), but that's fine that way too |
Well, I prefer the peerDependencies approach #7 Your approach is ideal if we wanted to support different markdown libs, but here, specificially on the web, we will always be using marked (markdown-it is too heavy on browser), and having to always pass marked in options make it a bit more annoying to set up, (in some ways we're calling Other thing, can we make |
I think you can change language with `wurd.lang = 'de'` and then
`wurd.load()`
…On Thu, Aug 18, 2022 at 6:31 PM Cyril Auburtin ***@***.***> wrote:
Well, I prefer the peerDependencies approach #7
<#7>
Your approach is ideal if we wanted to support different markdown libs,
but here, specificially on the web, we will always be using marked
(markdown-it is too heavy on browser), and having to always pass marked in
options make it a bit more annoying to set up, (in some was we're calling
.connect() twice, for loading for cache and then with user's language
Other thing, can we make startEditor() remove a previous script if any?
that would help to change the language without having to reload
—
Reply to this email directly, view it on GitHub
<#17 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACUYKC75FDICJT24AEGWZDVZZQN3ANCNFSM564XFUBQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This way you should be able to use any markdown parser by passing in their
`parse()` method
…On Thu, Aug 18, 2022 at 4:21 PM Cyril Auburtin ***@***.***> wrote:
oh actually no, in the way you've done it's completely independant, no
peerDependencies
peerDependencies would be if we import it from wurd-web but not bundle it,
it's a little bit simpler (no need to pass it in .connect()), but that's
fine that way too
—
Reply to this email directly, view it on GitHub
<#17 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACUYKESMF72VSKNR3R4PD3VZZBIHANCNFSM564XFUBQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Yea, in the end I like this approach, no extra weight |
No description provided.