diff --git a/content/_code-samples/require-destination-tags/README.md b/content/_code-samples/require-destination-tags/README.md index c861775ade..00c4ae3224 100644 --- a/content/_code-samples/require-destination-tags/README.md +++ b/content/_code-samples/require-destination-tags/README.md @@ -1,5 +1,5 @@ # Require Destination Tags -Require incoming payments to your account to specify a [Destination Tag](https://xrpl.org/source-and-destination-tags.html) so you know whom to credit. +Require incoming payments to specify a [Destination Tag](https://xrpl.org/source-and-destination-tags.html) so you know whom to credit. Examples from the [Require Destination Tags tutorial](https://xrpl.org/require-destination-tags.html). diff --git a/template/page-code-samples.html.jinja b/template/page-code-samples.html.jinja index 58e6e3948a..c2bfb486c3 100644 --- a/template/page-code-samples.html.jinja +++ b/template/page-code-samples.html.jinja @@ -23,7 +23,6 @@
-
{% trans %}Explore Code Samples{% endtrans %}

{% trans %}Browse sample code for building common use cases on the XRP Ledger{% endtrans %}

diff --git a/tool/filter_code_samples.py b/tool/filter_code_samples.py index 4e2a9f3ccc..9ccf41e4a7 100644 --- a/tool/filter_code_samples.py +++ b/tool/filter_code_samples.py @@ -35,7 +35,15 @@ def to_title_case(s): # def all_langs(): langs = [] - + +def sortfunc(cs): + """ + Sort code samples alphabetically by title except with "Intro" fields first + """ + if "Intro" in cs["title"] or "Quickstart" in cs["title"]: + return " "+cs["title"] + else: + return cs["title"] def all_code_samples(): cses = [] @@ -56,9 +64,9 @@ def all_code_samples(): "langs": sorted(list(set(["http" if d in ("websocket", "json-rpc") else d for d in dirnames]))), } - # add unique names to list for sorting. - for d in dirnames: - lang = "http" if d in ("websocket", "json-rpc") else d + # add unique names to list for sorting. + for d in dirnames: + lang = "http" if d in ("websocket", "json-rpc") else d if lang not in langs: langs.append(lang) @@ -84,8 +92,7 @@ def all_code_samples(): cs["href"] = dirpath cses.append(cs) - # Current sort value: alphabetical by title. - return sorted(cses, key=lambda x: x["title"]) + return sorted(cses, key=sortfunc) export = { "all_code_samples": all_code_samples,