3da53413ce
Database version 4 Revving resources involves hashing asset files and appending a query string to their URLs. Additionally we monitor asset files for changes and edit their new checksum hash into all HTML files citing them. This commit also introduces new template tags for assets (listed below) with which you may instruct Cinera to rev assets of your choice. There is further information about this in the help (-h) and the README.md Amongst other minor changes, we now support unset $XDG_CACHE_HOME and $HOME - Thanks to insofaras for wordexp() New flags: -Q Set query string New template tags: __CINERA_ASSET__ __CINERA_CSS__ __CINERA_IMAGE__ __CINERA_JS__ Renamed template tag: __CINERA_SEARCH__ (was __CINERA_INDEX__) |
||
---|---|---|
cinera | ||
hmml_to_youtube | ||
hmmlconv | ||
hmmlib | ||
hmmlib-js | ||
source_recorder | ||
README.md |
README.md
Fair warning: This is all under development and not yet packaged up for easy deployment
Cinera
Install the dependencies
- flex (for hmmlib)
- curl (for cinera)
Download, and prepare the parser
git clone git@gitssh.handmade.network:Annotation-Pushers/Annotation-System.git
cd Annotation-System/hmmlib
make
cp hmml.a hmmlib.h ../cinera/
cd ../cinera/
Note: For each parser update, remember to make and copy it into place.
Build
$SHELL cinera.c
Configure the server
If you enforce a strict Content Security Policy and X-Frame-Options in your server configuration as recommended by Security Headers, you may enable Cinera to function by making two small tweaks:
add_header Content-Security-Policy "default-src … https://www.youtube.com https://s.ytimg.com";
add_header X-Frame-Options "ALLOW-FROM https://www.youtube.com";
Note: For more information about these and other security headers, see Scott Helme's articles Content Security Policy - An Introduction and Hardening your HTTP response headers.
Run
Single Edition operation
cinera test.hmml
This simply generates an HTML file (and updates cinera_topics.css
if needed)
from test.hmml
and outputs to out.html
(configurable with -o).
Project Edition operation
cinera -p ProjectID
Setting the ProjectID with the -p
flag triggers Project Edition. In this
edition Cinera monitors the Project Input Directory for new, edited and
deleted .hmml files, and generates one table of contents / search page and a
player page each for valid sets of annotations (or removes them, if needed).
By default all directories - input and output - are set to the current working directory. Typical operation will involve setting these flags:
-d Project Input Directory, the directory where the .hmml files reside
-r Asset Root Directory, path shallower than or equal to the CSS, Images and
JS directories
-R Asset Root URL, corresponding to the Root Directory
-c CSS Directory, relative to Root
-i Images Directory, relative to Root
-j JS Directory, relative to Root
-b Output Base Directory, location of the table of contents / search page
-B Output Base URL, corresponding to the Output Base Directory
-t Template Directory
-x Search Template Location, relative to Template Directory
-y Player Template Location, relative to Template Directory
Templates
Search Template
<!-- __CINERA_INCLUDES__ -->
to put inside your own<head></head>
<!-- __CINERA_SEARCH__ -->
the table of contents and search functionality
Player Template
<!-- __CINERA_INCLUDES__ -->
to put inside your own<head></head>
<!-- __CINERA_MENUS__ -->
<!-- __CINERA_PLAYER__ -->
<!-- __CINERA_SCRIPT__ -->
must come after<!-- __CINERA_MENUS__ -->
and<!-- __CINERA_PLAYER__ -->
Optional tags available for use in your Player Template
<!-- __CINERA_TITLE__ -->
<!-- __CINERA_VIDEO_ID__ -->
Other tags available for use in either template
- Asset tags:
<!-- __CINERA_ASSET__ path.ext -->
General purpose tag that outputs the URL of the specified asset relative to the Asset Root URL (-R)<!-- __CINERA_IMAGE__ path.ext -->
General purpose tag that outputs the URL of the specified asset relative to the Images Directory (-i)<!-- __CINERA_CSS__ path.ext -->
Convenience tag that outputs a <link rel="stylesheet"...> node for the specified asset relative to the CSS Directory (-c), for use inside your <head> block<!-- __CINERA_JS__ path.ext -->
Convenience tag that outputs a <script type="text/javascript"...> node for the specified asset relative to the JS Directory (-j), for use wherever a