-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add mermaid support #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mermaid support #857
Conversation
|
Thanks - just wanted to note that I haven't abandoned this! Just going through a backlog of other changes right now. |
mattxwang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @nascosto! I've left some comments below. I think we could get this ready for a v0.4.0 release!
LGTM! But see my other suggestions below.
Yes: to avoid requiring users to know/learn/write languages like Javascript when customising a JtD website. I personally have very little knowledge of Javascript, and I dislike having to access the JS console in browsers to debug code. Our docs hardly mention JS at all, and I'd like to stick to that. Users shouldn't need to write or copy a JS file merely to change a mermaid config option.
I was assuming that all existing mermaid config options and their defaults are reasonably stable. Isn't that the case?
Such a user is presumably an experienced mermaid user, and able to edit the variables and their defaults as well as loading a different version. However, I too would prefer not to have all these options inserted directly in
|
|
I've separated out the code into _includes/mermaid_init.html. I have no preference for including all the setting or just a base number. The mermaid_init can always be overridden so either way works. If they move to a version of mermaid that needs more settings (or less), they can always override using _includes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this @nascosto. I think I am generally satisfied with this implementation, though perhaps it will need some more workshopping as the new maintainers get used to the codebase + start becoming more opinionated.
(I do have some thoughts on what @pdmosses has discussed but I'm willing to table them for now!)
Hopefully we will get this out in v0.4.0!
|
FYI, resolved a trivial merge conflict. |
|
@mattxwang @nascosto When using the current I didn't ask to use Mermaid in the config. just-the-docs/_includes/head.html Line 33 in b2581c1
site.mermaid_enabled is nil.
|
|
Ah - perhaps we should change it to |
|
I think that should fix it, because both The rest of the JS error message looked as if something else might be wrong, but it's probably just due to I'll soon start adding tests for new features added in |
…equire `mermaid.version` in `_config.yml` (#909) This PR has a bit of scope creep! This PR now: - changes the mermaid opt-in logic to only check for the existence of a `mermaid` key instead of `mermaid != false`: this resolves the follow-up in #857 - changes the behaviour of mermaid configuration - instead of using `mermaid_init.html` with default settings, makes the include `mermaid_config.js` - the include is loaded directly into the contents of `mermaid_initialize` - by default, it is an empty object (i.e. `{}`), triggering the defaults - updates docs - adds an example to the markdown kitchen sink It does significantly change the interface provided in #857, and I apologize for the confusion. However, given the discussion in this PR, I think it's the best move forward!
Closes #825
This is a follow up to #830 since it has seemed to lose steam from the original submitter @asokolsky. I've tried to address all the comments made.