Uh oh!
There was an error while loading. Please reload this page.
Add plugins functionality - #474
Conversation
yamgent
commented
Dec 17, 2018
Bare in mind that authors will not have direct access to the source, as they install MarkBind with |
jamos-tay
commented
Dec 17, 2018
Sure - I don't think that's a problem. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jamos-tay
commented
Dec 18, 2018
Updated |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ced05ad to
7f81648Comparejamos-tay
commented
Dec 20, 2018
Resolved merge conflict and updated, sorry I'm not sure how so many of them got missed out,... |
acjh
commented
Dec 20, 2018
Does this mean that we expect user to copy-paste the file if #467 is converted into a plugin?
When looking for plugins, we should use the order 3 → 1 → 2 to facilitate overrides. |
jamos-tay
commented
Dec 20, 2018
I was thinking we can have a few plugins that are 'installed' by default that the user can enable or disable, so they won't have to download separate files.
Would this be installed in the markbind source folder? Like @yamgent mentioned we probably don't want them touching the source. Either that or they can install them in to the project folder, but that's still a little troublesome, and it also means they can't be shared among projects. What do you think of a
We can have a |
acjh
commented
Dec 20, 2018
Do you mean built-in plugins? This MR does not support that yet right?
No, it's installed into the project directory, like ESLint.
Can you elaborate why they can't be shared?
No, we can use NPM.
Yes, that was the original intention — built-in plugins. |
jamos-tay
commented
Dec 20, 2018
By project directory are you referring to the |
acjh
commented
Dec 20, 2018
No, I'm referring to the project directory — the folder for a specific markbind website (like This MR uses the project directory to support local plugins, but the user has to copy-paste the file. NPM modules can be installed by multiple projects, which is what I mean by shared. |
jamos-tay
commented
Dec 20, 2018
Ah I see, but the user still has to run |
acjh
commented
Dec 20, 2018
Yes, that's how ESLint plugins are installed. |
damithc
commented
Dec 21, 2018
In the first stage of adding this feature, we could limit it to simply a way for the dev team to add functionality easily i.e., the plugin mechanism is not necessarily visible to end users. As our philosophy is to optimize for a specific target user group, we want most functionality to be in the box (they can be plugins enabled by default) and ready-to-use by that target user group, which means only in a rare case a user will need to tinker with plugins. |
jamos-tay
commented
Dec 22, 2018
@damithc Ah - In that case should the options in the |
acjh
commented
Dec 23, 2018
No, users should be able to remove plugins. |
damithc
commented
Dec 23, 2018
👍 |
acjh
left a comment
There was a problem hiding this comment.
We still need to support built-in plugins.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
699dbfc to
8f61ba1CompareUpdated, rebased on master to solve merge conflict |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jamos-tay
commented
Dec 27, 2018
Updated, renamed siteContext to pluginsContext |
acjh
commented
Dec 27, 2018
We still need to support built-in plugins. |
jamos-tay
commented
Jan 2, 2019
@acjh Hi, just to confirm, what other changes do you need from this PR? For the built-in (installed by default) plugins I was thinking of adding them in the PR where we actually start converting the features into plugins, if I wrote the feature at this point the functionality would likely be placeholder and would probably have to be rewritten in future. |
acjh
commented
Jan 2, 2019
Hmm, but this PR only supports the usage with the lowest priority.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d3fafc5 to
95f110fCompareUpdated, I'm getting a problem with netlify, can someone help me with this error? Edit: resolved |
95f110f to
bb02b94Comparejamos-tay
commented
Feb 10, 2019
Rebased! |
damithc
commented
Feb 11, 2019
@jamos-tay can users do anything with the built-in plugins? e.g., disable them |
jamos-tay
commented
Feb 11, 2019
Oh they are disabled by default, to enable them the user has to put the plugin name in |
damithc
commented
Feb 11, 2019
So the tags feature no longer works by default? |
Oh yeah, this PR changes the way the site json is specified: Old: New: The reason is because we didn't want to clutter up the top level of the configuration with less important properties. I think the section in the docs wasn't cleaned up, let me do it now. |
damithc
commented
Feb 11, 2019
Specifically, if I want to use tags in a page via frontmatter, (i.e., not via site.json), how do I do that? |
jamos-tay
commented
Feb 11, 2019
The Hmm, I think I should make it such that it defaults to empty because not specifying an empty array causes errors |
damithc
commented
Feb 11, 2019
A few other thoughts:
|
You mean like ? |
acjh
commented
Feb 11, 2019
The benefits of specifying it separately:
|
jamos-tay
commented
Feb 11, 2019
Should it be kept the way it is then? There are a number of plugins that don't require parameters (anchors, syntax improvements) so empty defaults may look ugly. |
damithc
commented
Feb 11, 2019
Sure. BTW, I'm still inclined to enable built-ins by default and allow disabling if they want to e.g., for performance reasons. As our promise is to optimize for a certain target user group, it is our job to provide all the needed functionality out of the box. It can also be one way we differ from others. i.e., 'All features built-in; no need to fiddle with plugins' |
acjh
commented
Feb 11, 2019
It was also mentioned by @jamos-tay in #495 (comment). We can allow disabling by accepting |
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [X] New feature
Fixes#470
What is the rationale for this request?
Allow MarkBind to use plugins, making it more customisable.
What changes did you make? (Give an overview)
Add plugins functionality:
Plugins are placed in
_markbind/pluginsfolder.User specifies plugins to use in
site.json.Plugins allow user to specify a
preRenderandpostRenderfunction.Is there anything you'd like reviewers to focus on?
How do we want to handle plugin dependencies (
require)? Right now I'm just usingmodule.parent.requireto get libraries from the markbind source, but if the user wants to use his own libraries he'd have to install them somewhere in his project. Perhaps within the plugin folder?