From c15a1dde22a41c3c2c153786bbac48583449544c Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 23 Oct 2022 13:19:46 -0400 Subject: [PATCH 1/6] Restyle search key shortcut --- crates/docs/src/static/index.html | 2 +- crates/docs/src/static/styles.css | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/crates/docs/src/static/index.html b/crates/docs/src/static/index.html index d36961ff87..13ac9f422a 100644 --- a/crates/docs/src/static/index.html +++ b/crates/docs/src/static/index.html @@ -15,7 +15,7 @@ !
Tip: Some names differ from other languages.
!' {} \; echo 'Generating CLI example platform docs...' # Change ROC_DOCS_ROOT_DIR=builtins so that links will be generated relative to From 8d48923607627cc21653b88414c97350637afcfe Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 23 Oct 2022 18:07:39 -0400 Subject: [PATCH 4/6] Add different-names html --- www/public/different-names/index.html | 140 ++++++++++++++++++++++++++ www/public/homepage.css | 26 +++++ 2 files changed, 166 insertions(+) create mode 100644 www/public/different-names/index.html diff --git a/www/public/different-names/index.html b/www/public/different-names/index.html new file mode 100644 index 0000000000..812623c9aa --- /dev/null +++ b/www/public/different-names/index.html @@ -0,0 +1,140 @@ + + + + + + + + Different Names in Roc + + + + + + + +

Different Names

+

Different programming languages sometimes choose different names for similar operations. + If you're new to Roc, you may be searching for a familiar operation and not find it because + that operation (or a similar one) goes by a different name in Roc. +

+ +

To help with this, here are some Roc operations along with some names found in other languages + for similar operations. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Roc NameOther Names
List.walk +
    +
  • fold
  • +
  • foldl
  • +
  • foldLeft
  • +
  • fold_left
  • +
  • fold-left
  • +
  • reduce
  • +
  • lreduce
  • +
  • array_reduce
  • +
  • inject
  • +
  • accumulate
  • +
  • Aggregate
  • +
+
List.walkBackwards +
    +
  • foldr
  • +
  • foldRight
  • +
  • fold_right
  • +
  • fold-right
  • +
  • reduceRight
  • +
  • rreduce
  • +
+
List.first +
    +
  • head
  • +
  • get(0)
  • +
  • [0]
  • +
+
List.keepIf +
    +
  • filter
  • +
  • select
  • +
  • copy_if
  • +
  • remove-if-not
  • +
+
List.dropIf +
    +
  • reject
  • +
  • remove_copy_if
  • +
  • remove-if
  • +
+
List.join +
    +
  • flatten
  • +
  • flat
  • +
  • concat
  • +
  • smoosh
  • +
+
List.joinMap +
    +
  • filterMap
  • +
  • filter_map
  • +
+
List.keepOks +
    +
  • compact
  • +
  • filterMap(identity)
  • +
+
Result.try +
    +
  • bind
  • +
  • flatMap
  • +
  • andThen
  • +
  • (>>=)
  • +
+
+ + + diff --git a/www/public/homepage.css b/www/public/homepage.css index c251974bc0..57700c1fa4 100644 --- a/www/public/homepage.css +++ b/www/public/homepage.css @@ -12,4 +12,30 @@ li { width: 900px; margin: 24px auto; } +} + +/* Used on on the different-names page. */ + +th, td { + text-align: left; + padding-right: 24px; +} + +#different-names-body a, #different-names-body li { + font-family: monospace; + font-size: 16px; +} + +#different-names-body li { + display: inline; +} + +#different-names-body li:not(:last-of-type)::after { + /* This is injected via CSS for accessibility, so to a screen reader it's a normal
  • */ + content: ","; +} + +#different-names-body ul { + padding: 0; + list-style-type: none; } \ No newline at end of file From c36393bdeccee04af569b1e05cde81a849bbca61 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 23 Oct 2022 18:17:05 -0400 Subject: [PATCH 5/6] Drop unused CSS declaration --- www/public/styles.css | 1 - 1 file changed, 1 deletion(-) diff --git a/www/public/styles.css b/www/public/styles.css index 3d1a47ec35..48393b720f 100644 --- a/www/public/styles.css +++ b/www/public/styles.css @@ -7,7 +7,6 @@ --body-bg-color: #fdfdfd; --border-color: #e9e9e9; --faded-color: #4c4c4c; - --monospace-font; --font-sans: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif; --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; --top-header-height: 67px; From 7737aac8103b16f3d6d32af2213b8b474427fe84 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 23 Oct 2022 21:10:35 -0400 Subject: [PATCH 6/6] Drop the trailing "/" in docs sidebar links --- crates/docs/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/docs/src/lib.rs b/crates/docs/src/lib.rs index 54f76e904a..2c0ec4f6e7 100644 --- a/crates/docs/src/lib.rs +++ b/crates/docs/src/lib.rs @@ -138,8 +138,7 @@ pub fn generate_docs_html(filenames: Vec) { } fn sidebar_link_url(module: &ModuleDocumentation) -> String { - let url = format!("{}{}/", base_url(), module.name.as_str()); - url + format!("{}{}", base_url(), module.name.as_str()) } fn page_title(package: &Documentation, module: &ModuleDocumentation) -> String {