Skip to content
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

Settings/Preferences config file #93

Closed
mb21 opened this issue Jan 19, 2022 · 1 comment
Closed

Settings/Preferences config file #93

mb21 opened this issue Jan 19, 2022 · 1 comment

Comments

@mb21
Copy link
Owner

mb21 commented Jan 19, 2022

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

@mb21
Copy link
Owner Author

mb21 commented Jan 29, 2022

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...

@mb21 mb21 closed this as completed Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant