mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
Merge branch 'main' of https://github.com/nexeck/hugo-theme-relearn into nexeck-main
This commit is contained in:
commit
66c8fcade1
1 changed files with 10 additions and 5 deletions
|
@ -179,10 +179,15 @@ function initMermaid( update, attrs ) {
|
|||
};
|
||||
|
||||
var serializeGraph = function( graph ){
|
||||
if (JSON.stringify(graph.dir) === '{}') {
|
||||
return '---\n' + jsyaml.dump(graph.yaml) + '---\n' + graph.content;
|
||||
yamlPart = '';
|
||||
dirPart = '';
|
||||
if (JSON.stringify(graph.dir) !== '{}') {
|
||||
dirPart = '%%{init: ' + JSON.stringify(graph.dir) + '}%%\n';
|
||||
}
|
||||
return '---\n' + jsyaml.dump(graph.yaml) + '---\n' + '%%{init: ' + JSON.stringify(graph.dir) + '}%%\n' + graph.content;
|
||||
if (JSON.stringify(graph.yaml) !== '{}') {
|
||||
yamlPart = '---\n' + jsyaml.dump(graph.yaml) + '---\n';
|
||||
}
|
||||
return yamlPart + dirPart + graph.content;
|
||||
};
|
||||
|
||||
var init_func = function( attrs ){
|
||||
|
@ -277,7 +282,7 @@ function initMermaid( update, attrs ) {
|
|||
}
|
||||
var is_initialized = ( update ? update_func( attrs ) : init_func( attrs ) );
|
||||
if( is_initialized ){
|
||||
mermaid.init();
|
||||
mermaid.init({theme: attrs.theme});
|
||||
// zoom for Mermaid
|
||||
// https://github.com/mermaid-js/mermaid/issues/1860#issuecomment-1345440607
|
||||
var svgs = d3.selectAll( '.mermaid.zoom svg' );
|
||||
|
|
Loading…
Reference in a new issue