remarkjs / remark-word-wrap

Please use something like https://github.com/prettier/prettier instead

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specifying options from the command line

pixelastic opened this issue · comments

Hello,

I'm trying to use your plugin through the remark-cli commandline, using the following configuration file:

{
  "plugins": {
    "word-wrap": {
      "width": 80
    }
  },
}

But the word wrap keep happening at 72 chars. I tried other values, I also tried the other options (indent and newline), and tried the ["word-wrap", { width: 80 }] syntax in the config, but none worked.

I wonder if the issue is coming from the way I try to pass settings (following documentation here) or if it's something that is not possible with your plugin.

Any tips would be welcome,

Cheers,

commented

This plugin unfortunately hasn't been updated in a while. It also never really worked from what I gather :(

Thanks for info @wooorm. I ended up disabling it as it was cutting lines in weird places.

Do you have any plan on integration a similar feature in the official plugins maybe? I'm using remark-lint and trying to find a way to auto-fix most of the violations.

commented

prettier itself is great at formatting. It used remark for markdown under the hood, so of course it’s a good option ;)

I don’t really have a plan on doing this. It’s super hard to do properly in a “plugin”, because you need to know how every node is going to be printed. We talked a bit about it in GH-4 (and on other mediums that aren’t recorded, if I recall correctly).

If someone wants to work on it, I suggest sort of what prettier does and wrapping the compiler (similar to what remark-frontmatter for example does).

I wasn't aware prettier also formatted Markdown! Thanks for the tip, I'll have a look at it.