public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* DokuWiki writer strips away cs language specification for code block
@ 2017-07-12 17:54 Jan Hamrský
       [not found] ` <882d0e54-31a7-4fb3-bbe0-f8070513a2c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Hamrský @ 2017-07-12 17:54 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2060 bytes --]

Hello, 

I am having slight problem with pandoc functionality for DokuWiki and I am 
not sure if it is a bug, missing feature or how just things are. So here I 
am (as contribution document suggests). 

Pandoc version

pandoc 1.19.2.1 (pandoc-types 1.17.0.5, texmath 0.9.4, skylighting 0.1.1.5)

Command line

pandoc -f markdown -t dokuwiki input.md

Used input

```cs
var answer = 42;
```

Output

<code>
var answer = 42;
</code>

Expected output

<code csharp>
var answer = 42;
</code>

As the pandoc markdown readers (except the strict one) understand the "cs" 
and is also present in "--list-highlight-languages", It would be fine if 
DokuWiki writer does a out of the box transformation using the alias for 
the language (I guess this could be done with filter), because dokuwiki 
accepts only "csharp" (documentation <https://www.dokuwiki.org/wiki:syntax>). 
For end user like me


   - No need to modify already written documents which use "cs" (accepted 
   eg. by Visual Studio Code).
   - Out of the box functionality requires less hassle with setup before 
   usage.
   - More compatibility between formats? With almost zero affects to 
   current usages?

So what you think? Is that missing feature (because it is something new) or 
is that actually a bug (cs is understood by pandoc, but that is somehow 
forgotten by dokuwiki writer)? I am aware of the filter program 
possibilities here, but I am not myself Haskell developer and setup for 
some machines could be painful.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/882d0e54-31a7-4fb3-bbe0-f8070513a2c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5032 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DokuWiki writer strips away cs language specification for code block
       [not found] ` <882d0e54-31a7-4fb3-bbe0-f8070513a2c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-07-13  7:08   ` John MacFarlane
       [not found]     ` <20170713070842.GA38415-gd5emFPDCk1l5R22fHXGm0EMvNT87kid@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2017-07-13  7:08 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

What we'd need in the DokuWiki writer is a translation
manual from skylighting/pandoc language names to DokuWiki
names.  If you want to provide one, we can add this.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DokuWiki writer strips away cs language specification for code block
       [not found]     ` <20170713070842.GA38415-gd5emFPDCk1l5R22fHXGm0EMvNT87kid@public.gmane.org>
@ 2017-07-13 14:33       ` Jan Hamrský
       [not found]         ` <ca40b0c2-5d35-4f0b-bd0d-ae57c0eb65c5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Hamrský @ 2017-07-13 14:33 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2564 bytes --]

Could the translation manual look like a mapping from skylighting/pandoc 
supported languages (from pandoc) to DokuWiki supported languages (from 
documentation). Sample:

[haskell] -> [haskell]
[cs] -> [csharp]
[] -> [6502acme]
[mandoc] -> []

My idea is that such list can be hopefully translated into Haskell 
structures. It should handle following cases:

   - One-to-one mappings (eg. haskell).
   - Mappings with alias used (csharp).
   - Non existing support by skylighting, but supported by DokuWiki.
   - Supported by skylighting, but not supported by DokuWiki.
   

A translation function could handle the data in following way (input is 
language name like "cs", "java" etc.):


   - Find language in array from left side (skylighting).
   - If found, use first language name from the right side. Solves 
   one-to-one mappings (name supported by both skylighting and dokuwiki) and 
   aliases (my case with "cs" and "csharp").
   - If not found, try to find language name in some array from the right 
   side.
   - If found, use the language name. Solves DokuWiki specific languages 
   (supported by DokuWiki, not supported by skylighting).
   - Otherwise treat is like now - not supported. Solves not supported 
   languages.


Note 1: another sample of the problem (except the "csharp") are languages 
like MySQL ("sqlmysql" for skylighting and "mysql" for DokuWiki).

Note 2: apart from the problem, I am not sure if DokuWiki writer does not 
lack some languages in the DokuWiki.hs writer. List of names in code 
contains 79 languages, but the documentation of the DokuWiki has 201 
languages (and their derivatives; counted only parsed lines).

Thanks in advance!

Dne čtvrtek 13. července 2017 9:09:01 UTC+2 John MacFarlane napsal(a):
>
> What we'd need in the DokuWiki writer is a translation 
> manual from skylighting/pandoc language names to DokuWiki 
> names.  If you want to provide one, we can add this. 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ca40b0c2-5d35-4f0b-bd0d-ae57c0eb65c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 6616 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DokuWiki writer strips away cs language specification for code block
       [not found]         ` <ca40b0c2-5d35-4f0b-bd0d-ae57c0eb65c5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-07-13 19:22           ` John MacFarlane
       [not found]             ` <20170713192227.GC41791-gd5emFPDCk1l5R22fHXGm0EMvNT87kid@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2017-07-13 19:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Jan Hamrský [Jul 13 17 07:33 ]:
