boltex / leojs

Leo Literate Editor with Outline in Typescript
https://boltex.github.io/leojs/
MIT License
28 stars 1 forks source link

Consider a leoJS-specific settings file #83

Closed tbpassin closed 9 months ago

tbpassin commented 9 months ago

Currently, leoJS reads the standard Leo leoSettings.leo file, and I presume, myLeoSettings.leo. But in the future, there will be a need for settings files specific to leoJS. For example, @button nodes may need to contain contain javascript instead of Python code.

I propose that leoJS should first look for a settings file specific to leoJS. If not found, copy and rename the corresponding Leo file. For example, on startup:

  1. Try to open leoSettingsJS.leo;
  2. If it does not exist, copy leoSettings.leo to leoSettingsJS.leo;
  3. Process leoSettingsJS.leo.
boltex commented 9 months ago

Haha! It already works (almost) like that. The first version of leojs beta had a misleading startup message stating it read leoSettings.leo while instead it does have an internal leojSettings.leojs file that serves as the base of its settings.

I've since corrected the startup message in 0.2.6 :)

(BTW you can even view it with the minibuffer command : leo-settings to browse its content. It's a read-only internal file so it's not overwritable, and is opened as a new untitled file for you to save somewhere else as a copy if you want to save it under a new file somewhere for personal usage)

image