summaryrefslogtreecommitdiff
path: root/doc/context/sources
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-03-22 19:57:53 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-03-22 19:57:53 +0100
commit5c46359f4fa543e24e5d4a0a327d41bf8a9ff7c8 (patch)
tree79fc6a0e161820ebb16a8830572868dcd0e1aae2 /doc/context/sources
parentf47b4939787074397c9ea37c1d892a1f7ccc7290 (diff)
downloadcontext-5c46359f4fa543e24e5d4a0a327d41bf8a9ff7c8.tar.gz
2018-03-22 19:49:00
Diffstat (limited to 'doc/context/sources')
-rw-r--r--doc/context/sources/general/manuals/languages/languages-sorting.tex59
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/languages/languages-sorting.tex b/doc/context/sources/general/manuals/languages/languages-sorting.tex
index ce24f385c..b090cd3c5 100644
--- a/doc/context/sources/general/manuals/languages/languages-sorting.tex
+++ b/doc/context/sources/general/manuals/languages/languages-sorting.tex
@@ -230,6 +230,65 @@ This three entry index\jindex{ぱあ}\jindex{ぱー}\jindex{ぱぁ} should be so
% ぱー $\prec$ ぱぁ $\prec$ ぱあ
+\startsection[title=Special usage]
+
+The following example demonstrates how you can trick the sorter into doing other
+things: \footnote {The \type {replacementlist} helper is the result of a request
+by John Grasty on the mailing list.}
+
+\startbuffer
+\startluacode
+ local list = {
+ -- old testament
+ "Genesis", "Exodus", "Leviticus", "Numbers", "Deuteronomy", "Joshua",
+ "Judges", "Ruth", "1 Samuel", "2 Samuel", "1 Kings", "2 Kings",
+ "1 Chronicles", "2 Chronicles", "Ezra", "Nehemiah", "Esther", "Job",
+ "Psalms", "Proverbs", "Ecclesiastes", "Canticles", "Isaiah", "Jeremiah",
+ "Lamentations", "Ezekiel", "Daniel", "Hosea", "Joel", "Amos", "Obadiah",
+ "Jonah", "Micah", "Nahum", "Habakkuk", "Zephaniah", "Haggai",
+ "Zechariah", "Malachi",
+ -- new testament
+ "Matthew", "Mark", "Luke", "John", "Acts", "Romans", "1 Corinthians",
+ "2 Corinthians", "Galatians", "Ephesians", "Philippians", "Colossians",
+ "1 Thessalonians", "2 Thessalonians", "1 Timothy", "2 Timothy", "Titus",
+ "Philemon", "Hebrews", "James", "1 Peter", "2 Peter", "1 John", "2 John",
+ "3 John", "Jude", "Revelation",
+ }
+
+ sorters.definitions["bible"] = {
+ replacements = sorters.replacementlist(list),
+ }
+\stopluacode
+
+\defineregister
+ [booksort]
+ [language=bible,
+ n=1,
+ indicator=no]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+We use this as follows:
+
+\startbuffer
+One \booksort{Genesis+5.2}
+Two \booksort{Exodus+2}
+Three \booksort{Genesis+45}
+Four \booksort{Philemon+2}
+Five \booksort{John+45}
+Six \booksort{1 John 1+45}
+Seven \booksort{2 John 2+45}
+
+\placeregister
+ [booksort]
+ [language=bible]
+\stopbuffer
+
+\stoptext
+
+\stopsection
+
\stopchapter
\stopcomponent