>   Could the translation manual look like a mapping from
>   skylighting/pandoc supported languages (from pandoc) to DokuWiki
>   supported languages (from documentation). Sample:
>   [haskell] -> [haskell]
>   [cs] -> [csharp]
>   [] -> [6502acme]
>   [mandoc] -> []
>   My idea is that such list can be hopefully translated into Haskell
>   structures.

Yes, this is what I had in mind.  Actually, we don't need to
worry about languages that are supported in dokuwiki but not
pandoc.  We just need a map from pandoc language names
(pandoc --list-highlight-languages) to dokuwiki names.
If you provide the map, I can do the Haskell part.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20170713192227.GC41791%40macbook-air-2.home.
For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: DokuWiki writer strips away cs language specification for code block
       [not found]             ` <20170713192227.GC41791-gd5emFPDCk1l5R22fHXGm0EMvNT87kid@public.gmane.org>
@ 2017-07-16 17:00               ` Jan Hamrský
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Hamrský @ 2017-07-16 17:00 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1696 bytes --]

Translation manual is in the attachement to this message. Following 
applies: 

   - I've included only pandoc to dokuwiki (raw or "aliased") and pandoc to 
   none. Stripped away the "none to dokuwiki". 
   - Source for the pandoc languages : --list-highlight-languages (version 
   1.19.2.1)
   - Source for the dokuwiki languages : dokuwiki syntax page 
   <https://github.com/splitbrain/dokuwiki/blob/release_stable_2017-02-19b/data/pages/wiki/syntax.txt> (latest 
   stable)
   - Source for file suffix to language mapping for Geshi : geshi github 
   <https://github.com/GeSHi/geshi-1.0>

Note: when dokuwiki hits new stable, additional languages should be 
included:

[haxe] -> [haxe]
[julia] -> [julia]
[kotlin] -> [kotlin]
[mathematica] -> [mathematica]
[metafont] -> [metapost]
[octave] -> [octave]
[postscript] -> [postscript]
[r] -> [rsplus]
[rust] -> [rust]

I did not mapped versions, so for example php maps to php, not php5 for 
dokuwiki. 
And I did not tried to be extra smart about the compilers, eg. fasm / nasm 
don't map to asm
in my list. If you think that they should, feel free to modify my list :).

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0923ee97-cf08-4c88-bf66-c80ac8d4b3e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 7949 bytes --]

