public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* pandocfilters converting pandoc_markdown to gitlab_markdown filter
@ 2018-12-18 10:06 thomas.foers-Re5JQEeQqe8AvxtiuMwx3w
       [not found] ` <9149e7a4-6432-4e71-a71d-c48dca8ac29b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: thomas.foers-Re5JQEeQqe8AvxtiuMwx3w @ 2018-12-18 10:06 UTC (permalink / raw)
  To: pandoc-discuss


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




*# Request one*


I would like to write documentation in markdown (pandoc) but want to push 
to gitlab my files for documentation purpose. For this I would like to 
parse/change the *.md files via pandoc, so it can be interpreted on 
gitlab.com


*markdown (gitlab) => markdown (pandoc)* (jgm/pandocfilter is possible)


But is there also a visa versa case possible *markdown (pandoc)* => *markdown 
(gitlab)*.

going from:


$$ \frac{1}{T \cdot p} $$


to


``` math
\frac{1}{T \cdot p}
```
 

Any help would be appreciated.



*# Request two*


When doing coding I want to use doxygen as backend for documentation code. 
Therefore I write docs in markdown, too. A parser/filter via pandoc from *markdown 
(doxygen)* => *markdown (gitlab) *would be help full, too.


\f[
\frac{1}{T \cdot p}
\f]


to


``` math
\frac{1}{T \cdot p}
```

and 

[link01](@ref reference01)

to 

[link01](./docs/reference01.md)

Thanks. Help would be appriciated.
Thomas

-- 
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/9149e7a4-6432-4e71-a71d-c48dca8ac29b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: pandocfilters converting pandoc_markdown to gitlab_markdown filter
       [not found] ` <9149e7a4-6432-4e71-a71d-c48dca8ac29b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-12-18 17:54   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2018-12-18 17:54 UTC (permalink / raw)
  To: thomas.foers-Re5JQEeQqe8AvxtiuMwx3w, pandoc-discuss


For request one, one awkward thing is that display
math is an inline element in pandoc, so you can't just
replace it with a code block.

So your best bet is to intercept math elements in your
filter, and convert them into RawInline (Format
"markdown") with the precise output you want.

I'd recommend using lua filters for this (no
dependencies); see the documentation on the website
which contains many examples, and ask here if you get
stuck in your attempt.

For request two, this is probably not possible to
handle in a filter, because pandoc won't parse this
as a special, literal environment.  Your best bet
here would be to preprocess the input with perl
or something, replacing \f[ with ``` math etc.

As for the links, this can be done in a filter.


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

end of thread, other threads:[~2018-12-18 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 10:06 pandocfilters converting pandoc_markdown to gitlab_markdown filter thomas.foers-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <9149e7a4-6432-4e71-a71d-c48dca8ac29b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-12-18 17:54   ` John MacFarlane

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).