mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 03:11:29 +08:00
feat: add footnote setting option
This commit is contained in:
parent
b4788f559a
commit
318bfc6aa2
@ -50,6 +50,7 @@ Preferences can be controlled and modified in the settings window or via the `pr
|
||||
| listIndentation | String | 1 | The list indentation of sub list items or paragraphs, optional value `dfm`, `tab` or number 1~4 |
|
||||
| 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 markdown extension footnote |
|
||||
|
||||
#### Theme
|
||||
|
||||
|
@ -237,6 +237,11 @@
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"footnote": {
|
||||
"description": "Markdown-Enable pandoc's markdown extension footnote.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"theme": {
|
||||
"description": "Theme--Select the theme used in Mark Text",
|
||||
|
@ -277,7 +277,7 @@ export const MUYA_DEFAULT_OPTION = {
|
||||
|
||||
// Markdown extensions
|
||||
superSubScript: false,
|
||||
footnote: true
|
||||
footnote: false
|
||||
}
|
||||
|
||||
// export const DIAGRAM_TEMPLATE = {
|
||||
|
@ -29,5 +29,5 @@ export default {
|
||||
math: true,
|
||||
frontMatter: true,
|
||||
superSubScript: false,
|
||||
footnote: true
|
||||
footnote: false
|
||||
}
|
||||
|
@ -107,6 +107,7 @@ class ExportHtml {
|
||||
this.mathRendererCalled = false
|
||||
let html = marked(this.markdown, {
|
||||
superSubScript: this.muya ? this.muya.options.superSubScript : false,
|
||||
footnote: this.muya ? this.muya.options.footnote : false,
|
||||
highlight (code, lang) {
|
||||
// Language may be undefined (GH#591)
|
||||
if (!lang) {
|
||||
|
@ -137,6 +137,7 @@ export default {
|
||||
listIndentation: state => state.preferences.listIndentation,
|
||||
frontmatterType: state => state.preferences.frontmatterType,
|
||||
superSubScript: state => state.preferences.superSubScript,
|
||||
footnote: state => state.preferences.footnote,
|
||||
lineHeight: state => state.preferences.lineHeight,
|
||||
fontSize: state => state.preferences.fontSize,
|
||||
codeFontSize: state => state.preferences.codeFontSize,
|
||||
@ -251,6 +252,12 @@ export default {
|
||||
editor.setOptions({ superSubScript: value }, true)
|
||||
}
|
||||
},
|
||||
footnote: function (value, oldValue) {
|
||||
const { editor } = this
|
||||
if (value !== oldValue && editor) {
|
||||
editor.setOptions({ footnote: value }, true)
|
||||
}
|
||||
},
|
||||
hideQuickInsertHint: function (value, oldValue) {
|
||||
const { editor } = this
|
||||
if (value !== oldValue && editor) {
|
||||
@ -447,6 +454,7 @@ export default {
|
||||
listIndentation,
|
||||
frontmatterType,
|
||||
superSubScript,
|
||||
footnote,
|
||||
hideQuickInsertHint,
|
||||
editorLineWidth,
|
||||
theme,
|
||||
@ -490,6 +498,7 @@ export default {
|
||||
listIndentation,
|
||||
frontmatterType,
|
||||
superSubScript,
|
||||
footnote,
|
||||
hideQuickInsertHint,
|
||||
hideLinkPopup,
|
||||
spellcheckEnabled: spellcheckerEnabled,
|
||||
|
@ -54,6 +54,12 @@
|
||||
:onChange="value => onSelectChange('superSubScript', value)"
|
||||
more="https://pandoc.org/MANUAL.html#superscripts-and-subscripts"
|
||||
></bool>
|
||||
<bool
|
||||
description="Enable pandoc's markdown extension footnote(need restart Mark Text)."
|
||||
:bool="footnote"
|
||||
:onChange="value => onSelectChange('footnote', value)"
|
||||
more="https://pandoc.org/MANUAL.html#footnotes"
|
||||
></bool>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -95,7 +101,8 @@ export default {
|
||||
tabSize: state => state.preferences.tabSize,
|
||||
listIndentation: state => state.preferences.listIndentation,
|
||||
frontmatterType: state => state.preferences.frontmatterType,
|
||||
superSubScript: state => state.preferences.superSubScript
|
||||
superSubScript: state => state.preferences.superSubScript,
|
||||
footnote: state => state.preferences.footnote
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
@ -41,6 +41,7 @@ const state = {
|
||||
listIndentation: 1,
|
||||
frontmatterType: '-',
|
||||
superSubScript: false,
|
||||
footnote: false,
|
||||
|
||||
theme: 'light',
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
"listIndentation": 1,
|
||||
"frontmatterType": "-",
|
||||
"superSubScript": false,
|
||||
"footnote": false,
|
||||
|
||||
"theme": "light",
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user