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

Add option to run on markdown filetype #8

Open
alerque opened this issue May 18, 2020 · 7 comments
Open

Add option to run on markdown filetype #8

alerque opened this issue May 18, 2020 · 7 comments

Comments

@alerque
Copy link
Owner

alerque commented May 18, 2020

Currently we're assuming people :set ft=commonmark to use this, but given the rest of the ecosystem it's more likely they will want to use markdown or even another filetype, but use this as the syntax. We need a way to enable this use case.

@fmoralesc
Copy link
Collaborator

In vim-pandoc/vim-pandoc-syntax#333 I created a flavor of the pandoc syntax that defers to this when g:pandoc#syntax#flavor is `"ancillary", and extends the supported syntax for more pandoc-aware block types.

@alerque
Copy link
Owner Author

alerque commented May 18, 2020

Good, that's probably a good path forward until I figure out how to compile commonmark-hs and it gets all the extensions we need, which probably won't be until Pandoc itself switches internally for PFM.

@fmoralesc
Copy link
Collaborator

👍 For now the issue will be in making the lua method performant. In my limited testing it made editing slow to a crawl.

@alerque
Copy link
Owner Author

alerque commented May 20, 2020

At the moment this is setup strictly as a syntax highlighter, it doesn't require the filetype being set to match. My current use case is keeping my usual selection of ft=markdown or ft=pandoc and then running :set syntax=commonmark when I want to run this.

I'm not quite sure how to codify this workflow or another appropriate one for others.

@fmoralesc
Copy link
Collaborator

Have you used my ancillary syntax flavor in vim-pandoc-syntax? It makes using this transparent for the pandoc filetype, I've been using it like this for the past few days.

@alerque
Copy link
Owner Author

alerque commented May 20, 2020

No, I haven't. I did see it, but I was mucking around with using commonmark-hs in my vim-pandoc-syntax repo and haven't gotten around to cleaning it so I can go back to a sane working condition and switch branches.

My only question is .... vim-pandoc-syntax is easy since we can set it up to load this however we like, but how does this play with people who want to use it stand-alone (and may even have other plugins watching the markdown file type)?

@fmoralesc
Copy link
Collaborator

Setting up an autocommand should work, although it won't be as clean as having it integrated with the filetype plugin. In case people are using some other markdown plugin, they should probably also ask upstream to add support. That is not our problem. I don't mean to say that we shouldn't make it easy (for example, we could optionally generate some generic autocommands to latch on specific filetypes, a bit like modules are implemented in vim-pandoc), but I don't see it as a big concern overall.

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