Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trees

https://img.shields.io/badge/versioning-intver.org-blue.svg?style=for-the-badge

Generate a static HTML/CSS/JS page that allows users to walk through a decision tree.

Install

Assuming bbin is installed:

bbin install io.github.bzg/trees

Run

You can try it against the config-example.yml file provided in this repository:

~$ trees config-example.yml

This generates index.html. You can pass another output file name as a second argument:

~$ trees config-example.yml output.html

Display the installed version with trees -v (or --version).

Configuration

See config-example.yml for a complete, commented example. Main top-level options:

OptionDescription
localeUI language: en (default), fr, de or sv
frameworkCSS framework (see below)
css-themeCSS theme (see below)
headerPage header: title and subtitle
footerPage footer: text and contact
mail-toEmail address for sending results
display-summaryShow the summary of answers on final pages
display-scoreShow the score result on final pages
display-score-detailsShow raw score values
display-unconditionallyExtra text always shown along with the score
score-variablesScore variables and their initial values
conditional-score-outputScore-dependent messages on final pages
ui-stringsOverride built-in UI strings (e.g. redo, mail-subject)
treeThe list of decision tree nodes

CSS frameworks

Set framework in your config file. The default is pico.

FrameworkValue
Pico 2pico
Pure CSSpure
Bulmabulma

Themes

When using Pico, you can set a theme with css-theme:

css-theme: "doric"

The css-theme option accepts:

  • A pico-themes name (e.g. ashes, doric, swh)
  • An http(s):// URL to a remote CSS file
  • A file:/// URL to a local CSS file
  • A local .css file path

Available themes from pico-themes: swh, org, doric, lincoln, teletype, ashes.

For backward compatibility, theme-url and theme are still supported.

Requirements

trees is written as a Clojure Babashka script and we recommend installing it with bbin. Install everything:

brew install babashka/brew/bbin

For detailed installation instructions:

Contributing

You can also send me an email and support my work on liberapay.

Intentional Versioning

This project uses Intentional Versioning, here are the three audiences:

  • Users : end users who use trees
  • Integrators : external packagers
  • Maintainers : maintainers of the codebase

Support the Clojure(script) ecosystem

If you like Clojure(script), you can support the ecosystem by making a donation to clojuriststogether.org.

License

The code in this repository is licensed under EPL-2.0.

About

Generate a static HTML/CSS/JS page that allows users to walk through a decision tree.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages