Implementing codapi into Hugo

Hello all,
I was wondering if anyone here had worked with using

At first glance, it looks like it would be implemented in the same way that mermaid was.

If I’m interested in doing this should I follow the example that mermaid used or just wait for if it becomes part of the tool. I’m hesitant because I don’t know how to write in go or if this would just bloat Hugo.

Any feedback is welcomed.


Mermaid is also not supported natively at the moment.

Using Codeapi using the method they provide seems a better option for now.

1 Like

I’d would create a code block render hook:

└── _default/
    └── _markup/
        └── render-codeblock-codapi.html

And pass the code language in a Markdown attribute:

```codapi {lang=python}
print("Hello, World!")

Just like Mermaid examples in the docs, use .Page.Store.Set to set a boolean flag, then optionally include the playground script if the flag is true.


Thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.