initial commit
[squeep-html-template-helper] / README.md
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..66d16fd
--- /dev/null
+++ b/README.md
@@ -0,0 +1,42 @@
+# @squeep/html-template-helper
+
+Simplistic helpers for rendering HTML and boilerplate.
+
+Specific to Squeep Framework Applications, this module has strong opinions and makes many assumptions.
+
+## API
+
+`htmlPage(pagePathLevel, ctx, options, main = [])`
+
+### Context
+
+The context is referenced for authenticated user information, as well as messaging.
+
+- `ctx.session.authenticatedIdentifier`
+- `ctx.session.authenticatedProfile`
+
+If either of these are present, a navigation link is added to the page header allowing the user to log out.  
+The link will point relatively to `/admin/logout`.
+
+- `ctx.url`
+
+If present, added as a query parameter (`r`, for redirect) to the logout link.
+
+- `ctx.errors`
+- `ctx.notifications`
+
+Lists of errors and notices to show at top of page, before main content.
+
+### Options
+
+- `options.pageTitle` - title and h1
+- `options.headElements` - list of items added to <head>
+- `options.bodyAttributes` - object entries get mapped to k="v", included on body element
+- `options.logoUrl` - appears beside h1 if set
+- `options.footerEntries` - array of content at bottom of page
+- `options.navLink` - array of {href, text, class} included in page header
+- `options.errorHeading` - h2 for error section
+- `options.errorContent` - additional information included ahead of list of errors
+- `options.notificationHeading` - h2 for notice section
+- `options.notificationContent` - additional information included ahead of list of notices
+- `options.`