Closed olayway closed 2 years ago
things i've found from a quick google:
:::
for fencing blocks@rufuspollock
https://github.com/Nevenall/remark-containers - a bit similar in functionality though using ::: for fencing blocks
This was the closest one I had found.
I'd consider creating a new flowershow/remark-callouts
repo and modifying above or https://github.com/elviswolcott/remark-admonitions as per our needs similar to what we did in remark-wiki-links-plus
@khalilcodes ok - have you examined the code - what parts would be useful exactly?
@rufuspollock
Browsing through remark-containers
and even modifying it a bit, I could see the tokenizer handles the ":::" (or ">" in our case) found on new lines by splitting them and then transforming the nodes. Also, remark-admonitions
has a similar approach including an object with a list of types (ie., note, tip, warning, etc) with their relevant properties (class, svg, etc).
The approach here I'm thinking is to see how extensively can we modify their existing code to suit our needs ?
@khalilcodes sounds good. are you asking me a question at the end or a question to yourself?
@rufuspollock π Just validating if the approach is right.
@olayway @rufuspollock
Current progress on callouts remark plugin ...
Some issues and enhancements to be addressed.
@khalilcodes imo headings in blockquotes being linked is not the end of the world (though imperfect - we can live for now and revisit - e.g. open an issue to remind ourselves of this and close this one).
@rufuspollock the headings was resolved on Monday and the npm package has been published and ready to go.
repo: https://github.com/flowershow/remark-callouts npm: https://www.npmjs.com/package/remark-callouts
One minor limitation is that wiki links do not parse in the callout's header section (works in body), although other markdown stuff does just as in Obsidian. For eg ..
> [!tip] # custom title // this works (parses the title as h1)
> [!tip] [[wiki-link]] // this doesn't --> shows Tip instead
> [!tip]
> [[wiki-link]] // this works
I will update the tasks shortly.
@khalilcodes amazing! π π let's integrate it and deploy it!
We would follow Obsidian style as listed on here https://help.obsidian.md/How+to/Use+callouts
Acceptance
repo: https://github.com/flowershow/remark-callouts npm: https://www.npmjs.com/package/remark-callouts
> [!xyz]
Screenshots
with callout
without callout
Tasks
Notes
[[wiki-links]]
(yet).