Comments (9)
Awesome, glad it worked!
I looked through the readmes and here are some suggestions, If you’re interested:
- The
remark-definition-list
usage example uses./index
, but should probably import the package name? - For remark plugins, I recommend using a default export for the plugin. This means they can be used by the engine (
remark-cli
), such as withremark input.md --use remark-definition-list --output output.md
(only with a default can the engine/cli “find” the plugin).
All other plugins also use a default export, so it’ll help users because there is a single API
You can export the same value as both a named export and a default export btw, so it can be a minor release! - You can add the plugin to the List of plugins in remark’s readme https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins
- Same for the extension here, maybe a new “Community extensions” heading, with this extension, under the current list of extensions? https://github.com/micromark/micromark#list-of-extensions
- There’s a typo in the micromark extension readme:
Definitio
instead ofDefinition
. Alsodevelepment
->development
!
👋
from micromark.
I published new version including your suggestions, bug fix, some improvement.
Can I ask you to add my plugin and extension to remark / micromark readme?
- You can add the plugin to the List of plugins in remark’s readme https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins
- Same for the extension here, maybe a new “Community extensions” heading, with this extension, under the current list of extensions? https://github.com/micromark/micromark#list-of-extensions
from micromark.
Done!
from micromark.
Maybe I can help better if you share what you want to do?
Perhaps it’s possible to not use containers? Containers are quite complex.
And indeed, resolve
changes the events.
from micromark.
@wooorm Thank you for your reply.
I've been trying to implement a micromark extension for definition list in this spec.
For example, following markdown
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
Orange
: The fruit of an evergreen tree of the genus Citrus.
would makes the following HTML.
<dl>
<dt>Apple</dt>
<dd>Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.</dd>
<dt>Orange</dt>
<dd>The fruit of an evergreen tree of the genus Citrus.</dd>
</dl>
I read setext-underline.js and list.js and imitated them because their syntaxes look like one which I wanted to handle.
Is there any way to implement this syntax extension without containers?
from micromark.
If you really want to do this, I think you might be better of looking at footnote definitions for the “container” part, those colons, see: https://github.com/micromark/micromark-extension-footnote/blob/561f958a9bf33a1f3f0d2f61b370199dbff2610b/dev/lib/syntax.js#L45-L49.
But, honestly, I think this is a bad designed syntax extension, that doesn’t match how markdown works otherwise.
Better solutions in my opinion are either directives (Arbitrary extension mechanism in § Extending markdown):
:::definition[Orange]
The fruit of an evergreen tree of the genus Citrus.
:::
:::definition[Apple]
* Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
* An American computer company.
:::
:::definition[Term 1, Term 2]
Definition a
:::
Or (ab)using lists (Using and abusing markdown to add new meaning in § Extending markdown):
* **Orange**
The fruit of an evergreen tree of the genus Citrus.
* **Apple**
* Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
* An American computer company.
* **Term 1**
**Term 2**
Definition a
from micromark.
@wooorm Thank you, I'll take a look at micromark-extension-footnote
.
And indeed, resolve changes the events.
Well, the behavior about effect.check
/ effect.attempt
/ resolveTo
seems a bit inconsistent for me.
effect.attempt
(onsuccessfulconstruct
) callsaddResult
which invokesresolveTo
to modify events. This is straightfoward.effect.check
(onsuccessfulcheck
) doesn't do, but if its argument construct callseffect.attempt
inside it, it would runresolveTo
and modify events consequently.
If this behavior is not a problem, please close this issue.
And thank you for your help!
from micromark.
Just FYI.
Thanks to your kind help, I've finally published my extension package.
Regards
from micromark.
Going to close this, as this particular thing is intended. Maybe some docs somewhere might be good, and I’d appreciate a PR for that if you have a suggestion!
from micromark.
Related Issues (20)
- 3.0.8 seems to introduce a module level dependency on document HOT 9
- `index.d.ts` is missing in `micromark-util-encode` published files HOT 3
- HTML with excess whitespace is not parsed correctly HOT 2
- List items wrapped in <p> tags due to trailing space HOT 3
- hard break at the end of a paragraph is not properly parsed HOT 3
- Make `definitions` available to extensions HOT 2
- Custom extensions break in development mode, despite working in production HOT 6
- & in image url will be encode to html entity HOT 2
- Configure collapsing newlines into a single paragraph HOT 3
- TokenizeContext.sliceSerialize throws in sliceChunks if first chunk of token is Code instead of string HOT 20
- Reduce execution time by ~11% with a simple reimplementation of TokenizeContext.now HOT 3
- nested ordered lists not starting with 1. are not detected HOT 4
- `TokenizeContext.sliceSerialize` for `Token.type` of `setextHeading` includes non-heading content from outside the range of [`startLine`, `endLine`] HOT 1
- `micromark-util-symbol` can not be imported by typescript HOT 9
- Strings ending with `\n-` are compiled into a level 2 heading HOT 3
- Error - [webpack] 'dist': ./node_modules/micromark-util-decode-numeric-character-reference/index.js 23:11 Module parse failed: Identifier directly after number HOT 12
- Emphasis and strong when immediately followed by emphasis in the same word causes extra asterisks to appear HOT 4
- Using power-assert causes Webpack builds to fail HOT 13
- ES5 Compatibility HOT 6
- uvu shouldn't be set in dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micromark.