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

Method of setting global default state of Markdown input extensions #59

Open
Honestpuck opened this issue Feb 29, 2016 · 5 comments
Open

Comments

@Honestpuck
Copy link

I appreciate that you have included 5 possible sets of Markdown extensions but I like to use a slight variant of Github Markdown. I'd also like to set it for all Markdown documents.

Is is possible to set the extensions selected for the default "Markdown" input format, leaving the other four intact as they are "standards".

@joostkremers
Copy link
Owner

Is is possible to set the extensions selected for the default "Markdown" input format,

It depends. That's to say, strictly speaking, it's not possible, but there may be a workaround.

In general, it's possible to set the input extensions in a pandoc-mode settings file. So what you would have to do is create global settings files for your output formats and set the relevant input extensions (or read-extensions, as they're called in settings files) to their desired values.

Obviously, that's not perfect, because you'd need to change several files if you ever wanted to make a change to your custom Markdown format. It shouldn't be too difficult to add a user option "Default Markdown Input Format" and have it include a custom option where the user can specify the input extensions. I'll see if I can add such an option in the next few days.

@Honestpuck
Copy link
Author

If you could give me an example of what needs to go in the pandoc-mode settings file and tell me where to put it I'd be grateful. I can't quite figure out those details. :)

As for needing multiple files I can probably figure out a script to build them when I need to change an option.

That said, I'd love you to do the work.

(And thank you for such a useful tool, it makes pandoc so much more useful.)

@joostkremers
Copy link
Owner

If you could give me an example of what needs to go in the pandoc-mode settings file and tell me where to put it I'd be grateful. I can't quite figure out those details. :)

I've tried explaining it in the manual under "Settings Files", but perhaps it's not very clear. (I do write awful documentation sometimes... ;-) The simplest way is to take any Markdown file, use the menu to set the output format and then all the options (make sure to set the output format first), and then select "Save global settings file" through the hydra menu (C-/ s g). That will create a settings file in the directory specified by the option pandoc-data-dir, which defaults to ~/.emacs.d/pandoc-mode. Then repeat for the next output format.

You can look at a settings file and see what it looks like if you want to create them by hand, but there's no real need, I think.

Note, though, that you'll have to create the directory ~/.emacs.d/pandoc-mode first, because pandoc-mode doesn't do that automatically. (Though I just pushed a change that fixes this, so if you wait a few hours and then update your packages, pandoc-mode will create the directory for you.)

@Honestpuck
Copy link
Author

Aaaah, now I get you. The penny drops.

Thank you, Joost.

Sent over my RFC 1149 compliant IPoAC link. Lost packets leading to
garbled or strange messages are entirely the fault of the link and should
not be seen as a reflection of the mental state of the person writing.

On Tue, Mar 1, 2016 at 6:18 PM, Joost Kremers [email protected]
wrote:

If you could give me an example of what needs to go in the pandoc-mode
settings file and tell me where to put it I'd be grateful. I can't quite
figure out those details. :)

I've tried explaining it in the manual
https://joostkremers.github.io/pandoc-mode/ under "Settings Files", but
perhaps it's not very clear. (I do write awful documentation sometimes...
;-) The simplest way is to take any Markdown file, use the menu to set the
output format and then all the options (make sure to set the output format
first), and then select "Save global settings file" through the hydra menu (C-/
s g). That will create a settings file in the directory specified by the
option pandoc-data-dir, which defaults to ~/.emacs.d/pandoc-mode. Then
repeat for the next output format.

You can look at a settings file and see what it looks like if you want to
create them by hand, but there's no real need, I think.

Note, though, that you'll have to create the directory
~/.emacs.d/pandoc-mode first, because pandoc-mode doesn't do that
automatically. (Though I just pushed a change that fixes this, so if you
wait a few hours and then update your packages, pandoc-mode will create
the directory for you.)


Reply to this email directly or view it on GitHub
#59 (comment)
.

@joostkremers
Copy link
Owner

Aaaah, now I get you. The penny drops.

Thank you, Joost.

Great, glad it works!

Customising the Markdown input dialect turns out not to be as easy as I initially thought. I'll post here if I come up with something, though.

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

No branches or pull requests

2 participants