jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.03k stars 3.35k forks source link

[Request] couple aliases for highliting fenced code #1318

Closed vovkkk closed 10 years ago

vovkkk commented 10 years ago

In order to support GitHub Markdown, Pandoc should recognize c++ as cpp, and objective-c as objectivec.

Examples:

plain

vovkkk commented 10 years ago

Yesterday I’ve start checking other languages (take info from linguist). Stuck on F#. examples

Pandoc
(striked langs doesn’t work in GFM,
I’m not imply removing
it is just a matter of emphisising)
GitHub Markdown
actionscript as (as3 is highlighted differently)
ada adb ads
apache apacheconf
asp aspx aspx-vb asax ascx ashx asmx aspx axd
awk gawk mawk nawk
bash sh
clojure clj cljs
coffee coffee-script coffeescript
commonlisp lisp cl
cs c# csharp
djangotemplate jinja
eiffel e
erlang hrl
fortran f f90

@jgm does it make sense? should I continue?

arthurzenika commented 9 years ago

Hi, I'm trying to get jinja highlighting for the following ReST code converted to latex (then to PDF) :


.. code-block:: jinja

  {% for user in users %}
    - name : user
  {% endfor %}

replacing jinja by djangotemplate show a bit more color.

Any reason why, if pygments is used, this is not supported ?

Should I file a new issue ?

tarleb commented 9 years ago

Pandoc uses highlighting kate for syntax highlighting. Pygments isn't used by default. Both highlighters use different language keywords, which is why jinja won't work.

If you need your highlighting to be done by Pygments, you might want to look at pandoc-with-pygments and similar projects.

arthurzenika commented 9 years ago

@tarleb thanks for the answer. The documentation probably could be updated then : http://pandoc.org/README.html says pygments is the default highlighter. Do you think it would work with --highlight-style=pygments ?

Requested jinja templating on kate and will take a look at pandoc-with-pygments

tarleb commented 9 years ago

Whoops, I'm probably wrong, then. Last time I checked it used hightlighting kate, but this might have changed without me noting.

jgm commented 9 years ago

+++ Arthur Lutz [May 22 15 08:28 ]:

[1]@tarleb thanks for the answer. The documentation probably could be updated then : [2]http://pandoc.org/README.html says pygments is the default highlighter. Do you think it would work with --highlight-style=pygments ?

Pandoc always uses highlighting-kate, never pygments. --highlight-style selects the color scheme. One of highlighting-kate's color schemes is called pygments, because it imitates pygments' default color scheme. (And that's the default.)

arthurzenika commented 9 years ago

@jgm thanks for the clarification. Maybe the documentation could include this information ? And a word of warning about code-block names that are not the same between pygments and kate.