Settings/Preferences config file
mb21 opened this issue · 1 comments
add a way to load asettings.yaml
file if one is found in the data directory (use the dataDir function).
Format should be expandable to contain settings for:
- set a CodeMirror editor theme css
- choose
pandoc
executable (probably with file-open dialog, which we can use for app sandboxing with security-scoped bookmarks) autoUpdateApp: boolean
// default is true- ...?
so maybe a good format for the settings.yaml
would be something like:
editorStyles: |-
body {
font-family: Arial;
}
pandocExecPath: '/usr/bin/'
We can later add a GUI to edit that file, as well as edit the default CSS and YAML files.
Let's learn from https://code.visualstudio.com/docs/getstarted/settings
Implemented in #98. In the process I decided for now to:
-
remove setting.pandocExecPath for now
because it's tricky to get this right without compromising security: e.g if we read it directly from the AppState, can arbitrary code in electron renderer process set it to an arbitrary path?
-
remove editorIncludes or editorStyles fields
because I'm having seconds thoughts about injecting arbitrary JS or even CSS. We cannot even limit the CSS's scope to .react-codemirror2 without parsing it. I remember having read that VScode chose not to do this after having learnt from Atom's mistakes there.
we can create separate issues to discuss those...