diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index aadc246..fda5746 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,9 +1,9 @@ -name: Deploy GitHub Pages +name: Build and Deploy on: push: branches: - - main + - '**' # Build on all branches workflow_dispatch: jobs: @@ -12,17 +12,24 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 - - name: Install pandoc + + - name: Install Nix + uses: cachix/install-nix-action@v24 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Build site with Nix run: | - sudo apt install pandoc - - name: Generate HTML from Markdown - run: make + make nix-site + - name: Upload artifact + if: github.ref == 'refs/heads/main' uses: actions/upload-pages-artifact@v4 with: - path: docs/ + path: _site/ deploy: + if: github.ref == 'refs/heads/main' environment: name: github-pages url: ${{steps.deployment.outputs.page_url}} diff --git a/.gitignore b/.gitignore index 50e074e..dd8e009 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,11 @@ -docs/*.html -!docs/index.html - .DS_Store + +# Hakyll +_site/ +_cache/ +_tmp/ +dist-newstyle/ +site + +# Nix +result diff --git a/Makefile b/Makefile index 5e22fb4..9162f04 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,34 @@ ## -# Build LYAH web site from Markdown sources using Pandoc and sed +# Build LYAH web site from Markdown sources using Hakyll. +# Requires GHC and Cabal (for cabal-based builds) or Nix (for nix-based builds). # all: site + ./site build -site: - cd markdown && ./generate.sh +site: site.hs lyah-site.cabal + cabal build + cp $$(cabal list-bin site) ./site clean: - find ./docs -name '*.html' -not -name 'index.html' -delete + rm -rf _site _cache _tmp + cabal clean + rm -f site + +rebuild: clean site + ./site rebuild + +watch: site + ./site watch + +# Nix-based build rules +nix-build: + nix-build + +nix-site: nix-build + result/bin/site build + +nix-clean: + rm -rf result _site _cache _tmp # end diff --git a/README.md b/README.md index c9dbb29..8cf27f9 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,70 @@ Discuss the ideas with the community. * Reddit - https://www.reddit.com/r/haskell/comments/sogi3s/learn_you_a_haskell_a_community_version/ * Haskell Discourse - https://discourse.haskell.org/t/learn-you-a-haskell-a-community-version/4056 +## Contributing + +We are happy to get your contributions! +For the most part, you can simply edit Markdown files and open a PR with the edits. +If you want to preview the changes locally, you need to build the site as discussed below. + +### Building the site + +The site is built using [Hakyll](https://jaspervdj.be/hakyll/), a static site generator in the form of a Haskell library. +With Hakyll, you first build a Haskell application `site`, and then run it to generate HTML for the website (some workflows combine these steps; notably, `cabal run`). +You can build the application in two ways common for Haskell software: with `cabal` (standard, slow first build) or `nix` (advanced, fast first build). +Both of them rely on the same Haskell package description (the `.cabal` file), so they should produce the same result. + +#### Option 1: Using Cabal + +You will need the Haskell toolchain, GHC and Cabal, installed (e.g. via [GHCup][ghcup]). +After that you can use `cabal` to build the website as follows: + +[ghcup]: https://www.haskell.org/ghcup/ + +```bash +# Update package list (first time only) +cabal update + +# Build and run the site generator +cabal run site -- build + +# Preview the site locally (optional) +cabal run site -- watch +# Then visit http://localhost:8000 +``` + +A variation of these commands is used in the `Makefile`: run `make` to generate the website. + +#### Option 2: Using Nix + +[Nix][nix] is less straightforward to obtain usually, so it's not recommended for newcomers. +Nix provides pre-compiled binary packages for all dependencies, which significantly speeds up the first build. +This is what we use in our GitHub CI for expediency. + +[nix]: https://nixos.org/ + +```bash +# Build the site application binary with Nix +nix-build + +# Run the site generator to build the site +result/bin/site build + +# Preview the site locally (optional) +result/bin/site watch +# Then visit http://localhost:8000 +``` + +Alternatively, you can use the `Makefile`: +```bash +# Build the binary and generate the site +make nix-site +``` + +### Build results + +No matter how you build the site, it will end up in the `_site/` directory. + ## Licence This domain and repository is in no way affiliated with Miran Lipovača (the original author) and is being extended and modified with his permission as per the licence the original work was released under ([Creative Commons Attribution-Noncommercial-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-nc-sa/3.0/)) as well as his literal statement encouraging modifications to be made ([FAQ](https://web.archive.org/web/20250126151541/http://learnyouahaskell.com/faq)). diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..c833427 --- /dev/null +++ b/default.nix @@ -0,0 +1,3 @@ +{ pkgs ? import {} }: + +pkgs.haskellPackages.callCabal2nix "lyah-site" ./. {} diff --git a/lyah-site.cabal b/lyah-site.cabal new file mode 100644 index 0000000..b9cd7fb --- /dev/null +++ b/lyah-site.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: lyah-site +version: 0.1.0.0 +license: BSD-3-Clause +author: LYAH Community +maintainer: lyah-community@example.com +build-type: Simple +tested-with: GHC ==9.10.3 + +executable site + main-is: site.hs + build-depends: base >= 4 && < 5 + , hakyll >= 4.16 && < 4.17 + , pandoc + , pandoc-types + , filepath + , containers + , text + , directory + ghc-options: -threaded -Wall -Werror + default-language: Haskell2010 diff --git a/markdown/config/file-list.txt b/markdown/config/file-list.txt deleted file mode 100644 index 2a99135..0000000 --- a/markdown/config/file-list.txt +++ /dev/null @@ -1,14 +0,0 @@ -introduction -starting-out -types-and-typeclasses -syntax-in-functions -recursion -higher-order-functions -modules -making-our-own-types-and-typeclasses -input-and-output -functionally-solving-problems -functors-applicative-functors-and-monoids -a-fistful-of-monads -for-a-few-monads-more -zippers diff --git a/markdown/config/pandoc-defaults.yml b/markdown/config/pandoc-defaults.yml deleted file mode 100644 index beb57f7..0000000 --- a/markdown/config/pandoc-defaults.yml +++ /dev/null @@ -1,3 +0,0 @@ -from: markdown-implicit_figures -to: html -standalone: true diff --git a/markdown/generate.sh b/markdown/generate.sh deleted file mode 100755 index 4048c47..0000000 --- a/markdown/generate.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env bash -# -# Generate HTML from Markdown -# -# Inputs: -# - ./source_md -# Outputs: -# - ../docs -# -# Note: this script must be run from its parent directory (as `./generate.sh`) -# - -set -euo pipefail - -IN=source_md -OUT=../docs -TMP=generated_md -mkdir -p $OUT -mkdir -p $TMP - -PANDOC="pandoc -d config/pandoc-defaults.yml --template=config/template.html" - -mapfile -t filename >$chapterfile -done - -# For every input MD file produce and HTML file -for i in "${!filename[@]}" -do - # back/next-links business - if ((i <= 0)) - then - prev_title= - prev_filename= - else - prev=$((i - 1)) - prev_title="${title[$prev]}" - prev_filename=${filename[$prev]} - fi - if ((i >= ${#filename[@]} - 1)) - then - next_title= - next_filename= - else - next=$((i + 1)) - next_title="${title[$next]}" - next_filename=${filename[$next]} - fi - - $PANDOC \ - -V footdiv=true -V title="${title[$i]}" \ - --metadata title="${title[$i]}$titlesuffix" \ - -V prev_title="$prev_title" -V prev_filename="$prev_filename" \ - -V next_title="$next_title" -V next_filename="$next_filename" \ - -o "$OUT"/"${filename[$i]}".html "$IN"/"${filename[$i]}".md - - sed '/

\(]*\) />

#\1># } - s# />#>#' -i "$OUT"/"${filename[$i]}".html -done - -cat "$IN"/chapters_foot.md >>$chapterfile - -$PANDOC \ - -V title="Chapters" --metadata title="${title[$i]}$titlesuffix" \ - -o "$OUT"/chapters.html $chapterfile - -sed 's/
    \(]*\) />

    #\1># } - s# />#>#' -i "$OUT"/faq.html - -rm -rf $TMP diff --git a/markdown/source_md/chapters_foot.md b/markdown/source_md/chapters_foot.md deleted file mode 100644 index 1818275..0000000 --- a/markdown/source_md/chapters_foot.md +++ /dev/null @@ -1,3 +0,0 @@ - -This work is licensed under a [Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License](https://creativecommons.org/licenses/by-nc-sa/3.0/){rel=license} because I couldn't find a license with an even longer name. - diff --git a/markdown/source_md/chapters_head.md b/markdown/source_md/chapters_head.md deleted file mode 100644 index 2f70b1f..0000000 --- a/markdown/source_md/chapters_head.md +++ /dev/null @@ -1,2 +0,0 @@ -# Learn You a Haskell for Great Good! - diff --git a/site.hs b/site.hs new file mode 100644 index 0000000..4b1d914 --- /dev/null +++ b/site.hs @@ -0,0 +1,201 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NamedFieldPuns #-} + +{- + + The general idea of a Hakyll website is trivial: convert markdown files to HTML (using Pandoc under the hood) + and put the results, as well as the static assets, in the output directory, `_site`. + However, there are two non-trivial tasks with our site: + + 1. Generating `chapters.html`, which is a table of contents (TOC) for all chapters, including subsections. + 2. Back and forward links between chapters. + + To solve both, we first use Pandoc to parse all chapter markdown files to extract chapter numbers and titles + from the front matter (a piece of YAML at the top of file), as well as the list of sections for that chapter; + this is done by the `buildChapterList` function, which produces a list of `ChapterInfo` records. + Then, we construct Hakyll contexts for (1) (see `chaptersCtx` under `create ["chapters.html"]`) and + (2) (see the `chapterCtx` function). Hakyll contexts are used to populate the HTML templates. + +-} + +import Hakyll +import Data.List (sortOn) +import Data.Maybe (catMaybes, fromJust) +import qualified Data.Map as M +import qualified Data.Text as T +import Text.Pandoc.Definition +import Text.Pandoc.Walk as Pandoc (query) +import Text.Pandoc.Shared as Pandoc (stringify) +import Text.Pandoc.Class (runIO) +import Text.Pandoc.Readers.Markdown (readMarkdown) +import Text.Pandoc.Options (readerExtensions, Extension(Ext_implicit_figures), ReaderOptions) +import Text.Pandoc.Extensions (disableExtension) +import System.Directory (listDirectory) +import Control.Monad (forM_) +import System.FilePath ((), replaceExtension, takeFileName) + +-- Paths +sourceMdDir :: FilePath +sourceMdDir = "source_md" + +staticDir :: FilePath +staticDir = "static" + +templatesDir :: FilePath +templatesDir = "templates" + +defaultTemplate :: FilePath +defaultTemplate = templatesDir "default.html" + +chaptersTemplate :: FilePath +chaptersTemplate = templatesDir "chapters.html" + +-- Data type for chapter metadata +data ChapterInfo = ChapterInfo + { chapterFile :: FilePath + , chapterNumber :: Int + , chapterTitle :: String + , chapterSections :: [Section] + } + deriving Show + +-- Data type for section with anchor and title +data Section = Section + { sectionAnchor :: String + , sectionTitle :: String + } + deriving Show + +-- Helper route to strip source_md/ directory and set .html extension +stripSourceMdRoute :: Routes +stripSourceMdRoute = customRoute (takeFileName . toFilePath) `composeRoutes` setExtension "html" + +main :: IO () +main = hakyll $ do + -- Copy static assets to the destination + match (fromGlob $ staticDir "**") $ do + route $ gsubRoute (staticDir ++ "/") (const "") + compile copyFileCompiler + + -- Pre-complile templates + match (fromGlob defaultTemplate) $ compile templateBodyCompiler + match (fromGlob chaptersTemplate) $ compile templateBodyCompiler + + -- Collect all chapters with their metadata using Pandoc + chapterFiles <- buildChapterList + + -- Convert chapter markdown files to HTML using foraward/back-link info from a Hakyll context (`chapterCtx`) + let chapterTriples = zipPrevNext chapterFiles + + forM_ chapterTriples $ \(mprev, ChapterInfo{chapterFile}, mnext) -> do + match (fromGlob $ sourceMdDir chapterFile) $ do + route stripSourceMdRoute + compile (customPandocCompiler + >>= loadAndApplyTemplate (fromFilePath defaultTemplate) (chapterCtx mprev mnext)) + + -- Generate chapters.html (TOC) + create ["chapters.html"] $ do + route idRoute + compile $ do + -- Build Hakyll context with nested lists of fields for chapters and sections inside chapters. + let sectionContext = + field "link" (\item -> do + let (chFile, sec) = itemBody item + -- Build full URL from chapter file and section anchor + return $ replaceExtension chFile ".html" ++ "#" ++ sectionAnchor sec) <> + field "title" (return . sectionTitle . snd . itemBody) + + makeSectionItem :: ChapterInfo -> Section -> Item (FilePath, Section) + makeSectionItem ch sec = Item (fromFilePath $ chapterFile ch) (chapterFile ch, sec) + + chapterItemContext = + field "htmlname" (return . flip replaceExtension ".html" . chapterFile . itemBody) <> + field "title" (return . chapterTitle . itemBody) <> + field "number" (return . show . chapterNumber . itemBody) <> + listFieldWith "sections" sectionContext (\item -> + let ch = itemBody item + in return $ map (makeSectionItem ch) $ chapterSections ch) + + makeChapterItem :: ChapterInfo -> Item ChapterInfo + makeChapterItem ch = Item (fromFilePath $ chapterFile ch) ch + + -- the final nesting context + chaptersCtx = + constField "title" "Learn You a Haskell for Great Good!" <> + listField "chapters" chapterItemContext (return $ map makeChapterItem chapterFiles) <> + defaultContext + + makeItem "" + >>= loadAndApplyTemplate (fromFilePath chaptersTemplate) chaptersCtx + >>= loadAndApplyTemplate (fromFilePath defaultTemplate) chaptersCtx + + -- Generate faq.html + match (fromGlob $ sourceMdDir "faq.md") $ do + route stripSourceMdRoute + compile $ do + customPandocCompiler + >>= loadAndApplyTemplate (fromFilePath defaultTemplate) + (constField "faq" "true" <> + defaultContext) + + +-- List of chapters sorted by chapter number from YAML metadata +buildChapterList :: Rules [ChapterInfo] +buildChapterList = preprocess $ do + files <- listDirectory sourceMdDir + maybeChapters <- mapM getChapterData files + return $ sortOn chapterNumber (catMaybes maybeChapters) + where + getChapterData :: FilePath -> IO (Maybe ChapterInfo) + getChapterData fname = do + let fullPath = sourceMdDir fname + content <- readFile fullPath + + -- Extract chapter number and other metadata from Pandoc's parsed metadata + pandoc <- runIO $ readMarkdown customReaderOptions (T.pack content) + return $ case pandoc of + Right (Pandoc meta blocks) -> do + -- If there's no `chapter` field, it's not a chapter file (e.g., FAQ), and we return Nothing + chapterMeta <- M.lookup "chapter" (unMeta meta) + return ChapterInfo + { chapterFile = fname + , chapterNumber = read . T.unpack $ Pandoc.stringify chapterMeta + -- RE fromJust below: every chapter is ought to have a title field + , chapterTitle = T.unpack . Pandoc.stringify . fromJust $ M.lookup "title" (unMeta meta) + , chapterSections = Pandoc.query getSections blocks + } + Left err -> error $ "Failed to parse " ++ fullPath ++ ": " ++ show err + + getSections :: Block -> [Section] + getSections (Header 2 (anchor, _, _) inlines) = + [Section (T.unpack anchor) (T.unpack $ Pandoc.stringify inlines)] + getSections _ = [] + +-- Helper function to build chapter context with optional prev/next navigation +chapterCtx :: Maybe ChapterInfo -> Maybe ChapterInfo -> Context String +chapterCtx mprev mnext = + constField "footdiv" "true" <> + maybeChapterContext "prev" mprev <> + maybeChapterContext "next" mnext <> + defaultContext + where + maybeChapterContext :: String -> Maybe ChapterInfo -> Context String + maybeChapterContext prefix mchapter = + maybe mempty (\ChapterInfo{chapterFile, chapterTitle} -> + constField (prefix ++ "_filename") (replaceExtension chapterFile ".html") <> + constField (prefix ++ "_title") chapterTitle) mchapter + +-- Custom pandoc compiler that uses our custom reader options +customPandocCompiler :: Compiler (Item String) +customPandocCompiler = pandocCompilerWith customReaderOptions defaultHakyllWriterOptions + +-- Custom reader options that disable implicit_figures extension +customReaderOptions :: ReaderOptions +customReaderOptions = defaultHakyllReaderOptions + { readerExtensions = disableExtension Ext_implicit_figures + (readerExtensions defaultHakyllReaderOptions) + } + +-- Helper function to pair each element with its previous and next elements +zipPrevNext :: [a] -> [(Maybe a, a, Maybe a)] +zipPrevNext xs = zip3 (Nothing : map Just xs) xs (map Just (drop 1 xs) ++ [Nothing]) diff --git a/markdown/source_md/a-fistful-of-monads.md b/source_md/a-fistful-of-monads.md similarity index 99% rename from markdown/source_md/a-fistful-of-monads.md rename to source_md/a-fistful-of-monads.md index 48bcf04..2b5d9d9 100644 --- a/markdown/source_md/a-fistful-of-monads.md +++ b/source_md/a-fistful-of-monads.md @@ -1,4 +1,7 @@ -# A Fistful of Monads +--- +chapter: 12 +title: "A Fistful of Monads" +--- When we first talked about functors, we saw that they were a useful concept for values that can be mapped over. Then, we took that concept one step further by introducing applicative functors, which allow us to view values of certain data types as values with contexts and use normal functions on those values while preserving the meaning of those contexts. diff --git a/markdown/source_md/faq.md b/source_md/faq.md similarity index 98% rename from markdown/source_md/faq.md rename to source_md/faq.md index 3778da3..9745ab2 100644 --- a/markdown/source_md/faq.md +++ b/source_md/faq.md @@ -1,5 +1,7 @@ -# FAQ +--- +title: "FAQ" +--- ![turtle???](assets/images/faq/turtle.png){.right width=349 height=204} ## Can I put this tutorial on my site or change it or whatever? diff --git a/markdown/source_md/for-a-few-monads-more.md b/source_md/for-a-few-monads-more.md similarity index 99% rename from markdown/source_md/for-a-few-monads-more.md rename to source_md/for-a-few-monads-more.md index 759bf51..adcfb99 100644 --- a/markdown/source_md/for-a-few-monads-more.md +++ b/source_md/for-a-few-monads-more.md @@ -1,4 +1,7 @@ -# For a Few Monads More +--- +chapter: 13 +title: "For a Few Monads More" +--- ![there are two kinds of people in the world, my friend. those who learn them a haskell and those who have the job of coding java](assets/images/for-a-few-monads-more/clint.png){.right width=189 height=400} diff --git a/markdown/source_md/functionally-solving-problems.md b/source_md/functionally-solving-problems.md similarity index 99% rename from markdown/source_md/functionally-solving-problems.md rename to source_md/functionally-solving-problems.md index 0d4e2a7..4b4f9a3 100644 --- a/markdown/source_md/functionally-solving-problems.md +++ b/source_md/functionally-solving-problems.md @@ -1,4 +1,7 @@ -# Functionally Solving Problems +--- +chapter: 10 +title: "Functionally Solving Problems" +--- In this chapter, we'll take a look at a few interesting problems and how to think functionally to solve them as elegantly as possible. We probably won't be introducing any new concepts, we'll just be flexing our newly acquired Haskell muscles and practicing our coding skills. diff --git a/markdown/source_md/functors-applicative-functors-and-monoids.md b/source_md/functors-applicative-functors-and-monoids.md similarity index 99% rename from markdown/source_md/functors-applicative-functors-and-monoids.md rename to source_md/functors-applicative-functors-and-monoids.md index 7b3e937..e408ed0 100644 --- a/markdown/source_md/functors-applicative-functors-and-monoids.md +++ b/source_md/functors-applicative-functors-and-monoids.md @@ -1,4 +1,7 @@ -# Functors, Applicative Functors and Monoids +--- +chapter: 11 +title: "Functors, Applicative Functors and Monoids" +--- Haskell's combination of purity, higher order functions, parameterized algebraic data types, and typeclasses allows us to implement polymorphism on a much higher level than possible in other languages. We don't have to think about types belonging to a big hierarchy of types. diff --git a/markdown/source_md/higher-order-functions.md b/source_md/higher-order-functions.md similarity index 99% rename from markdown/source_md/higher-order-functions.md rename to source_md/higher-order-functions.md index a13fa6b..2f305fe 100644 --- a/markdown/source_md/higher-order-functions.md +++ b/source_md/higher-order-functions.md @@ -1,4 +1,7 @@ -# Higher Order Functions {style=margin-left:-3px} +--- +chapter: 6 +title: "Higher Order Functions" +--- ![sun](assets/images/higher-order-functions/sun.png){.right width=203 height=183} diff --git a/markdown/source_md/input-and-output.md b/source_md/input-and-output.md similarity index 99% rename from markdown/source_md/input-and-output.md rename to source_md/input-and-output.md index ef01998..271284f 100644 --- a/markdown/source_md/input-and-output.md +++ b/source_md/input-and-output.md @@ -1,4 +1,7 @@ -# Input and Output +--- +chapter: 9 +title: "Input and Output" +--- ![poor dog](assets/images/input-and-output/dognap.png){.right width=261 height=382} diff --git a/markdown/source_md/introduction.md b/source_md/introduction.md similarity index 99% rename from markdown/source_md/introduction.md rename to source_md/introduction.md index 154e47e..2c07ef0 100644 --- a/markdown/source_md/introduction.md +++ b/source_md/introduction.md @@ -1,4 +1,7 @@ -# Introduction +--- +chapter: 1 +title: "Introduction" +--- ## About this tutorial {#about-this-tutorial} diff --git a/markdown/source_md/making-our-own-types-and-typeclasses.md b/source_md/making-our-own-types-and-typeclasses.md similarity index 99% rename from markdown/source_md/making-our-own-types-and-typeclasses.md rename to source_md/making-our-own-types-and-typeclasses.md index 80171b7..504b266 100644 --- a/markdown/source_md/making-our-own-types-and-typeclasses.md +++ b/source_md/making-our-own-types-and-typeclasses.md @@ -1,4 +1,7 @@ -# Making Our Own Types and Typeclasses +--- +chapter: 8 +title: "Making Our Own Types and Typeclasses" +--- In the previous chapters, we covered some existing Haskell types and typeclasses. In this chapter, we'll learn how to make our own and how to put them to work! diff --git a/markdown/source_md/modules.md b/source_md/modules.md similarity index 99% rename from markdown/source_md/modules.md rename to source_md/modules.md index ae448c0..9a44001 100644 --- a/markdown/source_md/modules.md +++ b/source_md/modules.md @@ -1,4 +1,7 @@ -# Modules +--- +chapter: 7 +title: "Modules" +--- ## Loading modules {#loading-modules} diff --git a/markdown/source_md/recursion.md b/source_md/recursion.md similarity index 99% rename from markdown/source_md/recursion.md rename to source_md/recursion.md index b7cc378..21d2bb2 100644 --- a/markdown/source_md/recursion.md +++ b/source_md/recursion.md @@ -1,4 +1,7 @@ -# Recursion {style=margin-left:-2px} +--- +chapter: 5 +title: "Recursion" +--- ## Hello recursion! {#hello-recursion} diff --git a/markdown/source_md/starting-out.md b/source_md/starting-out.md similarity index 99% rename from markdown/source_md/starting-out.md rename to source_md/starting-out.md index 792385f..86ae057 100644 --- a/markdown/source_md/starting-out.md +++ b/source_md/starting-out.md @@ -1,4 +1,7 @@ -# Starting Out {style=margin-left:-3px} +--- +chapter: 2 +title: "Starting Out" +--- ## Ready, set, go! {#ready-set-go} diff --git a/markdown/source_md/syntax-in-functions.md b/source_md/syntax-in-functions.md similarity index 99% rename from markdown/source_md/syntax-in-functions.md rename to source_md/syntax-in-functions.md index c5eb141..de3acb8 100644 --- a/markdown/source_md/syntax-in-functions.md +++ b/source_md/syntax-in-functions.md @@ -1,4 +1,7 @@ -# Syntax in Functions {style=margin-left:-3px} +--- +chapter: 4 +title: "Syntax in Functions" +--- ## Pattern matching {#pattern-matching} diff --git a/markdown/source_md/types-and-typeclasses.md b/source_md/types-and-typeclasses.md similarity index 99% rename from markdown/source_md/types-and-typeclasses.md rename to source_md/types-and-typeclasses.md index 2256793..039709a 100644 --- a/markdown/source_md/types-and-typeclasses.md +++ b/source_md/types-and-typeclasses.md @@ -1,4 +1,7 @@ -# Types and Typeclasses +--- +chapter: 3 +title: "Types and Typeclasses" +--- ## Believe the type {#believe-the-type} diff --git a/markdown/source_md/zippers.md b/source_md/zippers.md similarity index 99% rename from markdown/source_md/zippers.md rename to source_md/zippers.md index b7b6f06..51605ea 100644 --- a/markdown/source_md/zippers.md +++ b/source_md/zippers.md @@ -1,4 +1,7 @@ -# Zippers +--- +chapter: 14 +title: "Zippers" +--- ![hi im chet](assets/images/zippers/60sdude.png){.right width=122 height=407} diff --git a/docs/assets/css/reset.css b/static/assets/css/reset.css similarity index 100% rename from docs/assets/css/reset.css rename to static/assets/css/reset.css diff --git a/docs/assets/css/style.css b/static/assets/css/style.css similarity index 100% rename from docs/assets/css/style.css rename to static/assets/css/style.css diff --git a/docs/assets/css/ukraine-banner.css b/static/assets/css/ukraine-banner.css similarity index 100% rename from docs/assets/css/ukraine-banner.css rename to static/assets/css/ukraine-banner.css diff --git a/docs/assets/images/a-fistful-of-monads/banana.png b/static/assets/images/a-fistful-of-monads/banana.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/banana.png rename to static/assets/images/a-fistful-of-monads/banana.png diff --git a/docs/assets/images/a-fistful-of-monads/buddha.png b/static/assets/images/a-fistful-of-monads/buddha.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/buddha.png rename to static/assets/images/a-fistful-of-monads/buddha.png diff --git a/docs/assets/images/a-fistful-of-monads/centaur.png b/static/assets/images/a-fistful-of-monads/centaur.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/centaur.png rename to static/assets/images/a-fistful-of-monads/centaur.png diff --git a/docs/assets/images/a-fistful-of-monads/chess.png b/static/assets/images/a-fistful-of-monads/chess.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/chess.png rename to static/assets/images/a-fistful-of-monads/chess.png diff --git a/docs/assets/images/a-fistful-of-monads/concatmap.png b/static/assets/images/a-fistful-of-monads/concatmap.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/concatmap.png rename to static/assets/images/a-fistful-of-monads/concatmap.png diff --git a/docs/assets/images/a-fistful-of-monads/deadcat.png b/static/assets/images/a-fistful-of-monads/deadcat.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/deadcat.png rename to static/assets/images/a-fistful-of-monads/deadcat.png diff --git a/docs/assets/images/a-fistful-of-monads/judgedog.png b/static/assets/images/a-fistful-of-monads/judgedog.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/judgedog.png rename to static/assets/images/a-fistful-of-monads/judgedog.png diff --git a/docs/assets/images/a-fistful-of-monads/kid.png b/static/assets/images/a-fistful-of-monads/kid.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/kid.png rename to static/assets/images/a-fistful-of-monads/kid.png diff --git a/docs/assets/images/a-fistful-of-monads/owld.png b/static/assets/images/a-fistful-of-monads/owld.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/owld.png rename to static/assets/images/a-fistful-of-monads/owld.png diff --git a/docs/assets/images/a-fistful-of-monads/pierre.png b/static/assets/images/a-fistful-of-monads/pierre.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/pierre.png rename to static/assets/images/a-fistful-of-monads/pierre.png diff --git a/docs/assets/images/a-fistful-of-monads/smugpig.png b/static/assets/images/a-fistful-of-monads/smugpig.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/smugpig.png rename to static/assets/images/a-fistful-of-monads/smugpig.png diff --git a/docs/assets/images/a-fistful-of-monads/tur2.png b/static/assets/images/a-fistful-of-monads/tur2.png similarity index 100% rename from docs/assets/images/a-fistful-of-monads/tur2.png rename to static/assets/images/a-fistful-of-monads/tur2.png diff --git a/docs/assets/images/bg.png b/static/assets/images/bg.png similarity index 100% rename from docs/assets/images/bg.png rename to static/assets/images/bg.png diff --git a/docs/assets/images/faq/turtle.png b/static/assets/images/faq/turtle.png similarity index 100% rename from docs/assets/images/faq/turtle.png rename to static/assets/images/faq/turtle.png diff --git a/docs/assets/images/favicon.png b/static/assets/images/favicon.png similarity index 100% rename from docs/assets/images/favicon.png rename to static/assets/images/favicon.png diff --git a/docs/assets/images/for-a-few-monads-more/angeleyes.png b/static/assets/images/for-a-few-monads-more/angeleyes.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/angeleyes.png rename to static/assets/images/for-a-few-monads-more/angeleyes.png diff --git a/docs/assets/images/for-a-few-monads-more/badge.png b/static/assets/images/for-a-few-monads-more/badge.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/badge.png rename to static/assets/images/for-a-few-monads-more/badge.png diff --git a/docs/assets/images/for-a-few-monads-more/cactus.png b/static/assets/images/for-a-few-monads-more/cactus.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/cactus.png rename to static/assets/images/for-a-few-monads-more/cactus.png diff --git a/docs/assets/images/for-a-few-monads-more/clint.png b/static/assets/images/for-a-few-monads-more/clint.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/clint.png rename to static/assets/images/for-a-few-monads-more/clint.png diff --git a/docs/assets/images/for-a-few-monads-more/miner.png b/static/assets/images/for-a-few-monads-more/miner.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/miner.png rename to static/assets/images/for-a-few-monads-more/miner.png diff --git a/docs/assets/images/for-a-few-monads-more/prob.png b/static/assets/images/for-a-few-monads-more/prob.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/prob.png rename to static/assets/images/for-a-few-monads-more/prob.png diff --git a/docs/assets/images/for-a-few-monads-more/revolver.png b/static/assets/images/for-a-few-monads-more/revolver.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/revolver.png rename to static/assets/images/for-a-few-monads-more/revolver.png diff --git a/docs/assets/images/for-a-few-monads-more/ride.png b/static/assets/images/for-a-few-monads-more/ride.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/ride.png rename to static/assets/images/for-a-few-monads-more/ride.png diff --git a/docs/assets/images/for-a-few-monads-more/spearhead.png b/static/assets/images/for-a-few-monads-more/spearhead.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/spearhead.png rename to static/assets/images/for-a-few-monads-more/spearhead.png diff --git a/docs/assets/images/for-a-few-monads-more/texas.png b/static/assets/images/for-a-few-monads-more/texas.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/texas.png rename to static/assets/images/for-a-few-monads-more/texas.png diff --git a/docs/assets/images/for-a-few-monads-more/tipi.png b/static/assets/images/for-a-few-monads-more/tipi.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/tipi.png rename to static/assets/images/for-a-few-monads-more/tipi.png diff --git a/docs/assets/images/for-a-few-monads-more/tuco.png b/static/assets/images/for-a-few-monads-more/tuco.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/tuco.png rename to static/assets/images/for-a-few-monads-more/tuco.png diff --git a/docs/assets/images/for-a-few-monads-more/wolf.png b/static/assets/images/for-a-few-monads-more/wolf.png similarity index 100% rename from docs/assets/images/for-a-few-monads-more/wolf.png rename to static/assets/images/for-a-few-monads-more/wolf.png diff --git a/docs/assets/images/functionally-solving-problems/calculator.png b/static/assets/images/functionally-solving-problems/calculator.png similarity index 100% rename from docs/assets/images/functionally-solving-problems/calculator.png rename to static/assets/images/functionally-solving-problems/calculator.png diff --git a/docs/assets/images/functionally-solving-problems/guycar.png b/static/assets/images/functionally-solving-problems/guycar.png similarity index 100% rename from docs/assets/images/functionally-solving-problems/guycar.png rename to static/assets/images/functionally-solving-problems/guycar.png diff --git a/docs/assets/images/functionally-solving-problems/roads.png b/static/assets/images/functionally-solving-problems/roads.png similarity index 100% rename from docs/assets/images/functionally-solving-problems/roads.png rename to static/assets/images/functionally-solving-problems/roads.png diff --git a/docs/assets/images/functionally-solving-problems/roads_simple.png b/static/assets/images/functionally-solving-problems/roads_simple.png similarity index 100% rename from docs/assets/images/functionally-solving-problems/roads_simple.png rename to static/assets/images/functionally-solving-problems/roads_simple.png diff --git a/docs/assets/images/functionally-solving-problems/rpn.png b/static/assets/images/functionally-solving-problems/rpn.png similarity index 100% rename from docs/assets/images/functionally-solving-problems/rpn.png rename to static/assets/images/functionally-solving-problems/rpn.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/accordion.png b/static/assets/images/functors-applicative-functors-and-monoids/accordion.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/accordion.png rename to static/assets/images/functors-applicative-functors-and-monoids/accordion.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/alien.png b/static/assets/images/functors-applicative-functors-and-monoids/alien.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/alien.png rename to static/assets/images/functors-applicative-functors-and-monoids/alien.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/balloondog.png b/static/assets/images/functors-applicative-functors-and-monoids/balloondog.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/balloondog.png rename to static/assets/images/functors-applicative-functors-and-monoids/balloondog.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/bear.png b/static/assets/images/functors-applicative-functors-and-monoids/bear.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/bear.png rename to static/assets/images/functors-applicative-functors-and-monoids/bear.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/frogtor.png b/static/assets/images/functors-applicative-functors-and-monoids/frogtor.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/frogtor.png rename to static/assets/images/functors-applicative-functors-and-monoids/frogtor.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/jazzb.png b/static/assets/images/functors-applicative-functors-and-monoids/jazzb.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/jazzb.png rename to static/assets/images/functors-applicative-functors-and-monoids/jazzb.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/justice.png b/static/assets/images/functors-applicative-functors-and-monoids/justice.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/justice.png rename to static/assets/images/functors-applicative-functors-and-monoids/justice.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/knight.png b/static/assets/images/functors-applicative-functors-and-monoids/knight.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/knight.png rename to static/assets/images/functors-applicative-functors-and-monoids/knight.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/krakatoa.png b/static/assets/images/functors-applicative-functors-and-monoids/krakatoa.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/krakatoa.png rename to static/assets/images/functors-applicative-functors-and-monoids/krakatoa.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/lifter.png b/static/assets/images/functors-applicative-functors-and-monoids/lifter.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/lifter.png rename to static/assets/images/functors-applicative-functors-and-monoids/lifter.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/maoi.png b/static/assets/images/functors-applicative-functors-and-monoids/maoi.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/maoi.png rename to static/assets/images/functors-applicative-functors-and-monoids/maoi.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/pirateship.png b/static/assets/images/functors-applicative-functors-and-monoids/pirateship.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/pirateship.png rename to static/assets/images/functors-applicative-functors-and-monoids/pirateship.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/present.png b/static/assets/images/functors-applicative-functors-and-monoids/present.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/present.png rename to static/assets/images/functors-applicative-functors-and-monoids/present.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/shamrock.png b/static/assets/images/functors-applicative-functors-and-monoids/shamrock.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/shamrock.png rename to static/assets/images/functors-applicative-functors-and-monoids/shamrock.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/smug.png b/static/assets/images/functors-applicative-functors-and-monoids/smug.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/smug.png rename to static/assets/images/functors-applicative-functors-and-monoids/smug.png diff --git a/docs/assets/images/functors-applicative-functors-and-monoids/whale.png b/static/assets/images/functors-applicative-functors-and-monoids/whale.png similarity index 100% rename from docs/assets/images/functors-applicative-functors-and-monoids/whale.png rename to static/assets/images/functors-applicative-functors-and-monoids/whale.png diff --git a/docs/assets/images/higher-order-functions/bonus.png b/static/assets/images/higher-order-functions/bonus.png similarity index 100% rename from docs/assets/images/higher-order-functions/bonus.png rename to static/assets/images/higher-order-functions/bonus.png diff --git a/docs/assets/images/higher-order-functions/composition.png b/static/assets/images/higher-order-functions/composition.png similarity index 100% rename from docs/assets/images/higher-order-functions/composition.png rename to static/assets/images/higher-order-functions/composition.png diff --git a/docs/assets/images/higher-order-functions/curry.png b/static/assets/images/higher-order-functions/curry.png similarity index 100% rename from docs/assets/images/higher-order-functions/curry.png rename to static/assets/images/higher-order-functions/curry.png diff --git a/docs/assets/images/higher-order-functions/dollar.png b/static/assets/images/higher-order-functions/dollar.png similarity index 100% rename from docs/assets/images/higher-order-functions/dollar.png rename to static/assets/images/higher-order-functions/dollar.png diff --git a/docs/assets/images/higher-order-functions/foldl.png b/static/assets/images/higher-order-functions/foldl.png similarity index 100% rename from docs/assets/images/higher-order-functions/foldl.png rename to static/assets/images/higher-order-functions/foldl.png diff --git a/docs/assets/images/higher-order-functions/lamb.png b/static/assets/images/higher-order-functions/lamb.png similarity index 100% rename from docs/assets/images/higher-order-functions/lamb.png rename to static/assets/images/higher-order-functions/lamb.png diff --git a/docs/assets/images/higher-order-functions/lambda.png b/static/assets/images/higher-order-functions/lambda.png similarity index 100% rename from docs/assets/images/higher-order-functions/lambda.png rename to static/assets/images/higher-order-functions/lambda.png diff --git a/docs/assets/images/higher-order-functions/map.png b/static/assets/images/higher-order-functions/map.png similarity index 100% rename from docs/assets/images/higher-order-functions/map.png rename to static/assets/images/higher-order-functions/map.png diff --git a/docs/assets/images/higher-order-functions/notes.png b/static/assets/images/higher-order-functions/notes.png similarity index 100% rename from docs/assets/images/higher-order-functions/notes.png rename to static/assets/images/higher-order-functions/notes.png diff --git a/docs/assets/images/higher-order-functions/origami.png b/static/assets/images/higher-order-functions/origami.png similarity index 100% rename from docs/assets/images/higher-order-functions/origami.png rename to static/assets/images/higher-order-functions/origami.png diff --git a/docs/assets/images/higher-order-functions/sun.png b/static/assets/images/higher-order-functions/sun.png similarity index 100% rename from docs/assets/images/higher-order-functions/sun.png rename to static/assets/images/higher-order-functions/sun.png diff --git a/docs/assets/images/higher-order-functions/washmachine.png b/static/assets/images/higher-order-functions/washmachine.png similarity index 100% rename from docs/assets/images/higher-order-functions/washmachine.png rename to static/assets/images/higher-order-functions/washmachine.png diff --git a/docs/assets/images/input-and-output/arguments.png b/static/assets/images/input-and-output/arguments.png similarity index 100% rename from docs/assets/images/input-and-output/arguments.png rename to static/assets/images/input-and-output/arguments.png diff --git a/docs/assets/images/input-and-output/chainchomp.png b/static/assets/images/input-and-output/chainchomp.png similarity index 100% rename from docs/assets/images/input-and-output/chainchomp.png rename to static/assets/images/input-and-output/chainchomp.png diff --git a/docs/assets/images/input-and-output/dognap.png b/static/assets/images/input-and-output/dognap.png similarity index 100% rename from docs/assets/images/input-and-output/dognap.png rename to static/assets/images/input-and-output/dognap.png diff --git a/docs/assets/images/input-and-output/edd.png b/static/assets/images/input-and-output/edd.png similarity index 100% rename from docs/assets/images/input-and-output/edd.png rename to static/assets/images/input-and-output/edd.png diff --git a/docs/assets/images/input-and-output/file.png b/static/assets/images/input-and-output/file.png similarity index 100% rename from docs/assets/images/input-and-output/file.png rename to static/assets/images/input-and-output/file.png diff --git a/docs/assets/images/input-and-output/helloworld.png b/static/assets/images/input-and-output/helloworld.png similarity index 100% rename from docs/assets/images/input-and-output/helloworld.png rename to static/assets/images/input-and-output/helloworld.png diff --git a/docs/assets/images/input-and-output/jackofdiamonds.png b/static/assets/images/input-and-output/jackofdiamonds.png similarity index 100% rename from docs/assets/images/input-and-output/jackofdiamonds.png rename to static/assets/images/input-and-output/jackofdiamonds.png diff --git a/docs/assets/images/input-and-output/luggage.png b/static/assets/images/input-and-output/luggage.png similarity index 100% rename from docs/assets/images/input-and-output/luggage.png rename to static/assets/images/input-and-output/luggage.png diff --git a/docs/assets/images/input-and-output/police.png b/static/assets/images/input-and-output/police.png similarity index 100% rename from docs/assets/images/input-and-output/police.png rename to static/assets/images/input-and-output/police.png diff --git a/docs/assets/images/input-and-output/puppy.png b/static/assets/images/input-and-output/puppy.png similarity index 100% rename from docs/assets/images/input-and-output/puppy.png rename to static/assets/images/input-and-output/puppy.png diff --git a/docs/assets/images/input-and-output/random.png b/static/assets/images/input-and-output/random.png similarity index 100% rename from docs/assets/images/input-and-output/random.png rename to static/assets/images/input-and-output/random.png diff --git a/docs/assets/images/input-and-output/salad.png b/static/assets/images/input-and-output/salad.png similarity index 100% rename from docs/assets/images/input-and-output/salad.png rename to static/assets/images/input-and-output/salad.png diff --git a/docs/assets/images/input-and-output/streams.png b/static/assets/images/input-and-output/streams.png similarity index 100% rename from docs/assets/images/input-and-output/streams.png rename to static/assets/images/input-and-output/streams.png diff --git a/docs/assets/images/input-and-output/timber.png b/static/assets/images/input-and-output/timber.png similarity index 100% rename from docs/assets/images/input-and-output/timber.png rename to static/assets/images/input-and-output/timber.png diff --git a/docs/assets/images/introduction/bird.png b/static/assets/images/introduction/bird.png similarity index 100% rename from docs/assets/images/introduction/bird.png rename to static/assets/images/introduction/bird.png diff --git a/docs/assets/images/introduction/boat.png b/static/assets/images/introduction/boat.png similarity index 100% rename from docs/assets/images/introduction/boat.png rename to static/assets/images/introduction/boat.png diff --git a/docs/assets/images/introduction/fx.png b/static/assets/images/introduction/fx.png similarity index 100% rename from docs/assets/images/introduction/fx.png rename to static/assets/images/introduction/fx.png diff --git a/docs/assets/images/introduction/lazy.png b/static/assets/images/introduction/lazy.png similarity index 100% rename from docs/assets/images/introduction/lazy.png rename to static/assets/images/introduction/lazy.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/binarytree.png b/static/assets/images/making-our-own-types-and-typeclasses/binarytree.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/binarytree.png rename to static/assets/images/making-our-own-types-and-typeclasses/binarytree.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/caveman.png b/static/assets/images/making-our-own-types-and-typeclasses/caveman.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/caveman.png rename to static/assets/images/making-our-own-types-and-typeclasses/caveman.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/chicken.png b/static/assets/images/making-our-own-types-and-typeclasses/chicken.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/chicken.png rename to static/assets/images/making-our-own-types-and-typeclasses/chicken.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/functor.png b/static/assets/images/making-our-own-types-and-typeclasses/functor.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/functor.png rename to static/assets/images/making-our-own-types-and-typeclasses/functor.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/gob.png b/static/assets/images/making-our-own-types-and-typeclasses/gob.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/gob.png rename to static/assets/images/making-our-own-types-and-typeclasses/gob.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/meekrat.png b/static/assets/images/making-our-own-types-and-typeclasses/meekrat.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/meekrat.png rename to static/assets/images/making-our-own-types-and-typeclasses/meekrat.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/record.png b/static/assets/images/making-our-own-types-and-typeclasses/record.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/record.png rename to static/assets/images/making-our-own-types-and-typeclasses/record.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/thefonz.png b/static/assets/images/making-our-own-types-and-typeclasses/thefonz.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/thefonz.png rename to static/assets/images/making-our-own-types-and-typeclasses/thefonz.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/trafficlight.png b/static/assets/images/making-our-own-types-and-typeclasses/trafficlight.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/trafficlight.png rename to static/assets/images/making-our-own-types-and-typeclasses/trafficlight.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/typefoo.png b/static/assets/images/making-our-own-types-and-typeclasses/typefoo.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/typefoo.png rename to static/assets/images/making-our-own-types-and-typeclasses/typefoo.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/yesno.png b/static/assets/images/making-our-own-types-and-typeclasses/yesno.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/yesno.png rename to static/assets/images/making-our-own-types-and-typeclasses/yesno.png diff --git a/docs/assets/images/making-our-own-types-and-typeclasses/yeti.png b/static/assets/images/making-our-own-types-and-typeclasses/yeti.png similarity index 100% rename from docs/assets/images/making-our-own-types-and-typeclasses/yeti.png rename to static/assets/images/making-our-own-types-and-typeclasses/yeti.png diff --git a/docs/assets/images/modules/legochar.png b/static/assets/images/modules/legochar.png similarity index 100% rename from docs/assets/images/modules/legochar.png rename to static/assets/images/modules/legochar.png diff --git a/docs/assets/images/modules/legolists.png b/static/assets/images/modules/legolists.png similarity index 100% rename from docs/assets/images/modules/legolists.png rename to static/assets/images/modules/legolists.png diff --git a/docs/assets/images/modules/legomap.png b/static/assets/images/modules/legomap.png similarity index 100% rename from docs/assets/images/modules/legomap.png rename to static/assets/images/modules/legomap.png diff --git a/docs/assets/images/modules/legosets.png b/static/assets/images/modules/legosets.png similarity index 100% rename from docs/assets/images/modules/legosets.png rename to static/assets/images/modules/legosets.png diff --git a/docs/assets/images/modules/making_modules.png b/static/assets/images/modules/making_modules.png similarity index 100% rename from docs/assets/images/modules/making_modules.png rename to static/assets/images/modules/making_modules.png diff --git a/docs/assets/images/modules/modules.png b/static/assets/images/modules/modules.png similarity index 100% rename from docs/assets/images/modules/modules.png rename to static/assets/images/modules/modules.png diff --git a/docs/assets/images/newsplash-new-long.webp b/static/assets/images/newsplash-new-long.webp similarity index 100% rename from docs/assets/images/newsplash-new-long.webp rename to static/assets/images/newsplash-new-long.webp diff --git a/docs/assets/images/newsplash-new-short.webp b/static/assets/images/newsplash-new-short.webp similarity index 100% rename from docs/assets/images/newsplash-new-short.webp rename to static/assets/images/newsplash-new-short.webp diff --git a/docs/assets/images/newsplash-new.png b/static/assets/images/newsplash-new.png similarity index 100% rename from docs/assets/images/newsplash-new.png rename to static/assets/images/newsplash-new.png diff --git a/docs/assets/images/newsplash-new.webp b/static/assets/images/newsplash-new.webp similarity index 100% rename from docs/assets/images/newsplash-new.webp rename to static/assets/images/newsplash-new.webp diff --git a/docs/assets/images/note.jpg b/static/assets/images/note.jpg similarity index 100% rename from docs/assets/images/note.jpg rename to static/assets/images/note.jpg diff --git a/docs/assets/images/nxt.png b/static/assets/images/nxt.png similarity index 100% rename from docs/assets/images/nxt.png rename to static/assets/images/nxt.png diff --git a/docs/assets/images/prv.png b/static/assets/images/prv.png similarity index 100% rename from docs/assets/images/prv.png rename to static/assets/images/prv.png diff --git a/docs/assets/images/recursion/brain.png b/static/assets/images/recursion/brain.png similarity index 100% rename from docs/assets/images/recursion/brain.png rename to static/assets/images/recursion/brain.png diff --git a/docs/assets/images/recursion/maxs.png b/static/assets/images/recursion/maxs.png similarity index 100% rename from docs/assets/images/recursion/maxs.png rename to static/assets/images/recursion/maxs.png diff --git a/docs/assets/images/recursion/painter.png b/static/assets/images/recursion/painter.png similarity index 100% rename from docs/assets/images/recursion/painter.png rename to static/assets/images/recursion/painter.png diff --git a/docs/assets/images/recursion/quickman.png b/static/assets/images/recursion/quickman.png similarity index 100% rename from docs/assets/images/recursion/quickman.png rename to static/assets/images/recursion/quickman.png diff --git a/docs/assets/images/recursion/quicksort.png b/static/assets/images/recursion/quicksort.png similarity index 100% rename from docs/assets/images/recursion/quicksort.png rename to static/assets/images/recursion/quicksort.png diff --git a/docs/assets/images/recursion/recursion.png b/static/assets/images/recursion/recursion.png similarity index 100% rename from docs/assets/images/recursion/recursion.png rename to static/assets/images/recursion/recursion.png diff --git a/docs/assets/images/starting-out/baby.png b/static/assets/images/starting-out/baby.png similarity index 100% rename from docs/assets/images/starting-out/baby.png rename to static/assets/images/starting-out/baby.png diff --git a/docs/assets/images/starting-out/cowboy.png b/static/assets/images/starting-out/cowboy.png similarity index 100% rename from docs/assets/images/starting-out/cowboy.png rename to static/assets/images/starting-out/cowboy.png diff --git a/docs/assets/images/starting-out/kermit.png b/static/assets/images/starting-out/kermit.png similarity index 100% rename from docs/assets/images/starting-out/kermit.png rename to static/assets/images/starting-out/kermit.png diff --git a/docs/assets/images/starting-out/list.png b/static/assets/images/starting-out/list.png similarity index 100% rename from docs/assets/images/starting-out/list.png rename to static/assets/images/starting-out/list.png diff --git a/docs/assets/images/starting-out/listmonster.png b/static/assets/images/starting-out/listmonster.png similarity index 100% rename from docs/assets/images/starting-out/listmonster.png rename to static/assets/images/starting-out/listmonster.png diff --git a/docs/assets/images/starting-out/pythag.png b/static/assets/images/starting-out/pythag.png similarity index 100% rename from docs/assets/images/starting-out/pythag.png rename to static/assets/images/starting-out/pythag.png diff --git a/docs/assets/images/starting-out/ringring.png b/static/assets/images/starting-out/ringring.png similarity index 100% rename from docs/assets/images/starting-out/ringring.png rename to static/assets/images/starting-out/ringring.png diff --git a/docs/assets/images/starting-out/setnotation.png b/static/assets/images/starting-out/setnotation.png similarity index 100% rename from docs/assets/images/starting-out/setnotation.png rename to static/assets/images/starting-out/setnotation.png diff --git a/docs/assets/images/starting-out/startingout.png b/static/assets/images/starting-out/startingout.png similarity index 100% rename from docs/assets/images/starting-out/startingout.png rename to static/assets/images/starting-out/startingout.png diff --git a/docs/assets/images/starting-out/tuple.png b/static/assets/images/starting-out/tuple.png similarity index 100% rename from docs/assets/images/starting-out/tuple.png rename to static/assets/images/starting-out/tuple.png diff --git a/docs/assets/images/sun.png b/static/assets/images/sun.png similarity index 100% rename from docs/assets/images/sun.png rename to static/assets/images/sun.png diff --git a/docs/assets/images/syntax-in-functions/case.png b/static/assets/images/syntax-in-functions/case.png similarity index 100% rename from docs/assets/images/syntax-in-functions/case.png rename to static/assets/images/syntax-in-functions/case.png diff --git a/docs/assets/images/syntax-in-functions/guards.png b/static/assets/images/syntax-in-functions/guards.png similarity index 100% rename from docs/assets/images/syntax-in-functions/guards.png rename to static/assets/images/syntax-in-functions/guards.png diff --git a/docs/assets/images/syntax-in-functions/letitbe.png b/static/assets/images/syntax-in-functions/letitbe.png similarity index 100% rename from docs/assets/images/syntax-in-functions/letitbe.png rename to static/assets/images/syntax-in-functions/letitbe.png diff --git a/docs/assets/images/syntax-in-functions/pattern.png b/static/assets/images/syntax-in-functions/pattern.png similarity index 100% rename from docs/assets/images/syntax-in-functions/pattern.png rename to static/assets/images/syntax-in-functions/pattern.png diff --git a/docs/assets/images/types-and-typeclasses/bomb.png b/static/assets/images/types-and-typeclasses/bomb.png similarity index 100% rename from docs/assets/images/types-and-typeclasses/bomb.png rename to static/assets/images/types-and-typeclasses/bomb.png diff --git a/docs/assets/images/types-and-typeclasses/box.png b/static/assets/images/types-and-typeclasses/box.png similarity index 100% rename from docs/assets/images/types-and-typeclasses/box.png rename to static/assets/images/types-and-typeclasses/box.png diff --git a/docs/assets/images/types-and-typeclasses/classes.png b/static/assets/images/types-and-typeclasses/classes.png similarity index 100% rename from docs/assets/images/types-and-typeclasses/classes.png rename to static/assets/images/types-and-typeclasses/classes.png diff --git a/docs/assets/images/types-and-typeclasses/cow.png b/static/assets/images/types-and-typeclasses/cow.png similarity index 100% rename from docs/assets/images/types-and-typeclasses/cow.png rename to static/assets/images/types-and-typeclasses/cow.png diff --git a/docs/assets/images/zippers/60sdude.png b/static/assets/images/zippers/60sdude.png similarity index 100% rename from docs/assets/images/zippers/60sdude.png rename to static/assets/images/zippers/60sdude.png diff --git a/docs/assets/images/zippers/almostzipper.png b/static/assets/images/zippers/almostzipper.png similarity index 100% rename from docs/assets/images/zippers/almostzipper.png rename to static/assets/images/zippers/almostzipper.png diff --git a/docs/assets/images/zippers/asstronaut.png b/static/assets/images/zippers/asstronaut.png similarity index 100% rename from docs/assets/images/zippers/asstronaut.png rename to static/assets/images/zippers/asstronaut.png diff --git a/docs/assets/images/zippers/bigtree.png b/static/assets/images/zippers/bigtree.png similarity index 100% rename from docs/assets/images/zippers/bigtree.png rename to static/assets/images/zippers/bigtree.png diff --git a/docs/assets/images/zippers/bread.png b/static/assets/images/zippers/bread.png similarity index 100% rename from docs/assets/images/zippers/bread.png rename to static/assets/images/zippers/bread.png diff --git a/docs/assets/images/zippers/cool.png b/static/assets/images/zippers/cool.png similarity index 100% rename from docs/assets/images/zippers/cool.png rename to static/assets/images/zippers/cool.png diff --git a/docs/assets/images/zippers/newsplash.png b/static/assets/images/zippers/newsplash.png similarity index 100% rename from docs/assets/images/zippers/newsplash.png rename to static/assets/images/zippers/newsplash.png diff --git a/docs/assets/images/zippers/picard.png b/static/assets/images/zippers/picard.png similarity index 100% rename from docs/assets/images/zippers/picard.png rename to static/assets/images/zippers/picard.png diff --git a/docs/assets/images/zippers/pollywantsa.png b/static/assets/images/zippers/pollywantsa.png similarity index 100% rename from docs/assets/images/zippers/pollywantsa.png rename to static/assets/images/zippers/pollywantsa.png diff --git a/docs/assets/images/zippers/spongedisk.png b/static/assets/images/zippers/spongedisk.png similarity index 100% rename from docs/assets/images/zippers/spongedisk.png rename to static/assets/images/zippers/spongedisk.png diff --git a/docs/assets/js/toggleShow.js b/static/assets/js/toggleShow.js similarity index 100% rename from docs/assets/js/toggleShow.js rename to static/assets/js/toggleShow.js diff --git a/docs/index.html b/static/index.html similarity index 100% rename from docs/index.html rename to static/index.html diff --git a/docs/robots.txt b/static/robots.txt similarity index 100% rename from docs/robots.txt rename to static/robots.txt diff --git a/docs/sh/Scripts/shBrushHaskell.js b/static/sh/Scripts/shBrushHaskell.js similarity index 100% rename from docs/sh/Scripts/shBrushHaskell.js rename to static/sh/Scripts/shBrushHaskell.js diff --git a/docs/sh/Scripts/shBrushPlain.js b/static/sh/Scripts/shBrushPlain.js similarity index 100% rename from docs/sh/Scripts/shBrushPlain.js rename to static/sh/Scripts/shBrushPlain.js diff --git a/docs/sh/Scripts/shCore.js b/static/sh/Scripts/shCore.js similarity index 100% rename from docs/sh/Scripts/shCore.js rename to static/sh/Scripts/shCore.js diff --git a/docs/sh/Styles/SyntaxHighlighter.css b/static/sh/Styles/SyntaxHighlighter.css similarity index 100% rename from docs/sh/Styles/SyntaxHighlighter.css rename to static/sh/Styles/SyntaxHighlighter.css diff --git a/docs/sitemap.xml b/static/sitemap.xml similarity index 100% rename from docs/sitemap.xml rename to static/sitemap.xml diff --git a/templates/chapters.html b/templates/chapters.html new file mode 100644 index 0000000..bd20724 --- /dev/null +++ b/templates/chapters.html @@ -0,0 +1,15 @@ +
      +$for(chapters)$ +
    1. $title$ +$if(sections)$ +
        +$for(sections)$ +
      • $title$
      • +$endfor$ +
      +$endif$ +
    2. +$endfor$ +
    + +

    This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License because I couldn't find a license with an even longer name.

    diff --git a/markdown/config/template.html b/templates/default.html similarity index 90% rename from markdown/config/template.html rename to templates/default.html index 603b32d..32b76fd 100644 --- a/markdown/config/template.html +++ b/templates/default.html @@ -10,10 +10,10 @@ $if(prev_filename)$ - + $endif$ $if(next_filename)$ - + $endif$ @@ -26,7 +26,7 @@ $endif$ +

    $title$

    $body$ $if(footdiv)$