[-- Attachment #2: pandoc2dokuwiki.txt --]
[-- Type: text/plain, Size: 2112 bytes --]

[abc] -> []
[asn1] -> []
[asp] -> [asp]
[ats] -> []
[awk] -> [awk]
[actionscript] -> [actionscript]
[ada] -> [ada]
[agda] -> []
[alertindent] -> []
[apache] -> [apache]
[bash] -> [bash]
[bibtex] -> [bibtex]
[boo] -> [boo]
[c] -> [c]
[cs] -> [csharp]
[cpp] -> [cpp]
[cmake] -> [cmake]
[css] -> [css]
[changelog] -> []
[clojure] -> [clojure]
[coffee] -> [coffeescript]
[coldfusion] -> [cfm]
[commonlisp] -> [lisp]
[curry] -> []
[d] -> [d]
[dtd] -> []
[diff] -> [diff]
[djangotemplate] -> []
[dockerfile] -> []
[doxygen] -> []
[doxygenlua] -> []
[eiffel] -> [eiffel]
[elixir] -> []
[email] -> [email]
[erlang] -> [erlang]
[fsharp] -> [fsharp]
[fortran] -> [fortran]
[gcc] -> []
[glsl] -> [glsl]
[gnuassembler] -> []
[m4] -> []
[go] -> [go]
[html] -> [html]
[hamlet] -> []
[haskell] -> [haskell]
[haxe] -> []
[ini] -> [ini]
[isocpp] -> []
[idris] -> []
[fasm] -> []
[nasm] -> []
[json] -> []
[jsp] -> []
[java] -> [java]
[javascript] -> [javascript]
[javadoc] -> []
[julia] -> []
[kotlin] -> []
[llvm] -> [llvm]
[latex] -> [latex]
[lex] -> []
[lilypond] -> []
[literatecurry] -> []
[literatehaskell] -> []
[lua] -> [lua]
[mips] -> []
[makefile] -> [make]
[markdown] -> []
[mathematica] -> []
[matlab] -> [matlab]
[maxima] -> []
[mediawiki] -> []
[metafont] -> []
[modelines] -> []
[modula2] -> [modula2]
[modula3] -> [modula3]
[monobasic] -> []
[ocaml] -> [ocaml]
[objectivec] -> [objc]
[objectivecpp] -> []
[octave] -> []
[opencl] -> []
[php] -> [php]
[pascal] -> [pascal]
[perl] -> [perl]
[pike] -> [pike]
[postscript] -> []
[prolog] -> [prolog]
[pure] -> []
[purebasic] -> [purebasic]
[python] -> [python]
[r] -> []
[relaxng] -> []
[relaxngcompact] -> []
[roff] -> []
[ruby] -> [ruby]
[rhtml] -> [rails]
[rust] -> []
[sgml] -> []
[sql] -> [sql]
[sqlmysql] -> [mysql]
[sqlpostgresql] -> [postgresql]
[scala] -> [scala]
[scheme] -> [scheme]
[tcl] -> [tcl]
[tcsh] -> []
[texinfo] -> []
[mandoc] -> []
[vhdl] -> [vhdl]
[verilog] -> [verilog]
[xml] -> [xml]
[xul] -> []
[yaml] -> [yaml]
[yacc] -> []
[zsh] -> []
[dot] -> [dot]
[noweb] -> []
[rest] -> []
[sci] -> [scilab]
[sed] -> []
[xorg] -> [xorg_conf]
[xslt] -> []

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-16 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12 17:54 DokuWiki writer strips away cs language specification for code block Jan Hamrský
     [not found] ` <882d0e54-31a7-4fb3-bbe0-f8070513a2c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-07-13  7:08   ` John MacFarlane
     [not found]     ` <20170713070842.GA38415-gd5emFPDCk1l5R22fHXGm0EMvNT87kid@public.gmane.org>
2017-07-13 14:33       ` Jan Hamrský
     [not found]         ` <ca40b0c2-5d35-4f0b-bd0d-ae57c0eb65c5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-07-13 19:22           ` John MacFarlane
     [not found]             ` <20170713192227.GC41791-gd5emFPDCk1l5R22fHXGm0EMvNT87kid@public.gmane.org>
2017-07-16 17:00               ` Jan Hamrský

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).