diff --git a/doc-generator/markdown/en/stdlib/latest/prelude/String.md b/doc-generator/markdown/en/stdlib/latest/prelude/String.md index f52cd8a..e0383f1 100644 --- a/doc-generator/markdown/en/stdlib/latest/prelude/String.md +++ b/doc-generator/markdown/en/stdlib/latest/prelude/String.md @@ -197,6 +197,45 @@ name.charAt(4)!! //: "o" +### charCodeAt + +```misti +fun charCodeAt(Num position) -> Num? +``` + +Returns an integer between `0` and `65535` representing the UTF-16 +code unit at `position`. + + +
+ +#### Parameters + +- `Num position`: A number between `0` and the string's `length - 1` + +#### Return + +- `Num?`: The code unit at `position` if it's valid, or `None` if it's invalid. + +#### Description + +Description + +#### Examples + +```misti +val letters = "ABC" + +letters.charCodeAt(0) //: Some(65) +letters.charCodeAt(1) //: Some(66) +``` + +
+ + +### codePointAt + + ### concat ```misti @@ -242,6 +281,9 @@ greeting.concat(3, 2, 2) //: "Hello 322" +### endsWith + + ### includes @@ -285,6 +327,91 @@ loremIpsum.includes("ipsum", -5) //: true +### indexOf + +```misti +fun indexOf(Str searchValue, Num position = 0) -> Num +``` + +### lastIndexOf + +fun lastIndexOf(Str searchValue, Num position = Infinity) -> Num + +### match + +```misti +fun match(RegExp pattern) -> RegExpResult +``` + + +### matchAll + +```misti +fun matchAll(RegExp pattern) -> Iterator[RegExpResult] +``` + + +### normalize + +```misti +fun normalize(Str form = "NFC") -> String +``` + + +### padEnd + +```misti +fun padEnd(Num targetLength, Str padValue = " ") -> String +``` + + +### padStart + +```misti +fun padStart(Num targetLength, Str padValue = " ") -> String +``` + +### repeat + +```misti +fun repeat(Num count) -> String +``` + +### replace + +```misti +fun replaceAll([RegExp | Str] pattern, Str replacement) -> String +``` + + +### replaceAll + +```misti +fun replaceAll([RegExp | Str] pattern, Str replacement) -> String +``` + + +### search + +```misti +fun search([RegExp | Str] pattern) -> Num +``` + + +### slice + +```misti +fun slice(Num start, Num? end) -> String +``` + + +### split + +```misti +fun split(Str separator, Num? limit) -> Array +``` + + diff --git a/doc-generator/src/sidebar/mod.rs b/doc-generator/src/sidebar/mod.rs index d987c20..d0699e2 100644 --- a/doc-generator/src/sidebar/mod.rs +++ b/doc-generator/src/sidebar/mod.rs @@ -1,5 +1,3 @@ -use std::fmt::Display; - use markdown::mdast::{Heading, Node}; use crate::{generator::Printable, utils}; @@ -56,7 +54,7 @@ impl Topic { let html_fragment_link = utils::to_html_fragment(&self.text); format!( - "
  • {}{}
  • ", + "
  • {}{}
  • ", html_fragment_link, self.text, extra ) } diff --git a/doc-generator/static/styles/xcode-colors.css b/doc-generator/static/styles/xcode-colors.css index 4b8da28..37c6ca0 100644 --- a/doc-generator/static/styles/xcode-colors.css +++ b/doc-generator/static/styles/xcode-colors.css @@ -56,7 +56,7 @@ pre[class*="language-"] { word-wrap: normal; color: var(--code-theme-color); background: var(--code-theme-bg-color); - font-size: 1em; + font-size: 0.8em; line-height: 1.5em; border-radius: 0.3em; diff --git a/doc-generator/static/template.html b/doc-generator/static/template.html index eab7738..98be20d 100644 --- a/doc-generator/static/template.html +++ b/doc-generator/static/template.html @@ -18,10 +18,10 @@
    -
    +
    {{sidebar}}
    -
    +
    {{markdown}}