## Building
-`make all` builds all the HTML from the Markdown.
-`./index.sh` builds the index based on content from build directory.
+* `make all` builds all the HTML from the Markdown.
+* `./scripts/index.sh > build/all.html` builds the index that is based on
+content from the build directory.
+
+Note: There is some significant hardcoding in the script that assumes that
+the `all.html` file is in the `build` directory.
# Common Errors
+++ /dev/null
-#!/bin/bash
-
-#############
-# CONSTANTS #
-#############
-BUILD_DIR="build"
-
-#############
-# FUNCTIONS #
-#############
-
-get_title() {
- grep -oP '(?<=<title>).*?(?=</title>)' "$1"
-}
- # DESC: Gets the text between the <title> tags of an HTML file.
- # $1: Path to HTML file
-
-make_a() {
- local path
- path="$(echo "$1" | cut -d '/' -f2- )"
- printf "<a href=\"%s\">%s</a>\n" "$path" "$(get_title "$1")"
-}
- # DESC: Writes an HTML anchor based on a built HTML file
- # $1: Path to HTML file
- # NOTE: Cut build/ from the path b/c the path needs to be relative
- # and the the file we are creating will go into the build dir.
-
-make_li(){
- printf "<li>%s</li>\n" "$1"
-}
-
-make_ul() {
- echo "<ul>"
- for item in $1; do
- make_li "$(make_a "$item")"
- done
- echo "</ul>"
-}
- # DESC: Adds <ul> tags around a list of links.
- # $1: A list of items that have <li>
-
-make_boilerplate(){
- printf \
-"<!DOCTYPE html>
-<html>
- <head>
- <meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">
- <title>Pages in Build</title>
- <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\">
- <link href='../_static/css/normalize.css' rel='stylesheet' type='text/css'>
- <link href='../_static/css/space-sakura.css' id=\"sakura-css\" rel='stylesheet' type='text/css'>
- </head>
- <body>
- <header>
- <h1>Pages in Build</h1>
- %s
- </header>
- </body>
-</html>" "$1"
-}
- # DESC: Defines the template and injects the body.
- # $1: The body of the HTML to add.
- # NOTE: The CSS for index is one level higher b/c I'm dumping into
- # the build directory rather than one of its subdirectories.
-
-
-########
-# MAIN #
-########
-FILES="$(find "$BUILD_DIR" -type 'f')"
-make_boilerplate "$(make_ul "$FILES")"
--- /dev/null
+#!/bin/bash
+basenames="$(find ./tiddlers -name '*.md' -exec basename -s .md {} \;)"
+outdir="./test"
+
+if [ ! -d "$outdir" ]; then
+ mkdir "$outdir"
+fi;
+
+for file in $basenames; do
+ {
+ echo "---"
+ cat "./tiddlers/$file.md.meta"
+ echo; echo "---"; echo;
+ cat "./tiddlers/$file.md"
+ } > "$outdir/$file.md"
+done
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+#############
+# CONSTANTS #
+#############
+BUILD_DIR="build"
+
+#############
+# FUNCTIONS #
+#############
+
+get_title() {
+ grep -oP '(?<=<title>).*?(?=</title>)' "$1"
+}
+ # DESC: Gets the text between the <title> tags of an HTML file.
+ # $1: Path to HTML file
+
+make_a() {
+ local path
+ path="$(echo "$1" | cut -d '/' -f2- )"
+ printf "<a href=\"%s\">%s</a>\n" "$path" "$(get_title "$1")"
+}
+ # DESC: Writes an HTML anchor based on a built HTML file
+ # $1: Path to HTML file
+ # NOTE: Cut build/ from the path b/c the path needs to be relative
+ # and the the file we are creating will go into the build dir.
+
+make_li(){
+ printf "<li>%s</li>\n" "$1"
+}
+
+make_ul() {
+ echo "<ul>"
+ for item in $1; do
+ make_li "$(make_a "$item")"
+ done
+ echo "</ul>"
+}
+ # DESC: Adds <ul> tags around a list of links.
+ # $1: A list of items that have <li>
+
+make_boilerplate(){
+ printf \
+"<!DOCTYPE html>
+<html>
+ <head>
+ <meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">
+ <title>Pages in Build</title>
+ <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\">
+ <link href='../_static/css/normalize.css' rel='stylesheet' type='text/css'>
+ <link href='../_static/css/space-sakura.css' id=\"sakura-css\" rel='stylesheet' type='text/css'>
+ </head>
+ <body>
+ <header>
+ <h1>Pages in Build</h1>
+ %s
+ </header>
+ </body>
+</html>" "$1"
+}
+ # DESC: Defines the template and injects the body.
+ # $1: The body of the HTML to add.
+ # NOTE: The CSS for index is one level higher b/c I'm dumping into
+ # the build directory rather than one of its subdirectories.
+
+
+########
+# MAIN #
+########
+FILES="$(find "$BUILD_DIR" -type 'f')"
+make_boilerplate "$(make_ul "$FILES")"
--- /dev/null
+# To Do
+
+* Add navigation to template to make notes useful.
+ * ~~Need an index page.~~
+ * ~~I only want files in the build directory.~~
+ * ~~I want a clickable link with a reference to the title.~~
+ * (Stretch) An automated description would be nice.
+ * Add index page to nav bar for every page.
+ * About - add acknowledgements
+ * Summaries - index
+ * Misc - deal with this later
+* Figure out a `make deploy` with a `.env` file.
+ * Serve via goddard on push. (If using git hook in rb, use .env file)
+* Clean up coding/organizational messes - codify design philosophy.
+ * Drive project-level batch interactions from Makefile
+ * What about file level operataions, like hardwrapping an MD file?
+ (I'll probably need Python for that and I don't want to add a
+ dependency. We will add that as a separate CLI tool.)
+ * Helper scripts should go in a separate dir.
+ * Try to decouple hardcoded things
+ * index and template use different hardcoded paths to CSS.
+ * (Stretch) Should acknowledgements be a template?
+ * (Stretchier) Should I mention Pandoc (def), GNU Make (prob), VSCodium (prob not), Foam (prob not),
+ Debian(very prob not)?
+ * Can I centralize config? A `make config` would be nice if it includes
+ static content (like `author="Kyle Bowman"`) and dynamic content like
+ `files=$(ls build)`.
+ * _static should contain only things that are copied into the website
+ * (Stretch) Reformulate my templates based on jgm's templates so I can
+ merge updates easily.
+* Write the README
+* Extract lessons from `experiments.md`.
+ * I'm torn about where to put these. In the project or in my notes?
+* (Stretch) Formalize demo and add tests
+* (Stretch) Add a hotkey to strike through a line in a to-do list.
+* (Stretch) Start building a CLI library that helps me manage md files.
+ * Hard wrap the MD files themselves.
+ * Spell check
+
+# Done
+* ~~Structure notes~~
+ * ~~rocketbowman - keep this publishable. Contains functional components like _static, Makefile, tests, templates~~
+ * ~~README (and maybe eventually doc/)~~
+ * ~~Makefile~~
+ * ~~Acknowledgements~~
+ * ~~_static/~~
+ * ~~tests/~~
+ * ~~symlink to public/ dir/repo~~
+ * ~~symlink to private/ dir/repo~~
+* ~~Move, symlink and categorize notes~~
+ * ~~How do I want to archive git repositories?~~
+ * ~~Convert .tid (md + md.meta) int md (w/ frontmatter)~~
+ * ~~private: zettlekasten (private?)~~
+ * ~~public: summaries/how-to/essays (need to determine categories)~~
\ No newline at end of file