pandoc-syntax.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. *vim-pandoc-syntax*
  2. *pandoc-syntax*
  3. OVERVIEW
  4. vim-pandoc-syntax is a standalone syntax file for highlighting pandoc flavored
  5. markdown documents, to be used alongside vim-pandoc (see |pandoc|). It is
  6. based on the version once provided by vim-pandoc-legacy, which it obsoletes.
  7. The project resides at http://www.github.com/vim-pandoc/vim-pandoc-syntax. You
  8. are welcome to help, suggest ideas, report bugs or contribute code.
  9. CONFIGURATION *vim-pandoc-syntax-configuration*
  10. + *g:pandoc#syntax#conceal#use*
  11. Use |conceal| for pretty highlighting. Default is 1 for vim version > 7.3
  12. + *g:pandoc#syntax#conceal#blacklist* A list of rules |conceal| should not be
  13. used with. Works as a blacklist, and defaults to [] (use conceal everywhere).
  14. This is a list of the rules wich can be used here:
  15. - titleblock
  16. - image
  17. - block
  18. - subscript
  19. - superscript
  20. - strikeout
  21. - atx
  22. - codeblock_start
  23. - codeblock_delim
  24. - footnote
  25. - definition
  26. - list
  27. - newline
  28. - dashes
  29. - ellipses
  30. - quotes
  31. - inlinecode
  32. - inlinemath
  33. To review what are the rules for, look for the call to |s:WithConceal| in
  34. syntax/pandoc.vim that takes the corresponding rulename as first argument.
  35. + *g:pandoc#syntax#conceal#cchar_overrides*
  36. A dictionary of what characters should be used in conceal rules. These
  37. override the defaults (see those in |s:cchars|). For example, if you prefer
  38. to mark footnotes with the `*` symbol:
  39. let g:pandoc#syntax#conceal#cchar_overrides = {"footnote" : "*"}
  40. + *g:pandoc#syntax#conceal#urls*
  41. Conceal the urls in links.
  42. + *g:pandoc#syntax#codeblocks#ignore*
  43. Prevent highlighting specific codeblock types so that they remain Normal.
  44. Codeblock types include 'definition' for codeblocks inside definition blocks
  45. and 'delimited' for delimited codeblocks. Default = []
  46. + *g:pandoc#syntax#codeblocks#embeds#use*
  47. Use embedded highlighting for delimited codeblocks where a language is
  48. specified. Default = 1
  49. + *g:pandoc#syntax#codeblocks#embeds#langs*
  50. For what languages and using what syntax files to highlight embeds. This is
  51. a list of language names. When the language pandoc and vim use don't match,
  52. you can use the "PANDOC=VIM" syntax. For example:
  53. let g:pandoc#syntax#codeblocks#embeds#langs = ["ruby",
  54. "literatehaskell=lhaskell", "bash=sh"]
  55. + *g:pandoc#syntax#style#emphases*
  56. Use italics and strong in emphases. Default = 1
  57. 0 will add "block" to |g:pandoc#syntax#conceal#blacklist|, because otherwise
  58. you couldn't tell where the styles are applied.
  59. + *g:pandoc#syntax#style#underline_special*
  60. Underline subscript, superscript and strikeout text styles. Default = 1
  61. + *g:pandoc#syntax#style#use_definition_lists*
  62. Detect and highlight definition lists. Disabling this can improve
  63. performance. Default = 1 (i.e., enabled by default)
  64. COMMANDS *pandoc-syntax-commands*
  65. + *:PandocHighlight* LANG
  66. Enable embedded highlighting for language LANG in codeblocks. Uses the
  67. syntax for items in |g:pandoc#syntax#codeblocks#embeds#langs|.
  68. + *:PandocUnhighlight* LANG
  69. Disable embedded highlighting for language LANG in codeblocks.
  70. FUNCTIONS *pandoc-syntax-functions*
  71. + *EnableEmbedsForCodeblocksWithLang(langname)*
  72. As |:PandocHighlight|.
  73. + *DisableEmbedsForCodeblocksWithLang(langname)*
  74. As |:PandocUnhighlight|.
  75. + *s:WithConceal(RULE_GROUP,RULE,CONCEAL_RULE)*
  76. Executes a |:syntax| command RULE, which could incorporate conceal rules
  77. (CONCEAL_RULE) if conceals are enabled. The rule gets named RULE_GROUP,
  78. as used in |g:pandoc#syntax#conceal#blacklist|.
  79. For example, if conceals are enabled
  80. call s:WithConceal("atx", 'syn match AtxStart /#/ contained
  81. containedin=pandocAtxHeader', 'conceal cchar='.s:cchars["atx"])
  82. will execute
  83. syn match AtxStart /#/ contained containedin=pandocAtxHeader conceal cchar=§
  84. and
  85. syn match AtxStart /#/ contained containedin=pandocAtxHeader
  86. otherwise.
  87. TODO
  88. This is a list of know stuff missing from the syntax file.
  89. 1. Highlight code within verbatim text when a language is specified in the attrib,
  90. like in
  91. hey, `print 1 + 3`.{python} is no longer valid in python 3.
  92. MISC
  93. The plugin sets a global variable, *g:vim_pandoc_syntax_exists* to indicate its
  94. existence. This is currently used by vim-pandoc to switch between syntax
  95. assisted and basic folding rules.