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

[request/suggestion] Treat Rmarkdown as Markdown #259

Closed
eddelbuettel opened this issue Sep 2, 2018 · 12 comments
Closed

[request/suggestion] Treat Rmarkdown as Markdown #259

eddelbuettel opened this issue Sep 2, 2018 · 12 comments
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@eddelbuettel
Copy link

Apologies for requesting something that I should probably figure out myself -- but couldn't yet ...

bat is so awesome and addictive that I want to work on Rmarkdown files too. You already support Markdown in many variants, so could the .Rmd extension be aliased? These files often contain code snippets, predominantly in R though other languages are supported as well. Some tools such as Emacs polymode cover both and switch -- that is too much too ask here. But it would be really really nice to see the standard text markup in .Rmd rendered as Markdown.

Thanks for considering this.

@sharkdp sharkdp added the question Further information is requested label Sep 2, 2018
@sharkdp
Copy link
Owner

sharkdp commented Sep 2, 2018

Thank you for your feedback!

You could try to follow the steps in the README concerning customization and add something like this Sublime Text package.

Let me know if that works for you!

@eddelbuettel
Copy link
Author

I saw those hints but backed off as I think I want something simpler. Ie in

edd@rob:~$ bat --list-languages | grep markdown
Markdown                  md, mdown, markdown, markdn
edd@rob:~$ 

I "merely" want another trigger for files ending in .Rmd to also get the existing markdown treatment. That should be simpler than adding a whole language definition, no?

@sharkdp
Copy link
Owner

sharkdp commented Sep 2, 2018

That should be simpler than adding a whole language definition, no?

Yes. In this case, this request is a duplicate of #169.

@sharkdp sharkdp added the duplicate This issue or pull request already exists label Sep 2, 2018
@eddelbuettel
Copy link
Author

Apologies, did not spot that when I was looking for '*markdown' topics.

@sharkdp
Copy link
Owner

sharkdp commented Sep 2, 2018

No worries 👍

@sharkdp sharkdp closed this as completed Sep 2, 2018
@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2018

This is now supported in v0.8.0. Add this to your config file:

--map-syntax Rmd:md

@eddelbuettel
Copy link
Author

Works nicely!

Could you maybe add a default config file in the .deb and other packages?

@sharkdp
Copy link
Owner

sharkdp commented Oct 19, 2018

Thank you for checking!

What would you expect from such a default config file?

@eddelbuettel
Copy link
Author

The way things usually work (and "usually" for me means from a .deb, or from source) is that the binary either has default beahviour baked in, or ships with (or install) a resource file, or both.

Here, in order to see Rmd content, I had to create a new directory (bat worked fine before), look through help outout to learn how to have it write a config stanza and then add the line you recommended in your post from two days ago. Not terrible, simply more manual than usual.

You could just ship a sample config file, and/or post one on the website. I didn't add anything besides that line (and a theme setting).

Am I making sense to you, or are we on different wavelength here?

@sharkdp
Copy link
Owner

sharkdp commented Oct 21, 2018

I think we should definitely add more documentation on how bats configuration file works. I didn't want to add this to the README until #367 is fixed.

I'm not sure if I want to ship a "default" config with bat, but we could certainly add an example config file to the README. The bat --config-file command shows you the path to the configuration file, but it's currently a "hidden feature". Maybe we should make this visible.

@eddelbuettel
Copy link
Author

Visible is good. Right now it is a weeee bit hidden.

@sharkdp
Copy link
Owner

sharkdp commented Oct 24, 2018

Tracking here: #377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants