Working html generation example

This commit is contained in:
Nathan McCarty 2025-02-18 23:40:53 -05:00
parent 8098ed3c53
commit dc3c49cdf6
5 changed files with 97 additions and 12 deletions

48
examples/examples.ipkg Normal file
View file

@ -0,0 +1,48 @@
package ssg-examples
version = 0.1.0
authors = "Nathan McCarty"
-- maintainers =
-- license =
-- brief =
-- readme =
-- homepage =
-- sourceloc =
-- bugtracker =
-- the Idris2 version required (e.g. langversion >= 0.5.1)
-- langversion
-- packages to add to search path
depends = SSG
, structures
-- modules to install
modules = HelloWorld
-- main file (i.e. file to load at REPL)
-- main = Main
-- name of executable
-- executable = "SSG-test"
-- opts =
sourcedir = "src"
-- builddir =
-- outputdir =
-- script to run before building
-- prebuild =
-- script to run after building
-- postbuild =
-- script to run after building, before installing
-- preinstall =
-- script to run after installing
-- postinstall =
-- script to run before cleaning
-- preclean =
-- script to run after cleaning
-- postclean =

View file

@ -0,0 +1,19 @@
module HelloWorld
import SSG.HTML
import Structures.Dependent.DList
helloWorld : Html "html"
helloWorld =
Normal "html" ["lang" =$ "en"] [
Normal "head" [] [
RawText "title" [] "Example"
],
Normal "body" [] [
Normal "p" [] [Text "Hello World!"]
]
]
main : IO ()
main = putStr $ render helloWorld