From a7e002cf4d493bc6be54cc153fadf86ec9426656 Mon Sep 17 00:00:00 2001 From: "Charles A. Beynon" Date: Mon, 6 Oct 2014 02:23:45 -0400 Subject: [PATCH] Markdown: Added initial version of Markdown checkers --- syntax_checkers/mkd/mdchecker.vim | 40 +++++++++++++++++++++++ syntax_checkers/mkd/mdkramdownchecker.vim | 40 +++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 syntax_checkers/mkd/mdchecker.vim create mode 100644 syntax_checkers/mkd/mdkramdownchecker.vim diff --git a/syntax_checkers/mkd/mdchecker.vim b/syntax_checkers/mkd/mdchecker.vim new file mode 100644 index 00000000..967317fb --- /dev/null +++ b/syntax_checkers/mkd/mdchecker.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: mdchecker.vim +"Description: Checks Markdown source code using mdl +"Maintainer: Charles Beynon +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_mkd_mdchecker_checker") + finish +endif +let g:loaded_syntastic_mkd_mdchecker_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_mkd_mdchecker_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + + let errorformat = '%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'mkd', + \ 'name': 'mdchecker', + \ 'exec': 'mdl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/syntax_checkers/mkd/mdkramdownchecker.vim b/syntax_checkers/mkd/mdkramdownchecker.vim new file mode 100644 index 00000000..9ff87c29 --- /dev/null +++ b/syntax_checkers/mkd/mdkramdownchecker.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: mdchecker.vim +"Description: Checks Markdown source code using mdl +"Maintainer: Charles Beynon +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_mkd_mdkramdownchecker_checker") + finish +endif +let g:loaded_syntastic_mkd_mdkramdownchecker_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_mkd_mdkramdownchecker_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '--warnings' }) + + + let errorformat = '%f: Kramdown Warning: %m found on line %l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'mkd', + \ 'name': 'mdkramdownchecker', + \ 'exec': 'mdl'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: