You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: markdown-format/README.md
+86Lines changed: 86 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,92 @@ It has multiple sentences.
59
59
Let's format it!
60
60
```
61
61
62
+
## Integration with Formatting Tools
63
+
64
+
### treefmt
65
+
66
+
[treefmt](https://github.com/numtide/treefmt) is a universal code formatter that runs multiple formatters with one command.
67
+
68
+
To integrate markdown-format with treefmt, you'll need to create a wrapper script since markdown-format outputs to stdout rather than formatting files in place.
69
+
70
+
1. Create a wrapper script (e.g., `markdown-format-inplace.sh`):
71
+
72
+
```bash
73
+
#!/bin/bash
74
+
# Wrapper script to make markdown-format work in-place for treefmt
[dprint](https://dprint.dev/) is a pluggable and configurable code formatter.
111
+
112
+
Since markdown-format uses a custom sentence-per-line format, you'll need to use dprint's process plugin or create a custom wrapper. Here's how to integrate using a process-based approach:
113
+
114
+
1. Create a wrapper script that handles dprint's stdin/stdout protocol (e.g., `dprint-markdown-format.sh`):
Note: The exact configuration may vary depending on your dprint version. Refer to the [dprint documentation](https://dprint.dev/plugins/) for the latest plugin configuration format.
141
+
142
+
3. Run dprint:
143
+
144
+
```bash
145
+
dprint fmt
146
+
```
147
+
62
148
## License
63
149
64
150
MIT License - See LICENSE file in the repository root.
0 commit comments