-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Show how automatic fixing works #29
Comments
oh apparently you do: https://github.com/wooorm/mdast-lint#using-mdast-to-fix-your-markdown - thouh I think you could point out on how to use that feature. |
Certainly! mdast itself can do a lot of that (see “using mdast to fix your markdown”). If you have some more suggestions regarding how to get that across, I’d love to hear them 😄 Not everything can be fixed (automatically), some are pretty easily done, some can be quite destructive (like the one you mentioned), especially when used in a code editor where you’re typing and fixes could happen automagically! I’d appreciate a breakdown of these rules and how they could be fixed if you’d like to dig in 😉 |
@wooorm could you provide an example command that shows how I can use mdast to autofix a file? Background: I'm the coala developer (see the other issue :)) and we offer automatic fixing to the user but we don't do it without asking him first so destructive is ok in our case because the user has the last say. |
And IIUC you either do analysis or fixing, ideally one would be able to relate a fix to a certain issue. |
Re coala: Yeah, I figured 😉 unist (i.e., mdast/retext/hast) definetly support automatic code fixing, however, most of hast and almost all of mdast are abstract (instead of concrete) syntax trees. Meaning, information is left out. For example, one cannot persist the type of marker used for emphasis (
What? Aside form that, suggesting either a setting or a plug-in to use (I prefer keeping mdast’s core small and deferring work to plug-ins) is okay with me. |
IIUC -> If I Understand Correctly |
👍 |
Just getting back to this issue: Am I correct in assuming you have everything you need? Can I close this? |
This bug is not about me getting what I need (FWIW I have it :)) but about me wanting you to document this somewhere because I think it would be good. |
Right, in that case: I feel like everything is documented okay. As in, mdast-lint has a section regarding this linking to mdast, and mdast has an entire man page for settings packaged inside, and lists all available plug-ins. So, IMO the stuff is there, but maybe it isn’t easily found. Back to the Q, what information are you missing, and where would you suggest mentioning it or linking to it? |
I think that was my problem. Though I can't really say to you how to improve that. |
Okay, I hope the proposed changes in wooorm/mdast#95 will improve this. |
@wooorm: I'm confused by this situation still. As a concrete example: when I run some files through remark, I want the output list items to have one space separating (Some of the links in the discussion above are now dead, so maybe I'm just not looking in the right places.) |
As remark uses an AST, lots of stuff is not available in the tree, and If you’re using If you’re not using The docs for what stringification can be used can be found in the API section of Does that help? If you have suggestions for changed to the docs, let me know! |
@wooorm: Perfect — this is what I've been looking for. I will try to make a PR to docs that I think might clarify. |
While #160 helps, I think #180 shows that an even more concrete and verbatim example is required for people (like me) to understand how to execute remark on the command line to auto-format Markdown files. I believe other command line tools such as
|
The example in the readme does show the How could that be made clearer? |
To be honest, I didn't see the mention of it since it's within a quotation block. It would be great if something like the following code example was available somewhere more prominent: npx remark ./**/*.md --output |
I'm also confused by this behavior. I'm using {
"plugins": [
"preset-lint-markdown-style-guide",
[ "lint-maximum-line-length", false ]
]
} When I run
However, running |
Looks like #82 is possibly what I'm referring to above. |
Would be super awesome to fix some issues automatically, say you have a duplicate heading, just remove the second.
The text was updated successfully, but these errors were encountered: