Comments (4)
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 🤔
from markdownfmt.
A couple thoughts:
-
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."
-
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 intomarkdownfmt
package, then figure out a clean API for usingrenderer.Option
and especiallyrender.WithNodeRenderers
to intercept the rendering of node types created by the extension. We might even want to move from the type switch variant to usingnode.Kind()
to route rendering of the node. Still thinking on the best way to approach it.
from markdownfmt.
@13rac1 @bwplotka - Created a quick idea as to how we can use the existing extension/option setup to add parsing/rendering options. #32
from markdownfmt.
Is that blocking us here? I believe @karelbilek added some option handling recently?
from markdownfmt.
Related Issues (20)
- Make hash headers optional and default HOT 3
- Control the width of markdown lines. HOT 4
- Cleanup Renderer implementation HOT 6
- Setup CI HOT 4
- Wrong formatting of code blocks (wrong whitespaces) HOT 3
- Maintenance. HOT 1
- heading classes/attributes not preserved HOT 2
- please add missing LICENSE file to make e.g. pkg.go.dev work HOT 1
- add original authors to license HOT 1
- Do not delete soft lines (optionally?) HOT 5
- Add linting to the CI HOT 1
- How to change Italics character
- Disable formatting of code blocks by default
- Detach the fork HOT 1
- Drop use of pkg/errors
- Possibility of a v3 release HOT 2
- Nested list elements get indented by two spaces instead of four, which breaks certain renderers HOT 5
- Support Front Matter of Markdown HOT 1
- Feature: hard wrap lines to specified length
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdownfmt.