Fork me on GitHub
#cryogen
<
2021-10-06
>
kwladyka23:10:06

hey, do you have an example of code which will let me add SVG “images” in markdown? I don’t want to reinventing the wheel. I want to add also special class for this elements to change style. In general I have to set at least height.

Jakub Holý (HolyJak)06:10:45

That's why I use AsciiDoc. Much easier to add classes and stuff

kwladyka08:10:04

hmm interesting, I didn’t know about that

kwladyka08:10:33

but still I would like to do it using markdown

kwladyka08:10:39

even if I have to add clj code

kwladyka08:10:24

Oh this is unexpected… <img src="/img/logo/docker.svg" alt="Docker" style="height: 40px"> This is rendered as HTML in markdown file. Not as a text.

kwladyka08:10:40

problem solved

kwladyka08:10:05

but still I would like to add my own markdown tags to render things

Jakub Holý (HolyJak)11:10:11

Why unexpected? Markdown sorts html in Markdown (but not Markdown inside html block elements)

Jakub Holý (HolyJak)11:10:32

Not sure what you mean by "my own Markdown tags". While asciidoctor supports custom inline/block macros, md has no such thing. You might read the docs for the Markdown parser you use. An extreme option is to add custom post - processing with postprocess-article-html-fn, see http://cryogenweb.org/docs/customizing-cryogen.html and https://github.com/cryogen-project/cryogen-core/blob/master/src/cryogen_core/compiler.clj#L574

kwladyka11:10:17

I don’t. Probably I used to github and I think there this doesn’t work.

kwladyka11:10:35

own markdown: for example ##img /img/foo.svg -> H2 img text

Jakub Holý (HolyJak)16:10:42

Not possible in Markdown.

kwladyka20:10:36

What do you mean? No way to extend markdown library?

Jakub Holý (HolyJak)20:10:44

You can do fancy/crazy stuff with the Cryogen postprocess fn I mentioned but Markdown itself has no extension mechanism, contrary to asciidoctor.

kwladyka21:10:41

Do you mean this specific library which Cryogen use?

Jakub Holý (HolyJak)21:10:55

No. The Markdown "standard" has no extensibility fns thus no Markdown library either, IMO. But do your research, I might be wrong.