|
|
|
|
|
by shurcooL
4429 days ago
|
|
> $ cat 1.md 2.md 3.md 4.md |publishmd --some-options
>
> You killed my chapter titles.
I did not consider such a use case. Currently, markdownfmt works on an individual file/stdin and considers that to be the entire Markdown; it does not know that you're planning to concatenate more files.It would work fine if you passed `cat 1.md 2.md 3.md 4.md` as input, but removing excess newlines at the end of individual Markdown files will ruin the concatenated result. It's similar to an issue that goimports also has [1]. I'll think about it, perhaps something can be done to solve this. [1] https://code.google.com/p/go/issues/detail?id=7463 |
|
That explanation does not really make sense. I want markdownfmt to work on the file chapter1.md and the following day after editing chapter 2 I want to process chapter2.md. markdownfmt never needs to know and never will know that I use chapter1.md and chapter2.md together. When I am done I am going to feed chapter[1-X].md to another tool for publishing. But I cant because I used markdownfmt on a file by file basis and it damaged my files.
Every large book I have seen that uses markdown uses this chapter (or smaller) as file workflow. The biggest example that comes to mind is the progit book: https://github.com/progit/progit/tree/master/en