summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2020-06-13 16:55:13 +0000
committergumi <git@gumi.ca>2020-06-13 16:55:13 +0000
commit0583acf42e4d5070c52f64eccdba1100f100bb04 (patch)
tree34da242f3b83d8e5da8aba245214d3b21f87cae9
parent6e9941f246d362074623f85582d74ed8bcd9de58 (diff)
downloadpolicies-0583acf42e4d5070c52f64eccdba1100f100bb04.tar.gz
policies-0583acf42e4d5070c52f64eccdba1100f100bb04.tar.bz2
policies-0583acf42e4d5070c52f64eccdba1100f100bb04.tar.xz
policies-0583acf42e4d5070c52f64eccdba1100f100bb04.zip
add documentation for Policybot bindings
-rw-r--r--README.md17
-rw-r--r--src/build.ts12
2 files changed, 21 insertions, 8 deletions
diff --git a/README.md b/README.md
index c2a600f..fbd4d12 100644
--- a/README.md
+++ b/README.md
@@ -9,19 +9,24 @@ Currently, only Markdown is supported for policy files.
The Front Matter is a YAML document that defines the properties of the policy.
#### Required properties
-- name: the full name of the policy
-- description: a short summary of the policy
+- `name`: the full name of the policy
+- `description`: a short summary of the policy
#### Optional properties
-- aliases: an array of path aliases (redirects)
-- ignore: prevents the policy file from being built
+- `aliases`: an array of path aliases (redirects)
+- `ignore`: prevents the policy file from being processed
+- `autoupdate`: bindings for [Policybot](https://gitlab.com/evol/policybot)
### Example
```md
---
name: Policy Name
-description: A short sumary
+description: A short summary
aliases: [foo, bar]
+
+autoupdate:
+ forums: {forum: 1, topic: 69, post: 420}
+ wiki: Protected_Wiki_Page
---
# title
@@ -35,7 +40,7 @@ content
## Generating the static site
### Dependencies
-- GNU Make (pre-installed in most linux distros)
+- GNU Make (available in the repos of most linux distros)
- [Deno](https://deno.land) 1.x (can be installed with `make deno`)
```sh
diff --git a/src/build.ts b/src/build.ts
index 94022dc..19c6141 100644
--- a/src/build.ts
+++ b/src/build.ts
@@ -3,10 +3,18 @@ import * as yaml from "https://deno.land/x/js_yaml_port/js-yaml.js"
// the structure of the front matter
interface PolicyYFM {
- name: string
+ name: string;
description: string;
aliases?: string[];
- ignore?: boolean;
+ ignore?: boolean;
+ autoupdate?: {
+ forums?: {
+ forum?: number;
+ topic?: number;
+ post: number;
+ };
+ wiki?: string;
+ };
}
const decoder = new TextDecoder("utf-8");