2017-06-22 22:11:01 +00:00
|
|
|
Fair warning: This is all under development and not yet packaged up for easy
|
|
|
|
deployment
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2017-11-18 00:27:33 +00:00
|
|
|
## Cinera
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2018-09-17 18:06:31 +00:00
|
|
|
### Install the dependencies
|
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
1. curl
|
2018-09-17 18:06:31 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
### Download, and copy the parser into place
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2022-09-23 16:42:18 +00:00
|
|
|
1. `git clone https://git.handmade.network/Annotation-Pushers/Annotation-System.git`
|
2022-09-23 16:39:07 +00:00
|
|
|
2. `cd Annotation-System/cinera`
|
|
|
|
3. `cp ../hmmlib2/hmmlib.h .`
|
2017-06-21 21:27:57 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
Note: For each parser update, remember to copy it into place.
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2017-07-24 23:43:26 +00:00
|
|
|
### Build
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2017-11-18 00:27:33 +00:00
|
|
|
1. `$SHELL cinera.c`
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
### Configure
|
|
|
|
|
|
|
|
cinera -h
|
|
|
|
|
|
|
|
This documents the configuration file format and default settings.
|
|
|
|
|
2018-05-01 21:05:44 +00:00
|
|
|
### Configure the server
|
|
|
|
|
|
|
|
If you enforce a strict Content Security Policy and X-Frame-Options in your
|
|
|
|
server configuration as recommended by [Security
|
|
|
|
Headers](https://securityheaders.com/), 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](https://scotthelme.co.uk/content-security-policy-an-introduction/)
|
|
|
|
and [Hardening your HTTP response headers](https://scotthelme.co.uk/hardening-your-http-response-headers/#x-frame-options).
|
|
|
|
|
2017-06-21 21:23:21 +00:00
|
|
|
### Run
|
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
cinera -c /path/to/config.conf
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2017-11-11 00:34:47 +00:00
|
|
|
#### Templates
|
2017-06-21 21:23:21 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
*(Global) Search Template*
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_INCLUDES__ -->` _to put inside your own `<head></head>`_
|
|
|
|
- `<!-- __CINERA_SEARCH__ -->` _the table of contents and search functionality_
|
2017-11-11 00:34:47 +00:00
|
|
|
|
|
|
|
*Player Template*
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_INCLUDES__ -->` _to put inside your own `<head></head>`_
|
|
|
|
- `<!-- __CINERA_PLAYER__ -->`
|
2018-02-28 01:04:06 +00:00
|
|
|
|
|
|
|
*Optional tags available for use in your Player Template*
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_TITLE__ -->`
|
|
|
|
- `<!-- __CINERA_VIDEO_ID__ -->`
|
2018-09-19 19:50:21 +00:00
|
|
|
- `<!-- __CINERA_VOD_PLATFORM__ -->`
|
2018-09-17 18:06:31 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
*Other tags available for use in any template*
|
2018-09-17 18:06:31 +00:00
|
|
|
- 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 -->`
|
2022-09-23 16:47:12 +00:00
|
|
|
Convenience tag that outputs a `<link rel="stylesheet"...>` node
|
2018-09-17 18:06:31 +00:00
|
|
|
for the specified asset relative to the CSS Directory (-c), for
|
2022-09-23 16:47:12 +00:00
|
|
|
use inside your `<head>` block
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_JS__ path.ext -->`
|
2022-09-23 16:47:12 +00:00
|
|
|
Convenience tag that outputs a `<script type="text/javascript"...>`
|
2018-09-17 18:06:31 +00:00
|
|
|
node for the specified asset relative to the JS Directory (-j),
|
2022-09-23 16:42:18 +00:00
|
|
|
for use wherever a `<script>` node is valid
|
2018-09-17 18:06:31 +00:00
|
|
|
The path.ext in these tags supports parent directories to locate the
|
|
|
|
asset file relative to its specified type directory (generic, CSS, image
|
|
|
|
or JS), including the "../" directory, and paths containing spaces must
|
|
|
|
be surrounded with double-quotes (\-escapable if the quoted path itself
|
|
|
|
contains double-quotes).
|
|
|
|
|
2022-09-23 16:47:12 +00:00
|
|
|
All these asset tags additionally perform versioning, appending a query string
|
|
|
|
(-Q) and the file's checksum to the URL. Changes to a file trigger a rehash and
|
|
|
|
edit of all HTML pages citing this asset.
|
2018-09-17 18:06:31 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
- Navigation / Menu tags:
|
|
|
|
- `<!-- __CINERA_NAV__ -->`
|
|
|
|
This menu will contain only the current project, its siblings and
|
|
|
|
subprojects of both the aforementioned
|
|
|
|
- `<!-- __CINERA_GLOBAL_NAV__ -->`
|
|
|
|
This menu will contain every project in the configuration
|
2022-09-23 16:47:12 +00:00
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
These navigation tags additionally take one parameter, e.g.
|
|
|
|
`<!-- __CINERA_NAV__ horizontal -->`:
|
|
|
|
- `dropdown`
|
|
|
|
A dropdown menu, that opens on hover
|
|
|
|
- `horizontal`
|
|
|
|
More-or-less the same as `dropdown`, but always open
|
|
|
|
- `plain`
|
|
|
|
A straightforward `<ul>` for you to style how you like
|
|
|
|
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_PROJECT__ -->`
|
2022-09-23 16:39:07 +00:00
|
|
|
The project's `html_title` if configured, otherwise its `title`
|
|
|
|
- `<!-- __CINERA_PROJECT_PLAIN__ -->`
|
|
|
|
The project's `title`
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_PROJECT_ID__ -->`
|
2022-09-23 16:39:07 +00:00
|
|
|
- `<!-- __CINERA_PROJECT_LINEAGE__ -->`
|
|
|
|
The IDs of all projects from the root to the current project, separated
|
|
|
|
by a spaced-slash
|
2018-09-19 19:50:21 +00:00
|
|
|
- `<!-- __CINERA_SEARCH_URL__ -->`
|
2018-09-17 18:06:31 +00:00
|
|
|
- `<!-- __CINERA_THEME__ -->`
|
2022-09-23 17:39:01 +00:00
|
|
|
- `<!-- __CINERA_URL__ -->`
|
2018-02-28 01:04:06 +00:00
|
|
|
- `<!-- __CINERA_CUSTOM0__ -->`
|
|
|
|
- `<!-- __CINERA_CUSTOM1__ -->`
|
|
|
|
- `<!-- __CINERA_CUSTOM2__ -->`
|
2018-09-17 18:06:31 +00:00
|
|
|
⋮
|
2018-02-28 01:04:06 +00:00
|
|
|
- `<!-- __CINERA_CUSTOM15__ -->`
|
2018-09-17 18:06:31 +00:00
|
|
|
Freeform buffers for small snippets of localised information, e.g. a
|
|
|
|
single `<a>` element or perhaps a `<!-- comment -->`
|
|
|
|
They correspond to the custom0 to custom15 attributes in the [video]
|
|
|
|
node in your .hmml files
|
|
|
|
0 to 11 may hold up to 255 characters
|
|
|
|
12 to 15 may hold up to 1023 characters
|
2018-02-28 01:04:06 +00:00
|
|
|
|
|
|
|
Feel free to play with templates to your heart's content. If you do anything
|
2018-05-01 21:05:44 +00:00
|
|
|
invalid, _Cinera_ will tell you what's wrong.
|
|
|
|
|
2017-06-28 14:23:55 +00:00
|
|
|
#### Arguments
|
|
|
|
|
2022-09-23 16:39:07 +00:00
|
|
|
Usage: ./cinera [option(s)]
|
2018-02-28 01:04:06 +00:00
|
|
|
|
|
|
|
Options:
|
2022-09-23 16:39:07 +00:00
|
|
|
-c <config file path>
|
|
|
|
Set the main config file path
|
|
|
|
Defaults to: $XDG_CONFIG_HOME/cinera/cinera.conf
|
|
|
|
-0
|
|
|
|
Dry-run mode. Parse and print the config, but do not modify the
|
|
|
|
filesystem
|
2018-09-17 18:06:31 +00:00
|
|
|
-e
|
|
|
|
Display (examine) database and exit
|
2017-11-18 01:02:49 +00:00
|
|
|
-v
|
2018-02-28 01:04:06 +00:00
|
|
|
Display version and exit
|
|
|
|
-h
|
|
|
|
Display this help
|