From 0abb4b208bcff96268b8cc44f1d5d167eff49ebb Mon Sep 17 00:00:00 2001 From: Katrina Owen Date: Tue, 22 Aug 2017 12:50:45 -0600 Subject: [PATCH] Add default introductory code example Instead of having logic for a fallback in the backend, we're choosing a default for the snippet file. For tracks that have core exercises, we pick the first core exercise. For tracks without these, we pick the first exercise listed in the config. Note that we're aiming for 10 lines and a max-width of 40 columns. This solution has 11 lines, so we may want to adjust it. --- docs/SNIPPET.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs/SNIPPET.txt diff --git a/docs/SNIPPET.txt b/docs/SNIPPET.txt new file mode 100644 index 0000000..0ef64f0 --- /dev/null +++ b/docs/SNIPPET.txt @@ -0,0 +1,10 @@ +module HelloWorld exposing (..) + +helloWorld : Maybe String -> String +helloWorld name = + case name of + Just name -> + "Hello, " ++ name ++ "!" + + Nothing -> + "Hello, World!"