shurcooL-legacy / atom-markdown-format

Formats your Markdown text on save.

Home Page:https://atom.io/packages/markdown-format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make trigger on save a setting

exalted opened this issue · comments

It is certainly useful to auto trigger formatting on save, but some people may want to trigger it via keyboard shortcuts rather whenever they want to, instead of on each save.

So, I am proposing a setting where optionally we could set a keyboard shortcut, as well as being able to disable auto trigger on save.

I don't think I want to support or encourage this. Here's the motivation.

I want markdownfmt to be unnoticeable and not get in the way. It should work so well, that there should never be time that you want to save and not use it. If it messes something up and you want to disable it, that's likely a bug I'd rather fix so you don't have to worry about enabling/disabling it.

Basically, I want it to work as well and seamlessly as gofmt.

As of shurcooL/markdownfmt#14 being done, I am not aware of any other issues with it. If there are, please report them.

I will not be adding this feature at this time.

Fair enough.

@shurcooL actually it doesn't work with jekyll for example where you have this content :

---
layout: post
title:  "Welcome to Jekyll!"
date:   2014-12-07 16:06:00
categories: jekyll update
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:

{% highlight ruby %}
def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}

Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].

[jekyll]:      http://jekyllrb.com
[jekyll-gh]:   https://github.com/jekyll/jekyll
[jekyll-help]: https://github.com/jekyll/jekyll-help

on save, becoming...:

---

layout: post title: "Welcome to Jekyll!" date: 2014-12-07 16:06:00

categories: jekyll update
-------------------------

You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:

{% highlight ruby %} def print_hi(name) puts "Hi, #{name}" end print_hi('Tom') #=> prints 'Hi, Tom' to STDOUT. {% endhighlight %}

Check out the [Jekyll docs](http://jekyllrb.com) for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo](https://github.com/jekyll/jekyll). If you have questions, you can ask them on [Jekyll’s dedicated Help repository](https://github.com/jekyll/jekyll-help).

That's why you would want to disable on save and trigger it only when you want to.

Thanks

I might do the format on trigger rather than save option.

However, your issue is because there's a YAML header, which needs to be fixed by adding support for it. @bobthecow was considering working on that, see shurcooL/markdownfmt#11 (comment).

@shurcooL yep I saw that. I understand that you don't want to add YAML header support directly on markdownfmt, but with atom-markdown-format, I think it's reasonable to say we should expect FrontMatter support.
I've send this pr #14 to get things started.
Thanks

Thanks, I'll take a look soon.

I am now deprecating this entire package because I do not have enough resources to make it's user experience good enough and thus worthy of existing. Please see #26 for full details and rationale. Because of that, I will close this issue.