booklit icon indicating copy to clipboard operation
booklit copied to clipboard

support int argument types

Open vito opened this issue 4 years ago • 0 comments

quality-of-life improvement for plugin functions which take numeric args like \foos{5}:

func (plug MyPlugin) Foos(count int) booklit.Content {
  // ...
}

instead of

func (plug MyPlugin) Foos(countStr string) (booklit.Content, error) {
  count, err := strconv.Atoi(countStr)
  if err != nil {
    return nil, err
  }
}

use case: being able to configure the number of dynamically fetched entries to show without having to recompile the plugin with a magic const value.

vito avatar Feb 17 '21 19:02 vito