Comments (10)
Hi !
I have the same problem. But I fix it.
I can't found mermaid.js
downloaded on _static files, so Sphinx doesn't download it.
So the browser doesn't load mermaid.js
packages, and can't find mermaid.* references for rendering.
I have resolved it:
- downloading the file from CDN
wget https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.9.1/mermaid.js
, - put it into _static/js`
- and put this directive to config.py :
html_js_files = [ 'js/mermaid.js', ]
Check if it works for you!
I will try to find why isn't downloaded automatically, or create a PR advertising of that on readme.md
Good luck!
from sphinxcontrib-mermaid.
Yeah we did the same in last but instead of downloading the js file i am rendering it directly https://searchfox.org/mozilla-central/source/docs/conf.py#77 , earlier we used to have this post script to render on every page https://phabricator.services.mozilla.com/D105674
from sphinxcontrib-mermaid.
Hi !
I have the same problem. But I fix it.
I can't found
mermaid.js
downloaded on _static files, so Sphinx doesn't download it.
So the browser doesn't loadmermaid.js
packages, and can't find mermaid.* references for rendering.I have resolved it:
- downloading the file from CDN
wget https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.9.1/mermaid.js
,- put it into _static/js`
- and put this directive to config.py :
html_js_files = [ 'js/mermaid.js', ]
Check if it works for you!
I will try to find why isn't downloaded automatically, or create a PR advertising of that on
readme.md
Good luck!
I guess in the latest Sphinx 3.5.1 they removed some functionality i am not sure though thats why sphinx is not able to find mermaid script in _static
from sphinxcontrib-mermaid.
I think i found it.
@mgaitan is posible that may be load need to change this method? register?
Changed in version 1.8: Renamed from app.add_javascript(). And it allows keyword arguments as attributes of script tag.
from sphinxcontrib-mermaid.
I've just committed a patch among a set of basic unit tests (finally!). Published 0.6.3
@gil-obradors you were right, that was the problem but needed to do that not in the setup nor the actual node handler but in a special function called via "html-page-context" signal (doing it in the setup makes the tests with conf overrides to fail).
I'm no sure if I've just broke compatibility with not so old sphinx versions I'd happily accept a PR to fix it if so).
from sphinxcontrib-mermaid.
I think I'm getting the same javascript error: Uncaught ReferenceError: mermaid is not defined
.
I'm using sphinxcontrib-mermaid v0.6.3 and sphinx v3.5.2 (though this also failed on 3.4.3 before I upgraded). I had stumbled upon the solution outlined by @gil-obradors , which allowed things to work locally, but ultimately failed when I pushed to readthedocs.
from sphinxcontrib-mermaid.
I'm on v0.6.2
,
I will try v0.6.3
@iancze
from sphinxcontrib-mermaid.
In Production, same happening with me, I am getting same error as @iancze
from sphinxcontrib-mermaid.
Seeing the same issue here
from sphinxcontrib-mermaid.
@mgaitan I've proposed a fix for this issue which should be a more permanent solution to the problem.
Is there a way you can upstream the patch or fix it in another proposed way?
The PR with the proposed fix is #77
from sphinxcontrib-mermaid.
Related Issues (20)
- Incorrect sequence rendering
- suggested addition to documentation for building PDFs on readthedocs.io HOT 1
- Support `title` option in `mermaid` MyST directive HOT 1
- Defer javascript load HOT 1
- mermaid cdn change? HOT 14
- Mermaid renders text with no errors HOT 8
- Bundle the JS dependency in the built HTML folder HOT 1
- Add optional zoom functionality HOT 3
- This package raises DeprecationWarnings HOT 1
- Add distinct CSS class to `<img>` tags
- 0.7.1: module not ready for sphinx >= 6.x HOT 1
- Add height rendering options? Or maybe full screen? HOT 1
- Incorrect rendering due to wrong script sequence in HTML file HOT 3
- zoom is not working
- Diagram not rendering if it's in an unopened tab from sphinx-design's tab-set HOT 1
- Request: supporting mermaid diagrams directly in a Python docstring HOT 3
- Add translation support for mermaid
- Support for static pre-rendering
- On the same website, some pages can render mermaid diagrams correctly, while others cannot.
- When a URL link highlight targets a part of the Mermaid chart, a syntax error is displayed for some browser.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinxcontrib-mermaid.