diff --git a/docs/PREFERENCES.md b/docs/PREFERENCES.md
index ae125431..f8b6d008 100644
--- a/docs/PREFERENCES.md
+++ b/docs/PREFERENCES.md
@@ -52,6 +52,7 @@ Preferences can be controlled and modified in the settings window or via the `pr
| frontmatterType | String | `-` | The frontmatter type: `-` (YAML), `+` (TOML), `;` (JSON) or `{` (JSON) |
| superSubScript | Boolean | `false` | Enable pandoc's markdown extension superscript and subscript. |
| footnote | Boolean | `false` | Enable pandoc's footnote markdown extension |
+| sequenceTheme | String | `hand` | Change the theme of [js-sequence-diagrams](https://bramp.github.io/js-sequence-diagrams/) |
#### Theme
diff --git a/src/main/preferences/schema.json b/src/main/preferences/schema.json
index ea5aaafe..abea67e2 100644
--- a/src/main/preferences/schema.json
+++ b/src/main/preferences/schema.json
@@ -257,6 +257,13 @@
"type": "boolean",
"default": false
},
+ "sequenceTheme": {
+ "description": "Markdown--Sequence diagram theme",
+ "enum": [
+ "hand",
+ "simple"
+ ]
+ },
"theme": {
"description": "Theme--Select the theme used in Mark Text",
diff --git a/src/muya/lib/utils/exportHtml.js b/src/muya/lib/utils/exportHtml.js
index f2f79144..372ec6bc 100644
--- a/src/muya/lib/utils/exportHtml.js
+++ b/src/muya/lib/utils/exportHtml.js
@@ -71,7 +71,7 @@ class ExportHtml {
preParent.replaceWith(diagramContainer)
const options = {}
if (functionType === 'sequence') {
- Object.assign(options, { theme: 'hand' })
+ Object.assign(options, { theme: this.muya.options.sequenceTheme })
} else if (functionType === 'vega-lite') {
Object.assign(options, {
actions: false,
diff --git a/src/renderer/components/editorWithTabs/editor.vue b/src/renderer/components/editorWithTabs/editor.vue
index c7ead236..91fe316e 100644
--- a/src/renderer/components/editorWithTabs/editor.vue
+++ b/src/renderer/components/editorWithTabs/editor.vue
@@ -151,6 +151,7 @@ export default {
imageInsertAction: state => state.preferences.imageInsertAction,
imageFolderPath: state => state.preferences.imageFolderPath,
theme: state => state.preferences.theme,
+ sequenceTheme: state => state.preferences.sequenceTheme,
hideScrollbar: state => state.preferences.hideScrollbar,
spellcheckerEnabled: state => state.preferences.spellcheckerEnabled,
spellcheckerIsHunspell: state => state.preferences.spellcheckerIsHunspell,
@@ -235,6 +236,12 @@ export default {
}
}
},
+ sequenceTheme: function (value, oldValue) {
+ const { editor } = this
+ if (value !== oldValue && editor) {
+ editor.setOptions({ sequenceTheme: value }, true)
+ }
+ },
listIndentation: function (value, oldValue) {
const { editor } = this
if (value !== oldValue && editor) {
@@ -468,6 +475,7 @@ export default {
hideQuickInsertHint,
editorLineWidth,
theme,
+ sequenceTheme,
spellcheckerEnabled,
hideLinkPopup
} = this
@@ -512,6 +520,7 @@ export default {
footnote,
hideQuickInsertHint,
hideLinkPopup,
+ sequenceTheme,
spellcheckEnabled: spellcheckerEnabled,
imageAction: this.imageAction.bind(this),
imagePathPicker: this.imagePathPicker.bind(this),
diff --git a/src/renderer/prefComponents/markdown/config.js b/src/renderer/prefComponents/markdown/config.js
index f62b2ca1..9c70341c 100644
--- a/src/renderer/prefComponents/markdown/config.js
+++ b/src/renderer/prefComponents/markdown/config.js
@@ -72,3 +72,11 @@ export const frontmatterTypeOptions = [{
label: 'JSON ({})',
value: '{'
}]
+
+export const sequenceThemeOptions = [{
+ label: 'Hand drawn',
+ value: 'hand'
+}, {
+ label: 'Simple',
+ value: 'simple'
+}]
diff --git a/src/renderer/prefComponents/markdown/index.vue b/src/renderer/prefComponents/markdown/index.vue
index 8a939cce..572bfbe1 100644
--- a/src/renderer/prefComponents/markdown/index.vue
+++ b/src/renderer/prefComponents/markdown/index.vue
@@ -60,6 +60,15 @@
:onChange="value => onSelectChange('footnote', value)"
more="https://pandoc.org/MANUAL.html#footnotes"
>
+