From 5bf68f6be95ce3509d87670f8317bd68557c347c Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 22 Jan 2025 22:27:01 -0500 Subject: [PATCH] more cleanups --- .../reference/pages/raddb/global.d/index.adoc | 2 +- .../raddb/mods-available/all_modules.adoc | 1 - .../reference/pages/type/string/double.adoc | 14 ++------- .../reference/pages/type/string/single.adoc | 10 ++---- .../reference/pages/type/string/triple.adoc | 31 +++++++++++++++++++ .../reference/pages/unlang/interpreter.adoc | 2 +- .../reference/pages/xlat/function.adoc | 2 +- 7 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 doc/antora/modules/reference/pages/type/string/triple.adoc diff --git a/doc/antora/modules/reference/pages/raddb/global.d/index.adoc b/doc/antora/modules/reference/pages/raddb/global.d/index.adoc index 339228395520a..1286f4e0a4abc 100644 --- a/doc/antora/modules/reference/pages/raddb/global.d/index.adoc +++ b/doc/antora/modules/reference/pages/raddb/global.d/index.adoc @@ -2,7 +2,7 @@ Some modules have configuration which is _global_ to the server. -For example, the xref:mods-available/python.adoc[python] module has +For example, the xref:raddb/mods-available/python.adoc[python] module has the Python path set once for the server. Due to how the underlying Python APIs are written, this path cannot be configured on a per-module basis. If the configuration items were instead placed in diff --git a/doc/antora/modules/reference/pages/raddb/mods-available/all_modules.adoc b/doc/antora/modules/reference/pages/raddb/mods-available/all_modules.adoc index 7e74a47021713..34c72c5503fa7 100644 --- a/doc/antora/modules/reference/pages/raddb/mods-available/all_modules.adoc +++ b/doc/antora/modules/reference/pages/raddb/mods-available/all_modules.adoc @@ -46,7 +46,6 @@ of the module. | xref:raddb/mods-available/couchbase.adoc[couchbase] | Allows attributes to be stored and retrieved from a couchbase server. Client definitions may also be bulk loaded from a couchbase server as FreeRADIUS starts. | xref:raddb/mods-available/csv.adoc[csv] | Maps values in a CSV file to FreeRADIUS attributes and adds them to the request. -| xref:raddb/mods-available/kafka.adoc[kafka] | Produces messages, placing them in a Kafka messaging queue | xref:raddb/mods-available/passwd.adoc[passwd] | Reads and caches line-oriented files that are in a format similar to ``/etc/passwd``. | xref:raddb/mods-available/radutmp.adoc[radutmp] | Writes a utmp style file that lists the users who are logged in. The file is used mainly for Simultaneous-Use checking and by radwho to see who has current sessions. diff --git a/doc/antora/modules/reference/pages/type/string/double.adoc b/doc/antora/modules/reference/pages/type/string/double.adoc index fafcd2b0119a1..60b621423a5fa 100644 --- a/doc/antora/modules/reference/pages/type/string/double.adoc +++ b/doc/antora/modules/reference/pages/type/string/double.adoc @@ -8,13 +8,8 @@ xref:xlat/index.adoc[dynamic expansions]. As with xref:type/string/single.adoc[single-quoted strings], text within double quotes can include spaces. -For normally quoted strings, the quotation character can be placed inside of -the string by escaping it with a backslash. - -For triple quoted strings, the quotation character does not need to be -escaped. However, if the string does contain an escaped quotation -character, the quotation character is unescaped, as with normally -quoted strings. +The quotation character can be placed inside of the string by escaping +it with a backslash. The main difference between the single and double quoted strings is that the double quoted strings can be dynamically expanded. The syntax @@ -141,13 +136,8 @@ string is being used. `"this has embedded\ncharacters"` + `"attribute\tvalue\nusername\t%{User-Name}\nreply-message\t%{reply.Reply-Message}"` `"The result of 'SELECT * FROM foo WHERE 1' is: %sql(SELECT * FROM foo WHERE 1)"` -`"""this string has a "double quoted" string in the middle of it"""` // Licenced under CC-by-NC 4.0. // Copyright (C) 2019 Arran Cudbard-Bell // Copyright (C) 2019 The FreeRADIUS project. // Copyright (C) 2021 Network RADIUS SAS. - - - - diff --git a/doc/antora/modules/reference/pages/type/string/single.adoc b/doc/antora/modules/reference/pages/type/string/single.adoc index 2a91f325163e4..fae0b12288f5b 100644 --- a/doc/antora/modules/reference/pages/type/string/single.adoc +++ b/doc/antora/modules/reference/pages/type/string/single.adoc @@ -8,13 +8,8 @@ A single-quoted string is interpreted without any dynamic string expansion. The quotes allow the string to contain spaces, among other special characters. -For normally quoted strings, the quotation character can be placed inside of -the string by escaping it with a backslash. - -For triple quoted strings, the quotation character does not need to be -escaped. However, if the string does contain an escaped quotation -character, the quotation character is unescaped, as with normally -quoted strings. +The quotation character can be placed inside of the string by escaping +it with a backslash. .Examples @@ -22,7 +17,6 @@ quoted strings. `'foo bar`' + `'foo\\'bar'` + `'this is a long string'` -`'''This is a string with 'embedded' quotes'''` // Copyright (C) 2021 Network RADIUS SAS. Licenced under CC-by-NC 4.0. // This documentation was developed by Network RADIUS SAS. diff --git a/doc/antora/modules/reference/pages/type/string/triple.adoc b/doc/antora/modules/reference/pages/type/string/triple.adoc new file mode 100644 index 0000000000000..8f4d98d1893da --- /dev/null +++ b/doc/antora/modules/reference/pages/type/string/triple.adoc @@ -0,0 +1,31 @@ += Triple Quoted Strings + +.Syntax +`"""string"""` +`'''string'''` + +Triple-quoted strings are similar to their single-quoted or +double-quoted counterparts. The main difference is that for triple +quoted strings, the quotation character does not need to be escaped. +However, if the string does contain an escaped quotation character, +the quotation character is unescaped, as with normally quoted strings. + +Triple-quoted strings make it easier to create strings with embedded +quotes in them, because the quotes do not need to be escaped. + +.Examples + +`"""word"""` + +`"a string"' + +`"""foo"bar"!"""` + +`"""this is a long string"""` + +`"""this has embedded\ncharacters"""` + +`"""this string has a "double quoted" string in the middle of it"""` +`'''This is a string with 'embedded' quotes'''` + +// Licenced under CC-by-NC 4.0. +// Copyright (C) 2025 Network RADIUS SAS. + + + + diff --git a/doc/antora/modules/reference/pages/unlang/interpreter.adoc b/doc/antora/modules/reference/pages/unlang/interpreter.adoc index c127921bcba73..ec9d69584bfcf 100644 --- a/doc/antora/modules/reference/pages/unlang/interpreter.adoc +++ b/doc/antora/modules/reference/pages/unlang/interpreter.adoc @@ -141,7 +141,7 @@ include::partial$rcode_table.adoc[] The "return code" used by `unlang` is somewhat similar to return codes used by functions in other languages. However, this return code is built into `unlang`, because it simplifies most common scenarios. For -example, automatic xref:unlang/load-balance.adocp[load-balancing] +example, automatic xref:unlang/load-balance.adoc[load-balancing] would be much more difficult without `unlang` hiding much of the underlying complexity. diff --git a/doc/antora/modules/reference/pages/xlat/function.adoc b/doc/antora/modules/reference/pages/xlat/function.adoc index 416251aba4cce..74e9dd068d0cc 100644 --- a/doc/antora/modules/reference/pages/xlat/function.adoc +++ b/doc/antora/modules/reference/pages/xlat/function.adoc @@ -8,7 +8,7 @@ .Description Functions allow for complex expansions at run time. There are many -xref:builtin.adoc[built-in expansions]. Many modules also define +xref:xlat/builtin.adoc[built-in expansions]. Many modules also define their own expansions. The module-specific expansions are documented in each module. function:: The name of the function. e.g. `md5` or `sql`, etc.