jake-low / remark-sectionize Goto Github PK
View Code? Open in Web Editor NEWRemark plugin to wrap each heading and the content that follows it in a <section> tag
License: MIT License
Remark plugin to wrap each heading and the content that follows it in a <section> tag
License: MIT License
Using @gridsome/vue-remark, there's a special type called vue-remark:block
, which represents script/style tags and does not belong to a section.
I'm getting following error:
scheduler.development.js?3069:171 Uncaught Error: Renderer for type `section` not defined or is not renderable
at astToReact (ast-to-react.js?515f:34)
at eval (ast-to-react.js?515f:42)
at Array.map (<anonymous>)
at resolveChildren (ast-to-react.js?515f:41)
at astToReact (ast-to-react.js?515f:38)
at eval (react-markdown.js?22e8:48)
at Array.forEach (<anonymous>)
at ReactMarkdown (react-markdown.js?22e8:47)
at renderWithHooks (react-dom.development.js?61bb:14985)
at mountIndeterminateComponent (react-dom.development.js?61bb:17811)
when using this with react-markdown
5.0.3. react-markdown
should be compatible with remark plugins as that's what it uses under the hood.
Hi, first of all, thanks for this amazing plugin.
This is not an issue, per se. As this plugin wraps elements into a wrapper section, I thought this is a right place to ask a question on creating similar plugin.
I want to wrap this:
> this is a blockquote
<figcaption></figcaption>
into this:
<figure>
> this is a blockquote
<figcaption></figcaption>
</figure>
term
: definition
: definition
into this:
<div>
term
: definition
: definition
</div>
term
: definition
: definition
term2
: definition2
: definition2a
into this:
<div>
term
: definition
: definition
</div>
<div>
term2
: definition2
: definition2a
</div>
Currently, https://github.com/Symbitic/remark-plugins/blob/master/packages/remark-deflist/src/index.js this plugin converts term and definition into proper HTML.
<dl>
<dt></dt>
<dd></dd>
<dd></dd>
</dl>
and
<dl>
<dt></dt>
<dd></dd>
<dd></dd>
<dt></dt>
<dd></dd>
<dd></dd>
</dl>
So, basically I want to have a wrapper set for some sibling elements. Can you kindly make one plugin for this or guide as to how to proceed?
Hi!
remark is switching to a new parser internally (micromark, see remarkjs/remark#536
for more info).
From a quick glance at the code, it seems this plugin should be fine. However, it would be good to check that in the future (there is 13.0.0-alpha.0
published now, and one or two more will come before the release)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.