Skip to content

Commit

Permalink
Use backticks around PS code in docs (#148)
Browse files Browse the repository at this point in the history
* Use backticks around PS code in docs

* Add change to CHANGELOG.md
  • Loading branch information
triallax authored Apr 22, 2021
1 parent 157e372 commit 36493ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ New features:
Bugfixes:

Other improvements:
- Surround code with backticks in documentation (#148)

## [v5.0.0](https://github.com/purescript/purescript-strings/releases/tag/v5.0.0) - 2021-02-26

Expand Down
14 changes: 7 additions & 7 deletions src/Data/String/CodePoints.purs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Data.String.Unsafe as Unsafe
import Data.Tuple (Tuple(..))
import Data.Unfoldable (unfoldr)

-- | CodePoint is an Int bounded between 0 and 0x10FFFF, corresponding to
-- | CodePoint is an `Int` bounded between `0` and `0x10FFFF`, corresponding to
-- | Unicode code points.
newtype CodePoint = CodePoint Int

Expand All @@ -67,7 +67,7 @@ instance boundedEnumCodePoint :: BoundedEnum CodePoint where
| n >= 0 && n <= 0x10FFFF = Just (CodePoint n)
| otherwise = Nothing

-- | Creates a CodePoint from a given Char.
-- | Creates a `CodePoint` from a given `Char`.
-- |
-- | ```purescript
-- | >>> codePointFromChar 'B'
Expand Down Expand Up @@ -178,7 +178,7 @@ codePointAtFallback n s = case uncons s of
_ -> Nothing

-- | Returns a record with the first code point and the remaining code points
-- | of the string. Returns Nothing if the string is empty. Operates in
-- | of the string. Returns `Nothing` if the string is empty. Operates in
-- | constant space and time.
-- |
-- | ```purescript
Expand Down Expand Up @@ -243,7 +243,7 @@ countTail p s accum = case uncons s of
_ -> accum

-- | Returns the number of code points preceding the first match of the given
-- | pattern in the string. Returns Nothing when no matches are found.
-- | pattern in the string. Returns `Nothing` when no matches are found.
-- |
-- | ```purescript
-- | >>> indexOf (Pattern "𝐀") "b 𝐀𝐀 c 𝐀"
Expand All @@ -257,7 +257,7 @@ indexOf p s = (\i -> length (CU.take i s)) <$> CU.indexOf p s

-- | Returns the number of code points preceding the first match of the given
-- | pattern in the string. Pattern matches preceding the given index will be
-- | ignored. Returns Nothing when no matches are found.
-- | ignored. Returns `Nothing` when no matches are found.
-- |
-- | ```purescript
-- | >>> indexOf' (Pattern "𝐀") 4 "b 𝐀𝐀 c 𝐀"
Expand All @@ -272,7 +272,7 @@ indexOf' p i s =
(\k -> i + length (CU.take k s')) <$> CU.indexOf p s'

-- | Returns the number of code points preceding the last match of the given
-- | pattern in the string. Returns Nothing when no matches are found.
-- | pattern in the string. Returns `Nothing` when no matches are found.
-- |
-- | ```purescript
-- | >>> lastIndexOf (Pattern "𝐀") "b 𝐀𝐀 c 𝐀"
Expand All @@ -292,7 +292,7 @@ lastIndexOf p s = (\i -> length (CU.take i s)) <$> CU.lastIndexOf p s
-- | greater than the number of code points in the string is equivalent to
-- | searching in the whole string.
-- |
-- | Returns Nothing when no matches are found.
-- | Returns `Nothing` when no matches are found.
-- |
-- | ```purescript
-- | >>> lastIndexOf' (Pattern "𝐀") (-1) "b 𝐀𝐀 c 𝐀"
Expand Down
2 changes: 1 addition & 1 deletion src/Data/String/CodeUnits.purs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import Data.String.Unsafe as U
-------------------------------------------------------------------------------

-- | If the string starts with the given prefix, return the portion of the
-- | string left after removing it, as a Just value. Otherwise, return Nothing.
-- | string left after removing it, as a `Just` value. Otherwise, return `Nothing`.
-- |
-- | ```purescript
-- | stripPrefix (Pattern "http:") "http://purescript.org" == Just "//purescript.org"
Expand Down

0 comments on commit 36493ee

Please sign in to comment.