Skip to content

Commit 36493ee

Browse files
authored
Use backticks around PS code in docs (#148)
* Use backticks around PS code in docs * Add change to CHANGELOG.md
1 parent 157e372 commit 36493ee

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ New features:
1111
Bugfixes:
1212

1313
Other improvements:
14+
- Surround code with backticks in documentation (#148)
1415

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

src/Data/String/CodePoints.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import Data.String.Unsafe as Unsafe
4242
import Data.Tuple (Tuple(..))
4343
import Data.Unfoldable (unfoldr)
4444

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

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

70-
-- | Creates a CodePoint from a given Char.
70+
-- | Creates a `CodePoint` from a given `Char`.
7171
-- |
7272
-- | ```purescript
7373
-- | >>> codePointFromChar 'B'
@@ -178,7 +178,7 @@ codePointAtFallback n s = case uncons s of
178178
_ -> Nothing
179179

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

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

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

274274
-- | Returns the number of code points preceding the last match of the given
275-
-- | pattern in the string. Returns Nothing when no matches are found.
275+
-- | pattern in the string. Returns `Nothing` when no matches are found.
276276
-- |
277277
-- | ```purescript
278278
-- | >>> lastIndexOf (Pattern "𝐀") "b 𝐀𝐀 c 𝐀"
@@ -292,7 +292,7 @@ lastIndexOf p s = (\i -> length (CU.take i s)) <$> CU.lastIndexOf p s
292292
-- | greater than the number of code points in the string is equivalent to
293293
-- | searching in the whole string.
294294
-- |
295-
-- | Returns Nothing when no matches are found.
295+
-- | Returns `Nothing` when no matches are found.
296296
-- |
297297
-- | ```purescript
298298
-- | >>> lastIndexOf' (Pattern "𝐀") (-1) "b 𝐀𝐀 c 𝐀"

src/Data/String/CodeUnits.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import Data.String.Unsafe as U
3737
-------------------------------------------------------------------------------
3838

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

0 commit comments

Comments
 (0)