Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
Stuff that should not affect usability, but is good to do to prepare for #146 / #159.
[x] Rename parseShellCommandVariables() to parseVariables().
[x] Move special character escaping call from Variable class to parseVariables().
[x] Make variable_name, help_text, getAvailabilityText() and getAutocompleteItems() non-static in Variable class.
[x] Store variables in a VariableSet (in SC_Plugin class) instead of creating variables again and again every time they are used.
[x] Rename getVariables() to loadVariables() and only call it from SC_Plugin.
[x] Add a getVariables()method to SC_Plugin (different than the getVariables()function mentioned above, which will be renamed to loadVariables() to avoid confusion.).
[x] Remove getVariableClasses() function and convert its only usage (autocomplete list generator) to use SC_Plugin.getVariables().
[x] Variable.ts: Move IArguments and IParameters interfaces from the top to the bottom of the file, so that they are not reserving space from the Variable class.
[x] EventVariable: Do not require SC_Event as a constructor argument, but instead get it as a parameter to generateValue() method. Remove it from SC_Plugin.loadVariables() and add it to Variable.getValue(). This simplifies parameter chains and makes it possible to decide the used SC_Event at EventVariable usage time, not when creating the variable.
[x] Variable.getValue(): Return an object instead of a string. The object contains the value (if getting one succeeded) or error messages (if getting a value failed). Variable.getErrorMessages() is removed.
Stuff that should not affect usability, but is good to do to prepare for #146 / #159.
parseShellCommandVariables()
toparseVariables()
.Variable
class toparseVariables()
.variable_name
,help_text
,getAvailabilityText()
andgetAutocompleteItems()
non-static inVariable
class.VariableSet
(inSC_Plugin
class) instead of creating variables again and again every time they are used.getVariables()
toloadVariables()
and only call it fromSC_Plugin
.getVariables()
method toSC_Plugin
(different than thegetVariables()
function mentioned above, which will be renamed toloadVariables()
to avoid confusion.).getVariableClasses()
function and convert its only usage (autocomplete list generator) to useSC_Plugin.getVariables()
.Variable.ts
: MoveIArguments
andIParameters
interfaces from the top to the bottom of the file, so that they are not reserving space from theVariable
class.EventVariable
: Do not requireSC_Event
as a constructor argument, but instead get it as a parameter togenerateValue()
method. Remove it fromSC_Plugin.loadVariables()
and add it toVariable.getValue()
. This simplifies parameter chains and makes it possible to decide the usedSC_Event
atEventVariable
usage time, not when creating the variable.Variable.getValue()
: Return an object instead of a string. The object contains the value (if getting one succeeded) or error messages (if getting a value failed).Variable.getErrorMessages()
is removed.