update documentation
This commit is contained in:
parent
be5769c662
commit
c043e3b416
4 changed files with 11 additions and 12 deletions
|
|
@ -1,17 +1,14 @@
|
||||||
> version 1.0.0
|
> version 1.0.0
|
||||||
|
|
||||||
date: 2023-03-31T12:58:19+0200 (generated by `./make doc`)
|
date: 2023-03-31T13:31:47+0200 (generated by `./make doc`)
|
||||||
|
|
||||||
# Url parser (the gist of it)
|
# URI parser (the gist of it)
|
||||||
|
|
||||||
1. fragment URI starts with `#`
|
1. fragment URI starts with `#`
|
||||||
1. fragments are split by `&`
|
1. fragments are split by `&`
|
||||||
1. `=` is used to split fragment key/values
|
1. `=` is used to split fragment key/values
|
||||||
1. fragment-values are urlencoded (space becomes `+` using `encodeUriComponent` e.g.)
|
1. fragment-values are urlencoded (space becomes `+` using `encodeUriComponent` e.g.)
|
||||||
1. every recognized fragment key/value-pair is added to a central map/associative array/object
|
1. every recognized fragment key/value-pair is added to a central map/associative array/object
|
||||||
> version 1.0.0
|
|
||||||
|
|
||||||
date: 2023-03-31T12:58:19+0200 (generated by `./make doc`)
|
|
||||||
|
|
||||||
# XR Fragments (key/value params)
|
# XR Fragments (key/value params)
|
||||||
|
|
||||||
|
|
@ -21,7 +18,7 @@ date: 2023-03-31T12:58:19+0200 (generated by `./make doc`)
|
||||||
| prio | int (-10..1) | Asset linking | `#prio=-5` |
|
| prio | int (-10..1) | Asset linking | `#prio=-5` |
|
||||||
|
|
||||||
|
|
||||||
# Fragment parser (the gist of it)
|
# XR Fragments parser (the gist of it)
|
||||||
|
|
||||||
1. each key has a regex to validate its value-type (see regexes)
|
1. each key has a regex to validate its value-type (see regexes)
|
||||||
1. `|` is used to split multiple/fallback values
|
1. `|` is used to split multiple/fallback values
|
||||||
|
|
|
||||||
10
make
10
make
|
|
@ -33,8 +33,6 @@ tests(){
|
||||||
|
|
||||||
doc(){
|
doc(){
|
||||||
generate(){
|
generate(){
|
||||||
echo "> version $VERSION"
|
|
||||||
echo "\ndate: $(date +"%Y-%m-%dT%H:%M:%S%z") (generated by \`./make doc\`)"
|
|
||||||
cat $1 | awk '/\/\/ / {
|
cat $1 | awk '/\/\/ / {
|
||||||
gsub(".*// ","",$0);
|
gsub(".*// ","",$0);
|
||||||
gsub("# ","\n# ",$0);
|
gsub("# ","\n# ",$0);
|
||||||
|
|
@ -44,8 +42,12 @@ doc(){
|
||||||
print $0;
|
print $0;
|
||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
generate src/xrfragment/Url.hx > doc/RFC.md
|
{
|
||||||
generate src/xrfragment/Parser.hx >> doc/RFC.md
|
echo "> version $VERSION"
|
||||||
|
echo "\ndate: $(date +"%Y-%m-%dT%H:%M:%S%z") (generated by \`./make doc\`)"
|
||||||
|
generate src/xrfragment/Url.hx
|
||||||
|
generate src/xrfragment/Parser.hx
|
||||||
|
} > doc/RFC.md
|
||||||
}
|
}
|
||||||
|
|
||||||
test -z $1 && { try rm dist/* ; haxe build.hxml; exit $?; }
|
test -z $1 && { try rm dist/* ; haxe build.hxml; exit $?; }
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class Parser {
|
||||||
Frag.set("prio", Type.isInt); // | prio | int (-10..1) | Asset linking | `#prio=-5` |
|
Frag.set("prio", Type.isInt); // | prio | int (-10..1) | Asset linking | `#prio=-5` |
|
||||||
//
|
//
|
||||||
|
|
||||||
// # Fragment parser (the gist of it)
|
// # XR Fragments parser (the gist of it)
|
||||||
if( Frag.exists(key) ){ //
|
if( Frag.exists(key) ){ //
|
||||||
if( Frag.get(key).match(value) ){ // 1. each key has a regex to validate its value-type (see regexes)
|
if( Frag.get(key).match(value) ){ // 1. each key has a regex to validate its value-type (see regexes)
|
||||||
var v:Value = new Value();
|
var v:Value = new Value();
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ class Url {
|
||||||
|
|
||||||
public static var error:String = "";
|
public static var error:String = "";
|
||||||
|
|
||||||
@:keep // # Url parser (the gist of it)
|
@:keep // # URI parser (the gist of it)
|
||||||
public static function parse(qs:String):haxe.DynamicAccess<Dynamic> { //
|
public static function parse(qs:String):haxe.DynamicAccess<Dynamic> { //
|
||||||
var fragment:Array<String> = qs.split("#"); // 1. fragment URI starts with `#`
|
var fragment:Array<String> = qs.split("#"); // 1. fragment URI starts with `#`
|
||||||
var splitArray:Array<String> = fragment[1].split('&'); // 1. fragments are split by `&`
|
var splitArray:Array<String> = fragment[1].split('&'); // 1. fragments are split by `&`
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue