xrfragment/doc/fragments.awk

54 lines
2.1 KiB
Awk
Raw Normal View History

2023-04-27 22:45:19 +02:00
BEGIN{
2023-04-28 13:19:45 +02:00
ROUNDROBIN="🎲"
ASSET="🔒"
2023-04-28 17:16:13 +02:00
OVERRIDE="🔓"
PV_OVERRIDE="💥"
2023-04-28 13:19:45 +02:00
BROWSER_OVERRIDE="👩"
PROMPT="✋?"
2023-04-28 17:16:13 +02:00
EMBED_OVERRIDE="🔗"
print "| fragment | type | access | scope |"
print "|----------|------|--------------|-------|"
}
END{
print ""
2023-04-28 14:27:30 +02:00
print ASSET" = value(s) can only defined in 3D asset (immutable)<br>"
2023-04-28 17:16:13 +02:00
print OVERRIDE" = value(s) can be overwritten in certain context<br>"
2023-04-28 17:21:47 +02:00
print ROUNDROBIN" = multiple values will be roundrobin'ed (`#pos=0,0,0|1,0,0` e.g.)<br>"
2023-04-28 13:19:45 +02:00
print PV_OVERRIDE" = value(s) can be overwritten by [predefined_view](#predefined_view)<br>"
2023-04-28 17:16:13 +02:00
print BROWSER_OVERRIDE" = value(s) can be overwritten when user clicks `href` (value) or top-level URL change(see [How it works](#How%20it%20works))<br>"
print EMBED_OVERRIDE" = value(s) can be overwritten when 3D asset is embedded/linked as `src` value<br>"
print PROMPT" = value(s) can be overwritten by offering confirmation/undo to user<br><br>"
print ""
print "for more info see [How it works](#How%20it%20works)"
2023-04-27 22:45:19 +02:00
}
/category:/ {
$1=$2=""
sub(/^[[:space:]]+/, "", $0 ) # remove leading spaces
sub(/[[:space:]]+$/, "", $0 ) # remove trailing spaces
scope=$0
}
/Frag.*XRF\.*/ {
gsub(/.*\("/,"",$1)
gsub(/".*/,"",$1)
type="string"
2023-04-28 17:16:13 +02:00
perms = $0 ~ /OVERRIDE/ ? OVERRIDE : ASSET
2023-04-27 22:45:19 +02:00
frag=$1
$1=""
2023-04-28 13:19:45 +02:00
if( $0 ~ /T_INT/ ) type="int"
if( $0 ~ /T_STRING_OBJ/ ) type="[string object](string object ) "
if( $0 ~ /T_VECTOR2/ ) type="[vector2](#vector ) "
if( $0 ~ /T_VECTOR3/ ) type="[vector3](#vector ) "
if( $0 ~ /T_URL/ ) type="[url](#url ) "
if( $0 ~ /T_PREDEFINED_VIEW/ ) type="[predefined view](#predefined_view ) "
if( $0 ~ /ROUNDROBIN/ ) perms=perms" "ROUNDROBIN
if( $0 ~ /PV_OVERRIDE/ ) perms=perms" "PV_OVERRIDE
if( $0 ~ /BROWSER_OVERRIDE/ ) perms=perms" "BROWSER_OVERRIDE
2023-04-28 17:16:13 +02:00
if( $0 ~ /EMBED_OVERRIDE/ ) perms=perms" "EMBED_OVERRIDE
2023-04-28 13:19:45 +02:00
if( $0 ~ /PROMPT/ ) perms=perms" "PROMPT
print "| **"frag"** |" type "|" perms "|" scope "|"
2023-04-27 22:45:19 +02:00
}