Skip to content

Commit b8caffb

Browse files
authored
Update name in screenshot markers (#63)
The iBooks Store was renamed several years ago -- the comment markers should follow the current name. When we're able to publish an ePUB version again[1], we probably want to retake all of the screenshots. We can update the value of COMMIT in the script at that time, to help us after that so we can find and retake only things that change. Fixes rdar://101972172 1: #2
2 parents 46dbe1e + e79dbc5 commit b8caffb

File tree

6 files changed

+51
-30
lines changed

6 files changed

+51
-30
lines changed

Sources/TSPL/TSPL.docc/GuidedTour/GuidedTour.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ occupations["Jayne"] = "Public Relations"
263263
```
264264
-->
265265

266-
<!--
267-
iBooks Store screenshot begins here.
268-
-->
266+
<!-- Apple Books screenshot begins here. -->
269267

270268
Arrays automatically grow as you add elements.
271269

@@ -390,9 +388,7 @@ or contains `nil` to indicate that a value is missing.
390388
Write a question mark (`?`) after the type of a value
391389
to mark the value as optional.
392390

393-
<!--
394-
iBooks Store screenshot ends here.
395-
-->
391+
<!-- Apple Books screenshot ends here. -->
396392

397393
<!--
398394
REFERENCE

Sources/TSPL/TSPL.docc/LanguageGuide/AdvancedOperators.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ which has its first four bits set to `0`,
7272
and its second four bits set to `1`.
7373
This is equivalent to a decimal value of `15`.
7474

75-
<!--
76-
iBooks Store screenshot begins here.
77-
-->
75+
<!-- Apple Books screenshot begins here. -->
7876

7977
The bitwise NOT operator is then used to create a new constant called `invertedBits`,
8078
which is equal to `initialBits`,
@@ -122,9 +120,7 @@ if the bits are equal to `1` in *either* input number:
122120

123121
![](bitwiseOR)
124122

125-
<!--
126-
iBooks Store screenshot ends here.
127-
-->
123+
<!-- Apple Books screenshot ends here. -->
128124

129125
In the example below,
130126
the values of `someBits` and `moreBits` have different bits set to `1`.

Sources/TSPL/TSPL.docc/LanguageGuide/ControlFlow.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,7 @@ while <#condition#> {
308308
This example plays a simple game of *Snakes and Ladders*
309309
(also known as *Chutes and Ladders*):
310310

311-
<!--
312-
iBooks Store screenshot begins here.
313-
-->
311+
<!-- Apple Books screenshot begins here. -->
314312

315313
![](snakesAndLadders)
316314

@@ -364,9 +362,7 @@ board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08
364362
```
365363
-->
366364

367-
<!--
368-
iBooks Store screenshot ends here.
369-
-->
365+
<!-- Apple Books screenshot ends here. -->
370366

371367
Square 3 contains the bottom of a ladder that moves you up to square 11.
372368
To represent this, `board[03]` is equal to `+08`,

Sources/TSPL/TSPL.docc/LanguageGuide/Properties.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,7 @@ Setting the `center` property calls the setter for `center`,
431431
which modifies the `x` and `y` values of the stored `origin` property,
432432
and moves the square to its new position.
433433

434-
<!--
435-
iBooks Store screenshot begins here.
436-
-->
434+
<!-- Apple Books screenshot begins here. -->
437435

438436
![](computedProperties)
439437

@@ -484,9 +482,7 @@ struct AlternativeRect {
484482
```
485483
-->
486484

487-
<!--
488-
iBooks Store screenshot ends here.
489-
-->
485+
<!-- Apple Books screenshot ends here. -->
490486

491487
### Shorthand Getter Declaration
492488

Sources/TSPL/TSPL.docc/ReferenceManual/Expressions.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,7 @@ struct Point {
875875
```
876876
-->
877877

878-
<!--
879-
iBooks Store screenshot begins here.
880-
-->
878+
<!-- Apple Books screenshot begins here. -->
881879

882880
> Grammar of a self expression:
883881
>
@@ -960,9 +958,7 @@ it's understood to be asynchronous.
960958
There are several special forms
961959
that allow closures to be written more concisely:
962960

963-
<!--
964-
iBooks Store screenshot ends here.
965-
-->
961+
<!-- Apple Books screenshot ends here. -->
966962

967963
- A closure can omit the types
968964
of its parameters, its return type, or both.

bin/find_screenshot_changes

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#! /usr/bin/env zsh
2+
3+
setopt ERR_EXIT NO_UNSET PIPE_FAIL
4+
5+
# This script helps identify changes that show up in screenshots.
6+
#
7+
# Set $COMMIT to the oldest commit this script should consider:
8+
# ideally, that's the commit when the current screenshots were taken.
9+
#
10+
# Lines in the output that start with whitespace are unchanged since $COMMIT.
11+
# Lines that start with a commit ID were changed in that commit, after $COMMIT.
12+
#
13+
# To check whether we need to re-shoot the screenshots,
14+
# run this script and check whether any lines start with commit IDs.
15+
# For example:
16+
#
17+
# ./bin/find_screenshot_changes.zsh | grep -v '^ '
18+
#
19+
# To show those commits that made scheenshot changes:
20+
#
21+
# ./bin/find_screenshot_changes.zsh |
22+
# cut -d ' ' -f 1 |
23+
# sort -u |
24+
# xargs -L1 git --no-pager log -1
25+
26+
BEGIN='<!-- Apple Books screenshot begins here -->'
27+
END='<!-- Apple Books screenshot ends here -->'
28+
29+
# The commit when these comment markers were originally added.
30+
# COMMIT=64627a260ed600015dbad1a853d8b85f611b61d4
31+
32+
# The commit when the content was converted from RST to markdown.
33+
COMMIT=96f0925407c6bd9eadd9d58d253bad3e1ef7a9f2
34+
35+
cd Sources/TSPL/TSPL.docc
36+
git grep --files-with-matches $BEGIN | while IFS= read -r FILE
37+
do
38+
git --no-pager blame -bs $COMMIT.. -L /$BEGIN/,/$END/ $FILE
39+
echo
40+
echo
41+
done

0 commit comments

Comments
 (0)