Skip to content

Commit

Permalink
now that we suppress stupid warnings, fix the docs
Browse files Browse the repository at this point in the history
perl -p -i -e 's/`\+\%{(.*?)}\+`/`%{$1}`/g' $(find . -name "*.adoc" -print)
  • Loading branch information
alandekok committed Aug 16, 2019
1 parent 3a9ffd5 commit 622094c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions doc/antora/modules/unlang/pages/regex.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ library the server was built with. Multiple flags may be specified per
When the `=~` or `!~` operators are used, then parentheses in the regular
expression will sub capture groups, which contain part of the subject string.

The special expansion `+%{0}+` expands to the portion of the subject that
The special expansion `%{0}` expands to the portion of the subject that
matched. The expansions +
`+%{1}+`..`+%{32}+` expand to the contents of any subcapture groups.
`%{1}`..`%{32}` expand to the contents of any subcapture groups.

When using libpcre[2], named capture groups may also be accessed using the
built-in expansion +
`+%{regex:<named capture group>}+`.
`%{regex:<named capture group>}`.

Please see the xref:xlat/predefined.adoc#_0_32[xlat documentation] for
more information on regular expression matching.
Expand Down
16 changes: 8 additions & 8 deletions doc/antora/modules/unlang/pages/xlat/alternation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
Alternation syntax similar to that used in Unix shells may also be
used:

`+%{%{Foo}:-bar}+`
`%{%{Foo}:-bar}`

This code returns the value of `+%{Foo}+`, if it has a value.
This code returns the value of `%{Foo}`, if it has a value.
Otherwise, it returns a literal string bar.

`+%{%{Foo}:-%{Bar}}+`
`%{%{Foo}:-%{Bar}}`

This code returns the value of `+%{Foo}+`, if it has a value.
Otherwise, it returns the expansion of `+%{Bar}+`.
This code returns the value of `%{Foo}`, if it has a value.
Otherwise, it returns the expansion of `%{Bar}`.

These conditional expansions can be nested to almost any depth, such
as with `+%{%{One}:-%{%{Two}:-%{Three}}}+`.
as with `%{%{One}:-%{%{Two}:-%{Three}}}`.

.Examples
`+%{%{Stripped-User-Name}:-%{User-Name}}+` +
`+%{%{Framed-IP-Address}:-<none>}+`
`%{%{Stripped-User-Name}:-%{User-Name}}` +
`%{%{Framed-IP-Address}:-<none>}`

// Copyright (C) 2019 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
// Development of this documentation was sponsored by Network RADIUS SAS.
8 changes: 4 additions & 4 deletions doc/antora/modules/unlang/pages/xlat/attribute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Attributes in a list may be referenced via one of the following two
syntaxes:

`+%{Attribute-Name}+` +
`+%{<list>:Attribute-Name}+`
`%{Attribute-Name}` +
`%{<list>:Attribute-Name}`

The `<list>:` prefix is optional. If given, it must be a valid
reference to an xref:list.adoc[attribute list].
Expand All @@ -24,9 +24,9 @@ reference is replacedd with an empty string.

.Examples

`+%{User-Name}+` +
`%{User-Name}` +
`+%{request:User-Name} # same as above+` +
`+%{reply:User-Name}+` +
`%{reply:User-Name}` +
`+%{outer.request:User-Name} # from inside of a TTLS/PEAP tunnel+`

Examples of using references inside of a string:
Expand Down
2 changes: 1 addition & 1 deletion doc/antora/modules/unlang/pages/xlat/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This feature is used to create policies which refer to concepts rather
than to specific values. For example, a policy can be created that
refers to the User-Name in a request, via:

`+%{User-Name}+`
`%{User-Name}`

This string expansion is done only for double-quoted strings and for
the back-tick operator.
Expand Down
2 changes: 1 addition & 1 deletion doc/antora/modules/unlang/pages/xlat/module.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ expanded to allow for additional flexibility.

.Examples

`+%{sql:SELECT name FROM mytable WHERE username = %{User-Name}}+`
`%{sql:SELECT name FROM mytable WHERE username = %{User-Name}}`

// Copyright (C) 2019 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
// Development of this documentation was sponsored by Network RADIUS SAS.
6 changes: 3 additions & 3 deletions doc/antora/modules/unlang/pages/xlat/predefined.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,8 @@ The md5 of Caipirinha in hex is 14840b6d647c7c98a3e732f833d86ea9

=== +%{0}+..+%{32}+

`+%{0}+` expands to the portion of the subject that matched the last regular
expression evaluated. `+%{1}+`..`+%{32}+` expand to the contents of any capture
`%{0}` expands to the portion of the subject that matched the last regular
expression evaluated. `%{1}`..`%{32}` expand to the contents of any capture
groups in the pattern.

Every time a regular expression is evaluated, whether it matches or not,
Expand Down Expand Up @@ -841,7 +841,7 @@ The destination IPv4 or IPv6 address of the packet. See also the
expansions `%{listen:ipaddr}` and `%{listen:ipv6addr}`. If the socket
is listening on a "wildcard" address, then these two expansions will be
different, as follows: the `%{listen:ipaddr}` will be the wildcard
address and `+%{Packet-DST-IP-Address}+` will be the unicast address to
address and `%{Packet-DST-IP-Address}` will be the unicast address to
which the packet was sent.

=== +%{Packet-SRC-Port} and %{Packet-DST-Port}+
Expand Down
6 changes: 3 additions & 3 deletions doc/antora/modules/upgrade/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ The v3 server has warned about using non prefixed attribute references
for some time. If users have paid attention to those warnings, few
modifications will be required.

Use of attributes in xlats e.g. `+%{User-Name}+` remains unchanged.
Use of attributes in xlats e.g. `%{User-Name}` remains unchanged.
There is no plan to require prefixes here.

As of v3, the preferred format for `+unknown+` attributes is
Expand Down Expand Up @@ -570,10 +570,10 @@ checks to see if you want to execute the module.
Allow `+&Attr-Name[*]+` to mean _sum_. Previously, it just referred to
the first attribute.

Using `+%{expr:0 + &Attr-Name[*]}+` will cause it to return the sum of
Using `%{expr:0 + &Attr-Name[*]}` will cause it to return the sum of
the values of all attributes with the given name.

Note that `+%{expr:1 * &Attr-Name[*]}+` does _not_ mean repeated
Note that `%{expr:1 * &Attr-Name[*]}` does _not_ mean repeated
multiplication. Instead, the sum of the attributes is taken as before,
and then the result is multiplied by one.

Expand Down

0 comments on commit 622094c

Please sign in to comment.