-
Notifications
You must be signed in to change notification settings - Fork 70
/
Gruntfile.coffee
101 lines (101 loc) · 2.72 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
module.exports = (grunt) ->
# Initial grunt configurations
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
clean: [ 'docs', '_tmp' ]
replace:
boldSyntaxElements:
options: patterns: [ {
match: /@@[a-zA-Z_0-9]*(\[[^\]]*\])*/g
replacement: (match) ->
'<b class="syntax-element">' + match.substring(2) + '</b>'
} ]
files: [
{ src: '_site/index.html', dest: 'docs/index.html' },
{ src: '_site/pdf.html', dest: 'docs/av1-spec.html' }
]
preserveIndents:
options:
patterns: [ {
match: /^\|([ ]){2,}/gm
replacement: (match) ->
'| ' + ' '.repeat(match.substring(1).length - 1)
} ]
files: [
{ src: '98.testing.md', dest: '_tmp/' },
{ src: '04.conventions.md', dest: '_tmp/' },
{ src: '06.bitstream.syntax.md', dest: '_tmp/' }
{ src: 'annex.b.superframes.md', dest: '_tmp/' }
]
copy:
docs:
files: [ {
expand: true
cwd: '_site'
src: 'assets/**'
dest: 'docs/'
} ]
readme:
files: [ {
expand: true # Not intuitive
flatten: true # Not intuitive
src: '_site/README.html'
dest: 'docs/'
} ]
deprecated: # Preserves ArgonDesign webserver scheme
files: [ {
src: 'docs/index.html'
dest: '_site/av1-spec.html'
} ]
jekyll:
options:
bundleExec: true
skip_initial_build: false
verbose: false
src: '.'
dest: '_site'
serve: options:
serve: false
connect:
remote:
options:
hostname: '*'
port: process.env.AV1_SPEC_PORT ? 4000
base: '.'
keepalive: true
livereload: false
local:
options:
hostname: '*'
port: 4000
base: '.'
keepalive: true
open: 'http://127.0.0.1:4000/docs/'
livereload: false
nospawn:
options:
hostname: '*'
port: 4000
base: '.'
keepalive: true
livereload: false
exec:
pdf:
cmd: 'prince docs/av1-spec.html -o docs/av1-spec.pdf'
stderr: false
# Load the NPM tasks.
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-jekyll'
grunt.loadNpmTasks 'grunt-replace'
grunt.loadNpmTasks('grunt-exec');
# Register the default tasks.
grunt.registerTask 'default', [
'clean'
'replace:preserveIndents'
'jekyll'
'replace:boldSyntaxElements'
'copy'
]
return