Skip to content
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

Project Goal/Roadmap? Potential Collaboration or known fork #21

Open
13rac1 opened this issue Dec 27, 2020 · 4 comments · May be fixed by #32
Open

Project Goal/Roadmap? Potential Collaboration or known fork #21

13rac1 opened this issue Dec 27, 2020 · 4 comments · May be fixed by #32

Comments

@13rac1
Copy link

13rac1 commented Dec 27, 2020

Hi @Kunde21 and @bwplotka I've forked this project, since it seems our goals may be different. If they aren't though, I'd rather work with others instead of alone. It seems your current goal is a formatter matching goldmark's feature set? Do you plan to add other extensions? I'm adding all goldmark extensions, plus these:

Example of different goals (I'm sure there are more) from /markdownfmt/testfiles/example1.input.md

Paragraphs will be also concatenated for clean view.
However, it might be not easy to edit it via editors, so you can specify text line width to be ensured. It also makes sure words are together,so it will ensure wanted line length as you wish.

I want to keep that soft linebreak in the markdown after formatting, it is especially important in the case of quotes.

@bwplotka
Copy link
Collaborator

To me, I believe all of this, generally fits the purpose of this project, so the formatting of markdown from Goldmark parsed data. 🤗

With the Goldmark "options" pattern we can give users the option to chose how things should look like if we have a different use case.

I especially love your ideas as it's something people already do:

For example, https://github.com/13rac1/goldmark-meta is something I handle outside of this project (meta is sometimes called front-matter) you can see it here in my project using markdownfmt. Would be totally nice to handle here indeed.

However, it might be not easy to edit it via editors, so you can specify text line width to be ensured. It also makes sure words are together, so it will ensure the wanted line length as you wish.

In terms of line width, I literally wanted the same thing, see this: #15
I even started implementing this (the refactoring we did recently was triggered by this 🤦🏽 ), but then I realized that IDEs already have tools for that (!). It's called line-wrapping. For example, I could set it in IntelliJ products. I am pretty sure you can configure vim, emacs as well, and others. It would be worth first to double-check this, but if still needed, we can definitely add such an option, IMO.

All of these are my own opinions. Let's see what @Kunde21 says. More contributors/maintainers = better IMO and I feel our goals align.

Great job on those extensions @13rac1 btw! I surprised you did not do mono repo for those though 🤔

@Kunde21
Copy link
Owner

Kunde21 commented Dec 31, 2020

A couple thoughts:

  1. Happy New Year to you both! I hope in this coming year we're able to take this tool from "experimental fork" to "extendable ecosystem."

  2. Right now, we're controlling (hard-coding) the parsing options here. That limits the ability for @13rac1 to plug in those extensions. But that shouldn't require a fork or an integration at this level. I'm looking at the goldmark API and it has a lot of forethought around modifying the parser and renderer, which we could plug into directly. We'll want to move a lot of the helper functions in main.go down into markdownfmt package, then figure out a clean API for using renderer.Option and especially render.WithNodeRenderers to intercept the rendering of node types created by the extension. We might even want to move from the type switch variant to using node.Kind() to route rendering of the node. Still thinking on the best way to approach it.

@Kunde21 Kunde21 linked a pull request Feb 5, 2021 that will close this issue
@Kunde21
Copy link
Owner

Kunde21 commented Feb 5, 2021

@13rac1 @bwplotka - Created a quick idea as to how we can use the existing extension/option setup to add parsing/rendering options. #32

@bwplotka
Copy link
Collaborator

bwplotka commented Feb 7, 2021

Is that blocking us here? I believe @karelbilek added some option handling recently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants