vito / booklit

a pretty lit content authoring system
https://booklit.page
MIT License
175 stars 55 forks source link

support int argument types #42

Open vito opened 3 years ago

vito commented 3 years ago

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.