liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

parse-options-outputs.fnl (485B)


      1 (local yaml (require :lyaml))
      2 
      3 ;; (local { : view } (require :fennel))
      4 
      5 (fn output? [option]
      6   (match option.loc
      7     ["system" "outputs" & _] true
      8     _ false))
      9 
     10 (fn sorted-options [options]
     11   (table.sort
     12    options
     13    (fn [a b] (< a.name b.name)))
     14   options)
     15 
     16 (each [_ option (ipairs (sorted-options (yaml.load (io.read "*a"))))]
     17   (when (and (output? option) (not option.internal))
     18     (print (.. ".. _" (string.gsub option.name "%." "-") ":") "\n")
     19     (print option.description)))