I published a plugin yesterday that allows you to create styled (collapsible) blocks.
However, I have two questions:
In order to have icons for the different block styles I added the MaterialIcons font.
Is there a way to import this font locally?
(I copied it into the styles folder of the plugin and reference it in the less file, see here but that doesn’t work)
Alternatively, I could use the icon font Inkdrop uses? Or does that depend on the theme?
The content in each block is determined by this
| symbol in the beginning of a line. It would be convenient to automatically add a
| when pressing enter while the cursor is inside of a content block. Basically the same behavior when pressing enter in a list (it automatically adds a
- in the new line).
Is that done by codemirror? Do you have any tips/links how I could do that?
Wow, that’s an amazing plugin!
Yes, you can specify files in your plugin with URI:
So you should be able to use the font file like so:
And yes, Inkdrop’s UI is built with Semantic UI. So you can use its icon set here without needing to add a font.
Yes. continuelist is a good example. But it’s kind of complicated to accomplish that in Inkdrop. Let me give time to describe it.
I looked into the current implementation of the editor and found that unfortunately it’s difficult to change the behavior to automatically add a
| when pressing enter.
editor:new-line command is executed when pressing enter while the cursor is on the editor.
This command’s implementation is similar to continuelist and as you can see the process is hard-coded.
So I’m afraid that it’s hard to extend as what you want for now.
Thank you for your feedback!
OK nice, I am currently playing around with the font awesome icons and might just use those and good to know how easy it is to link plugin resources!
Thank you so much for looking into that! A pity that it is harder to do but luckily it is also not a super important feature, so I am happy to leave it out.