aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data/text
diff options
context:
space:
mode:
authorEduardo Julian2022-11-07 18:52:46 -0400
committerEduardo Julian2022-11-07 18:52:46 -0400
commitcb572295c9a73330531e07f3f6a92b3bb2434514 (patch)
treeae14be0a53235971d897c033879e3d4512ffde68 /stdlib/source/documentation/lux/data/text
parent13c594758482bac0a7550bcb89cfeda8c5f0a1f3 (diff)
Can now mark definitions as deprecated in their documentation.
Diffstat (limited to 'stdlib/source/documentation/lux/data/text')
-rw-r--r--stdlib/source/documentation/lux/data/text/escape.lux12
-rw-r--r--stdlib/source/documentation/lux/data/text/regex.lux114
-rw-r--r--stdlib/source/documentation/lux/data/text/unicode/block.lux4
-rw-r--r--stdlib/source/documentation/lux/data/text/unicode/set.lux4
4 files changed, 73 insertions, 61 deletions
diff --git a/stdlib/source/documentation/lux/data/text/escape.lux b/stdlib/source/documentation/lux/data/text/escape.lux
index 5b85c8359..cd3ded777 100644
--- a/stdlib/source/documentation/lux/data/text/escape.lux
+++ b/stdlib/source/documentation/lux/data/text/escape.lux
@@ -20,17 +20,17 @@
($.definition /.escaped
"Yields a escaped version of the text."
- [(escaped text)])
+ ($.example (escaped text)))
($.definition /.un_escaped
(format "Yields an un-escaped text."
\n "Fails if it was improperly escaped.")
- [(un_escaped text)])
+ ($.example (un_escaped text)))
($.definition /.literal
"If given a escaped text literal, expands to an un-escaped version."
- [(/.literal "Line 1\nLine 2")
- "=>"
- (format "Line 1" \n
- "Line 2")])
+ ($.example (/.literal "Line 1\nLine 2"))
+ ($.comment "=>")
+ ($.example (format "Line 1" \n
+ "Line 2")))
))
diff --git a/stdlib/source/documentation/lux/data/text/regex.lux b/stdlib/source/documentation/lux/data/text/regex.lux
index 8de3d70e7..cd785ab77 100644
--- a/stdlib/source/documentation/lux/data/text/regex.lux
+++ b/stdlib/source/documentation/lux/data/text/regex.lux
@@ -17,60 +17,72 @@
($.definition /.regex
"Create lexers using regular-expression syntax."
- ["Literals"
- (regex "a")]
- ["Wildcards"
- (regex ".")]
- ["Escaping"
- (regex "\.")]
- ["Character classes"
- (regex "\d")
- (regex "\p{Lower}")
- (regex "[abc]")
- (regex "[a-z]")
- (regex "[a-zA-Z]")
- (regex "[a-z&&[def]]")]
- ["Negation"
- (regex "[^abc]")
- (regex "[^a-z]")
- (regex "[^a-zA-Z]")
- (regex "[a-z&&[^bc]]")
- (regex "[a-z&&[^m-p]]")]
- ["Combinations"
- (regex "aa")
- (regex "a?")
- (regex "a*")
- (regex "a+")]
- ["Specific amounts"
- (regex "a{2}")]
- ["At least"
- (regex "a{1,}")]
- ["At most"
- (regex "a{,1}")]
- ["Between"
- (regex "a{1,2}")]
- ["Groups"
- (regex "a(.)c")
- (regex "a(b+)c")
- (regex "(\d{3})-(\d{3})-(\d{4})")
- (regex "(\d{3})-(?:\d{3})-(\d{4})")
- (regex "(?<code>\d{3})-\k<code>-(\d{4})")
- (regex "(?<code>\d{3})-\k<code>-(\d{4})-\0")
- (regex "(\d{3})-((\d{3})-(\d{4}))")]
- ["Alternation"
- (regex "a|b")
- (regex "a(.)(.)|b(.)(.)")])
+
+ ($.comment "Literals")
+ ($.example (regex "a"))
+
+ ($.comment "Wildcards")
+ ($.example (regex "."))
+
+ ($.comment "Escaping")
+ ($.example (regex "\."))
+
+ ($.comment "Character classes")
+ ($.example (regex "\d"))
+ ($.example (regex "\p{Lower}"))
+ ($.example (regex "[abc]"))
+ ($.example (regex "[a-z]"))
+ ($.example (regex "[a-zA-Z]"))
+ ($.example (regex "[a-z&&[def]]"))
+
+ ($.comment "Negation")
+ ($.example (regex "[^abc]"))
+ ($.example (regex "[^a-z]"))
+ ($.example (regex "[^a-zA-Z]"))
+ ($.example (regex "[a-z&&[^bc]]"))
+ ($.example (regex "[a-z&&[^m-p]]"))
+
+ ($.comment "Combinations")
+ ($.example (regex "aa"))
+ ($.example (regex "a?"))
+ ($.example (regex "a*"))
+ ($.example (regex "a+"))
+
+ ($.comment "Specific amounts")
+ ($.example (regex "a{2}"))
+
+ ($.comment "At least")
+ ($.example (regex "a{1,}"))
+
+ ($.comment "At most")
+ ($.example (regex "a{,1}"))
+
+ ($.comment "Between")
+ ($.example (regex "a{1,2}"))
+
+ ($.comment "Groups")
+ ($.example (regex "a(.)c"))
+ ($.example (regex "a(b+)c"))
+ ($.example (regex "(\d{3})-(\d{3})-(\d{4})"))
+ ($.example (regex "(\d{3})-(?:\d{3})-(\d{4})"))
+ ($.example (regex "(?<code>\d{3})-\k<code>-(\d{4})"))
+ ($.example (regex "(?<code>\d{3})-\k<code>-(\d{4})-\0"))
+ ($.example (regex "(\d{3})-((\d{3})-(\d{4}))"))
+
+ ($.comment "Alternation")
+ ($.example (regex "a|b"))
+ ($.example (regex "a(.)(.)|b(.)(.)")))
($.definition /.pattern
"Allows you to test text against regular expressions."
- [(when some_text
- (pattern "(\d{3})-(\d{3})-(\d{4})"
- [_ country_code area_code place_code])
- do_some_thing_when_number
+ ($.example (when some_text
+ (pattern "(\d{3})-(\d{3})-(\d{4})"
+ [_ country_code area_code place_code])
+ do_some_thing_when_number
- (pattern "\w+")
- do_some_thing_when_word
+ (pattern "\w+")
+ do_some_thing_when_word
- _
- do_something_else)])
+ _
+ do_something_else)))
))
diff --git a/stdlib/source/documentation/lux/data/text/unicode/block.lux b/stdlib/source/documentation/lux/data/text/unicode/block.lux
index 78002e97c..667c66fef 100644
--- a/stdlib/source/documentation/lux/data/text/unicode/block.lux
+++ b/stdlib/source/documentation/lux/data/text/unicode/block.lux
@@ -179,11 +179,11 @@
($.definition /.block
""
- [(block start additional)])
+ ($.example (block start additional)))
($.definition /.within?
""
- [(within? block char)])
+ ($.example (within? block char)))
(all list#composite
all_1/4
diff --git a/stdlib/source/documentation/lux/data/text/unicode/set.lux b/stdlib/source/documentation/lux/data/text/unicode/set.lux
index 68fbb3446..6d75868c5 100644
--- a/stdlib/source/documentation/lux/data/text/unicode/set.lux
+++ b/stdlib/source/documentation/lux/data/text/unicode/set.lux
@@ -31,9 +31,9 @@
($.definition /.set
""
- [(set [head tail])])
+ ($.example (set [head tail])))
($.definition /.member?
""
- [(member? set character)])
+ ($.example (member? set character)))
))