From 669a7a1af323fc503f2ba949edeadc6bbf0567c5 Mon Sep 17 00:00:00 2001 From: Cas Rusnov Date: Sun, 14 Apr 2019 17:48:22 -0700 Subject: [PATCH] Add documentation and whatnot. --- .gitignore | 45 ++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 0 READMES/METADATA.md | 46 +++++++++++++++++++++++++++++++++++++++++++++ TODO | 1 + 4 files changed, 92 insertions(+) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 LICENSE create mode 100755 READMES/METADATA.md create mode 100644 TODO diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 894a44c..e373895 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,48 @@ venv.bak/ # mypy .mypy_cache/ + +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/READMES/METADATA.md b/READMES/METADATA.md new file mode 100755 index 0000000..3278a4a --- /dev/null +++ b/READMES/METADATA.md @@ -0,0 +1,46 @@ +# METADATA # + +## FORMAT ## + +Metadata shall be stored in json files. It shall take the form of a top-level dictionary, with each key being an item of metadata. Heirarchical metadata +and types are preserved and explitily allowed. + +Metadata is loaded from the top down, so each parent from the root can impart metadata on children. Children can explitily nullify parent metadata by +assigning it to undefined. + +## STORAGE ## + +On-disk meatdata is stored as a file along side the non-metadata file with the extension '.meta', for example the file 'foo.thtml' would have a metadata file as 'foo.thtml.meta'. Metadata for directories (which gets applied to all contents of that directory) is stored in .meta in the directory. + +## DEFAULT KEYS AND VALUES ## + +All files define the following keys by default: + +filename +: The local path of the file +path +: The full path to the file from the root +type +: The guessed mime-type of the file +stat +: A tree of stat() values in a dictionary, without the ST_ prefix, and with lowercase keys. + +Most files will want to define these keys: + +template +: The full path to the template file +template-fs +: The full path to the filesystem template +title +: A title for this object derived from the template, metadata or other sources. +description +: A description of this file. + +## METAMETADATA ## + +Some keys support metadata replacement, such as title, description, template and type. The metadata becomes a micro template which allows some template functions to occur at load time based on existing / default metadata. + +## CACHING STRATEGY ## + +The tree is traversed from the top down, each node in the tree is stat(). The mtime walue is compared to the mtime stored in the cache dict for that node. If it is newer, the metadata +is loaded again, and the tree continues to traverse. diff --git a/TODO b/TODO new file mode 100644 index 0000000..4a7443f --- /dev/null +++ b/TODO @@ -0,0 +1 @@ +* Pygments pretty printing of source code et al. including exposing that to the template API.