mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Add pandoc as a markdown fixer (#3641)
Utilize pandoc to fix markdown files, currently set to Github-Flavored Markdown, but that can be changed by setting, ale_markdown_pandoc_options.
This commit is contained in:
@@ -316,6 +316,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['reason'],
|
||||
\ 'description': 'Fix ReasonML files with refmt.',
|
||||
\ },
|
||||
\ 'pandoc': {
|
||||
\ 'function': 'ale#fixers#pandoc#Fix',
|
||||
\ 'suggested_filetypes': ['markdown'],
|
||||
\ 'description': 'Fix markdown files with pandoc.',
|
||||
\ },
|
||||
\ 'shfmt': {
|
||||
\ 'function': 'ale#fixers#shfmt#Fix',
|
||||
\ 'suggested_filetypes': ['sh'],
|
||||
|
||||
16
autoload/ale/fixers/pandoc.vim
Normal file
16
autoload/ale/fixers/pandoc.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
scriptencoding utf-8
|
||||
" Author: Jesse Hathaway <jesse@mbuki-mvuki.org>
|
||||
" Description: Fix markdown files with pandoc.
|
||||
|
||||
call ale#Set('markdown_pandoc_executable', 'pandoc')
|
||||
call ale#Set('markdown_pandoc_options', '-f gfm -t gfm -s -')
|
||||
|
||||
function! ale#fixers#pandoc#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'markdown_pandoc_executable')
|
||||
let l:options = ale#Var(a:buffer, 'markdown_pandoc_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' ' . l:options,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user