mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-09-11 05:35:53 +03:00
Validate Grammar and generate HTML
This commit is contained in:
parent
1c81471e45
commit
a7b887052f
8
docs/spec/README
Normal file
8
docs/spec/README
Normal file
@ -0,0 +1,8 @@
|
||||
This grammar can be validated and converted to HTML with the cli from
|
||||
https://github.com/fabricereix/grammar
|
||||
|
||||
Validate and generate HTML
|
||||
|
||||
```
|
||||
./generate_html.sh
|
||||
```
|
18
docs/spec/generate_html.sh
Executable file
18
docs/spec/generate_html.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Check version
|
||||
# A specific version defines both the grammar format and the HTML output
|
||||
actual_version=$(grammar --version | cut -d" " -f2)
|
||||
expected_version="0.1.0"
|
||||
if [ "$actual_version" != "$expected_version" ] ; then
|
||||
echo "version mismatch"
|
||||
echo "expected: $expected_version"
|
||||
echo "actual: $actual_version"
|
||||
exit 1
|
||||
fi
|
||||
cat <<END >hurl.grammar.html
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
END
|
||||
grammar <hurl.grammar >>hurl.grammar.html
|
56
docs/spec/style.css
Normal file
56
docs/spec/style.css
Normal file
@ -0,0 +1,56 @@
|
||||
html {
|
||||
font-family: Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #20609f
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #20609f
|
||||
}
|
||||
|
||||
code {
|
||||
white-space:normal;
|
||||
}
|
||||
.grammar-usedby {
|
||||
color: #999;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.grammar-ruleset {
|
||||
margin-bottom: 40px;
|
||||
|
||||
}
|
||||
|
||||
.grammar-rule {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
.grammar-rule-id {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.grammar-rule-expression {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.grammar-literal {
|
||||
color: blueviolet;
|
||||
}
|
||||
|
||||
.grammar-regex {
|
||||
color: darkcyan
|
||||
}
|
||||
|
||||
.grammar-nonterminal {
|
||||
|
||||
}
|
||||
|
||||
.grammar-symbol {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user