Closed TueDissingWork closed 3 years ago
Are you using a recent version of the theme, as otherwise you won't have the relevant JS?
@gwatts, any other suggestions?
Are you using a recent version of the theme, as otherwise you won't have the relevant JS?
We configured the following option:
min_version = 0.53
. Which seems to be the recommended minimum version. Should I try with a more recent version?
The same happens to me, enabling mermaid in config.toml
also doesn't work for me. From the browsers console I can see that mermaid
is defined, but the markdown code blocks just display as code blocks. Adding the mermaid cdn, calling the initialize command and using <div class="mermaid">
blocks works fine.
Hugo: hugo v0.81.0-59D15C97+extended linux/amd64
Docsy: commit b2ce247
from March 19 2021
I found the problem!
TLDR: Comment out the guessSyntax = "true"
line from `config.toml:
I noticed, that all of the code blocks with mermaid tags were being rendered as
<code class="language-fallback" data-lang="fallback"></code>
Then looking at the assets/js/mermaid.js
, it will only add the correct class="mermaid"
to elements that have the language-mermaid
class:
var needMermaid = false;
$('.language-mermaid').parent().replaceWith(function() {
needMermaid = true;
return $('<pre class="mermaid">').text($(this).text());
});
if (!needMermaid) {
mermaid.initialize({startOnLoad: false});
return;
}
What fixed this for me, was to comment out the guessSyntax = "true"
line from `config.toml:
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
# See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
style = "monokai"
# Uncomment if you want your chosen highlight style used for code blocks without a specified language
# Comment out this line
#guessSyntax = "true"
So my guess is that the markup highlighter didn't understand the ``mermaid language choice and overwrote it as a fallback thing instead, which caused the
mermaid.jsnot find the element and add the needed class elements around it. I was already using Prism instead of Chroma, so I didn't think that the
guessSyntax` option would be used here though.
Env: hugo v0.81.0-59D15C97+extended linux/amd64 BuildDate=2021-02-19T17:07:12Z VendorInfo=gohugoio Docsy commit c36be07 Wed Jun 23 13:39:19 2021 +0100
I was also able to get Mermaid to render, but not PlantUML. Any luck @TueDissingWork?
I was also able to get Mermaid to render, but not PlantUML. Any luck @TueDissingWork?
I had the same. My docsy project was setup about a year ago so I think some of the original configs had drifted enough to break things. Here is what I did to fix things but I can't exactly say which one did the trick :/
hugo-bin
that is now not needed???
"devDependencies": {
"autoprefixer": "^10.3.3",
"postcss-cli": "^8.3.1"
}
master
(should really rename that) branch
git submodule ...
docsy into my themes dir/tmp
public/
and resources/
dirs just to make surehugo server
with --disableFastRender
just to make sure...and something in all that mess fixed it
I'm running Ubuntu 20.04.3 LTS from Window 10 via WSL (yeah, I know...but my works makes me use Windows...lol)
Hope that helps someone because this was way to hard to track down :)
Thanks guys, Got PlantUML working. Our theme was rather outdated - seems to be working now :-)
Hey,
I am trying to configure either Mermaid or PlantUML for integrating digrams within the code base. However I can't seem to get it working. Was trying to follow this guide: https://www.docsy.dev/docs/adding-content/lookandfeel/#diagrams-with-mermaid and updated the
config.toml
as per the guide. When generating the site, no errors are presented and no diagrams aer generated either :-(Do I need to install some thirdparty dependencies, or I am missing something?
How can I try to troubleshoot this?
/Tue