These are chat archives for wooorm/remark

8th
Mar 2017
Seth Vincent
@sethvincent
Mar 08 2017 21:44
hey all, i'm experimenting with a way to write reusable components for markdown and wondering if anyone has feedback / tried similar things. here's the repo: https://github.com/sethvincent/remark-components
goal is to write something like
::: component-name #id.class.another-class key=val
component body
:::
and have it turn into:
<div id="id" class="class another-class" data-key="val">component body</div>
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 21:51
interesting... i'm doing something similar...
i'm basically using markdown's self-referential nature to build a literate weaver/tangler
but i haven't settled on the syntax for it yet
I like the :::
Seth Vincent
@sethvincent
Mar 08 2017 21:52
@8-uh oh cool!
Titus
@wooorm
Mar 08 2017 21:53
@Rokt33r Did something similar, but for math, based on $$\nfoo\n$$ blocks, https://github.com/Rokt33r/remark-math
Junyoung’s code extends the parser, which I think is better than just transforming the AST: it prevents other markdown from entering in the component (if you’d want to)
P.S. It’s a really cool idea, @sethvincent!
Seth Vincent
@sethvincent
Mar 08 2017 21:56
nice, remark-math looks good
Titus
@wooorm
Mar 08 2017 21:56
@8-uh Cool! Is that a new project?
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 21:57
yeah. well.. I mean.. I've been mentally planning it for about 3 months... but I didn't have the time to even start until this past weekend.
Titus
@wooorm
Mar 08 2017 21:57
@sethvincent Yes! It’s rather involved as it deals with HTML, Katex > HTML, too, maybe more code that you need
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 21:57
and, honestly, most of my dev time has been spent teaching myself proper TDD.
a topic that I am wholly lacking in understanding of
but recognize that it's important
Titus
@wooorm
Mar 08 2017 21:59
Cool!
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 21:59
but i'm struggling to understand how to wrap my remark plugin in a series of ava tests
Titus
@wooorm
Mar 08 2017 21:59
ahhh
Isn’t ava rather tape/assert like? I use tape on all my remark plugins for tests
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 22:00
I think that's correct. like i said -wholly-... and -woefully- under-educated in this part of the profession
Titus
@wooorm
Mar 08 2017 22:01
Ah okay, that’s fine, you’ll get there :)
I like learning from reading code, so maybe my examples will help, but in the end you need to write yourself of course!
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 22:02
this happens when you've been a developer/engineer working for "DO IT GOOD. DO IT CHEAP. DO IT FAST" agencies and your work only stays online for 6 weeks, even though you put 6 hard, sleepless months into it.
Ada Lovecraft
@ada-lovecraft
Mar 08 2017 22:06
thanks @wooorm and @ben-eb these are both fantastic examples
Ben Briggs
@ben-eb
Mar 08 2017 22:06
Pleasure :)
Titus
@wooorm
Mar 08 2017 22:06
Cheers! 👍
Ben Briggs
@ben-eb
Mar 08 2017 22:07
Still digging into this monorepo work @wooorm so no remark stuff yet, however depending on how it goes I might merge one or two - thinking of doing a unified docs process
Currently tracking 37 packages so it's important to have some automation in there somewhere :)
It might be good to do some custom version of remark-usage but for css inputs/outputs
Ben Briggs
@ben-eb
Mar 08 2017 22:14
@sethvincent I'd also consider writing a proper parser for this, but I don't really have any input on the syntax. Looks good though :)
Seth Vincent
@sethvincent
Mar 08 2017 22:28
@ben-eb thanks!
Ben Briggs
@ben-eb
Mar 08 2017 22:28
You're welcome :)
Seth Vincent
@sethvincent
Mar 08 2017 22:29
yeah thinking about it some more and looking over remark-math it seems like extending the parser would be best
Ben Briggs
@ben-eb
Mar 08 2017 22:31
Agreed
Titus
@wooorm
Mar 08 2017 23:20
👍
Ben, check out how I generate docs for the remark-lint packages!
That may help, they have tests in the JavaScript as jsdoc's
Or check rehype-minify, it has external tests, but the example in the README is pullen out of the code