* Case: convert from Markdown (gfm) to Jira
@ 2021-12-29 4:48 Andrew Horbach
[not found] ` <646076fb-70ca-4a8e-862f-a71f3421ec51n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Horbach @ 2021-12-29 4:48 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1664 bytes --]
Hello everyone!
I have the following case:
Need to store some docs *md* files in git repo (gfm) convert them into
*Jira* markup and pull markup to Jira task description via Jira automation.
Everything works well in this pipeline, except for some side effects during
conversion:
*For example*:
.md:
`BeforeBackslash\_AfterBacklash`
converted to jira:
{{BeforeBackslash\\_AfterBacklash}}
But I want to receive an exact string with some kind of code highlighting.
Could anyone provide me with some idea of how to do this?
I've tried:
- *pandoc* filters (python package *panflute
<https://github.com/sergiocorreia/panflute>*). May I be wrong, but for me,
filters are like *jq* - it could find some element and change content
inside of it, but the last word will give output format.
- simple stupid *sed *- I tried to change backslash to some placeholder,
for example, *CHANGEME*, convert from gfm to jira, and then sed CHANGEME
inside jira markup for backslash. But sometimes it works unpredictably...
Idea:
I've tested the following markup blocks and if I use {code} instead of {{
with original content of ` from markdown - everything works well.
Maybe I can change ` to something that will give {code} via pandoc filter?
Thanks
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/646076fb-70ca-4a8e-862f-a71f3421ec51n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 2118 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Case: convert from Markdown (gfm) to Jira
[not found] ` <646076fb-70ca-4a8e-862f-a71f3421ec51n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-12-29 6:40 ` Albert Krewinkel
[not found] ` <877dbnrk0o.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Albert Krewinkel @ 2021-12-29 6:40 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
The `raw_attribute` syntax should be helpful here:
https://pandoc.org/MANUAL.html#generic-raw-attribute
Try
`BeforeBackslash\_AfterBacklash`{=jira}
You can also use this feature programmatically via a filter. Here's a
[Lua filter](https://pandoc.org/lua-filters.html) that turns inline code
into raw Jira markup, thereby side-stepping the final conversion step:
function Code (code)
return pandoc.RawInline('jira', '{code}' .. code.text .. '{code}')
end
Hope that helps,
Albert
Andrew Horbach <andrewhorbach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> Hello everyone!
>
> I have the following case:
>
> Need to store some docs *md* files in git repo (gfm) convert them into
> *Jira* markup and pull markup to Jira task description via Jira automation.
> Everything works well in this pipeline, except for some side effects during
> conversion:
>
> *For example*:
>
> .md:
> `BeforeBackslash\_AfterBacklash`
>
> converted to jira:
> {{BeforeBackslash\\_AfterBacklash}}
>
> But I want to receive an exact string with some kind of code highlighting.
> Could anyone provide me with some idea of how to do this?
>
> I've tried:
> - *pandoc* filters (python package *panflute
> <https://github.com/sergiocorreia/panflute>*). May I be wrong, but for me,
> filters are like *jq* - it could find some element and change content
> inside of it, but the last word will give output format.
> - simple stupid *sed *- I tried to change backslash to some placeholder,
> for example, *CHANGEME*, convert from gfm to jira, and then sed CHANGEME
> inside jira markup for backslash. But sometimes it works unpredictably...
>
> Idea:
> I've tested the following markup blocks and if I use {code} instead of {{
> with original content of ` from markdown - everything works well.
>
> Maybe I can change ` to something that will give {code} via pandoc filter?
>
> Thanks
--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Case: convert from Markdown (gfm) to Jira
[not found] ` <877dbnrk0o.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2021-12-29 15:59 ` Andrew Horbach
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Horbach @ 2021-12-29 15:59 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2674 bytes --]
Thanks, I've just used your filter :)
среда, 29 декабря 2021 г. в 09:40:48 UTC+3, Albert Krewinkel:
> The `raw_attribute` syntax should be helpful here:
> https://pandoc.org/MANUAL.html#generic-raw-attribute
>
> Try
>
> `BeforeBackslash\_AfterBacklash`{=jira}
>
> You can also use this feature programmatically via a filter. Here's a
> [Lua filter](https://pandoc.org/lua-filters.html) that turns inline code
> into raw Jira markup, thereby side-stepping the final conversion step:
>
> function Code (code)
> return pandoc.RawInline('jira', '{code}' .. code.text .. '{code}')
> end
>
> Hope that helps,
> Albert
>
> Andrew Horbach <andrew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Hello everyone!
> >
> > I have the following case:
> >
> > Need to store some docs *md* files in git repo (gfm) convert them into
> > *Jira* markup and pull markup to Jira task description via Jira
> automation.
> > Everything works well in this pipeline, except for some side effects
> during
> > conversion:
> >
> > *For example*:
> >
> > .md:
> > `BeforeBackslash\_AfterBacklash`
> >
> > converted to jira:
> > {{BeforeBackslash\\_AfterBacklash}}
> >
> > But I want to receive an exact string with some kind of code
> highlighting.
> > Could anyone provide me with some idea of how to do this?
> >
> > I've tried:
> > - *pandoc* filters (python package *panflute
> > <https://github.com/sergiocorreia/panflute>*). May I be wrong, but for
> me,
> > filters are like *jq* - it could find some element and change content
> > inside of it, but the last word will give output format.
> > - simple stupid *sed *- I tried to change backslash to some placeholder,
> > for example, *CHANGEME*, convert from gfm to jira, and then sed CHANGEME
> > inside jira markup for backslash. But sometimes it works unpredictably...
> >
> > Idea:
> > I've tested the following markup blocks and if I use {code} instead of {{
> > with original content of ` from markdown - everything works well.
> >
> > Maybe I can change ` to something that will give {code} via pandoc
> filter?
> >
> > Thanks
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a8900fb8-da22-444d-9815-dea1d3487e6an%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 4308 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-29 15:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 4:48 Case: convert from Markdown (gfm) to Jira Andrew Horbach
[not found] ` <646076fb-70ca-4a8e-862f-a71f3421ec51n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-29 6:40 ` Albert Krewinkel
[not found] ` <877dbnrk0o.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-12-29 15:59 ` Andrew Horbach
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).