cryogen

kwladyka 2021-10-06T23:47:06.042500Z

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) 2021-10-07T06:11:45.043700Z

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

kwladyka 2021-10-07T08:12:04.044100Z

hmm interesting, I didn’t know about that

kwladyka 2021-10-07T08:13:33.044400Z

but still I would like to do it using markdown

kwladyka 2021-10-07T08:13:39.044600Z

even if I have to add clj code

kwladyka 2021-10-07T08:24:24.044800Z

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.

kwladyka 2021-10-07T08:24:40.045Z

problem solved

kwladyka 2021-10-07T08:25:05.045200Z

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

Jakub Holý (HolyJak) 2021-10-07T11:21:11.045400Z

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

Jakub Holý (HolyJak) 2021-10-07T11:24:32.045600Z

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

kwladyka 2021-10-07T11:48:17.046200Z

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

kwladyka 2021-10-07T11:49:35.046400Z

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

Jakub Holý (HolyJak) 2021-10-07T16:51:42.046600Z

Not possible in Markdown.

kwladyka 2021-10-07T20:26:36.046800Z

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

Jakub Holý (HolyJak) 2021-10-07T20:50:13.047Z

Exactly

Jakub Holý (HolyJak) 2021-10-07T20:51:44.047200Z

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

kwladyka 2021-10-07T21:20:41.047400Z

Do you mean this specific library which Cryogen use?

Jakub Holý (HolyJak) 2021-10-07T21:50:55.048100Z

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