Add documentation and whatnot.

main
Cas Rusnov 6 years ago
parent 1a37054343
commit 669a7a1af3
  1. 45
      .gitignore
  2. 0
      LICENSE
  3. 46
      READMES/METADATA.md
  4. 1
      TODO

45
.gitignore vendored

@ -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

@ -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.

@ -0,0 +1 @@
* Pygments pretty printing of source code et al. including exposing that to the template API.