menu
Channels
Team
Posts
Members
Info

Adding custom type to MDAST with plugins

I'm working on creating a remark plugin to extend the syntax (basically the same as remarkable-admonitions ). I've gotten as far as writing a plugin that adds the element to the MDAST, but right now all the custom data is lost and it becomes a plain old div after converting to…

thumbsup
0
message-simple
4

Parsers should support promises

I'm working on providing tooling Elm based on unified. I'm in a situation where my parser has to be asynchronous. It would be great if unified allowed a parser which returns a Promise<Node> from its result. I'm having a hard time figuring how to make this async process appear…

thumbsup
0
message-simple
10

Order of pipeline

Hello! I have a unified chain that looks something like: But by the time my do_stuff_with_frontmatter runs the data isn't ready, yet it is definitely getting put in there at some point because it is in the vFile.data by then end. I want the extract_frontmatter and…

thumbsup
0
message-simple
20

Writing Custom processors

I have a couple of use cases where I'd like to use unified. I am working on a domain modeling tool that has its own intermediate representation that at the moment is in the form of an AST. Our project currently converts JSON and Elm code to this AST, but I want to add a plugin…

thumbsup
0
message-simple
9

Can I parse JavaScript with unified?

Hi there! 👋🏼 I recently came across the remark-cli after seeing John upload some videos to egghead. That somehow lead me to unifiedjs, which looks like an awesome project! Anyways, I've been wanting to learn more about JavaScript parsers and thought it would be cool to try out…

thumbsup
1
message-simple
5

I can't seem to get a unified-args based CLI script to locate "external" files

I'm using unified-args to create a CLI tool for linting Markdown files. Like so: I can't seem to get it to work on files outside the project directory. For example: But if I copy the .md files I want to parse into the project directory and run it like ./osiolabs-lint.js content/…

thumbsup
0
message-simple
11

how can I look at a hast and/or save it as a file?

I tried on some example HTML the following code but got a 'Cannot process without Compiler' error. What am i doing wrong? var vfile = require('to-vfile') var unified = require('unified') …

thumbsup
0
message-simple
1

"superCtor" TypeError when using unified-engine

I've been trying to play around with both unified-engine and unified-cli, in both, when I try to process a file, I get: where my_bundle.js is generated with Rollup. If I don't try to read a file (e.g. -h with unified-cli) it works fine. Some googling indicates that this may be a…

thumbsup
0
message-simple
5
Deleted·1y# unified

processor.run() vs processor.process() confusion

As I was looking at the unifiedJS code something confused me. I would expect the two above to both resolve promises with profanity errors in them: they have the same parser, the same transformers and the same compiler. The 1st one does but the 2nd one doesn't. So, why aren't the…

thumbsup
0
message-simple
3

Execute the same plugin multiple times

Hi everyone! I have a question related with the use of plugins in unified. Is it possible to run the same transform plugin multiple times? something like this one: …

thumbsup
0
message-simple
3