Skip to content

Commit 9391a34

Browse files
bors[bot]ChouzArtadamgreen
committed
Merge #142
142: Attempt to fix broken image links in Discovery book r=therealprof a=adamgreen This PR pools together PRs #130 and #131 from @ChouzArt and adds 2 more commits that I created to correct other failing links missed by the first 2 and to modify the Travis verification steps to skip the checking of print.html - @ChouzArt has previously pointed out that rust-lang/mdBook#789 causes mdbook to generate an incorrect print.html file when relative links are used in the book content. Skipping verification of print.html during Travis runs means that we will still have a bad image links in print.html but the main Discovery book pages will have working images again and they will show up here on GitHub as well. I realize that this isn't a perfect solution but I thought that people might find it better than the current situation. The main reason I am creating this PR is to: * See if it will pass Travis. * Get people's feedback on this **half** solution. If we decide to take this PR then there are a few other things that need to be done: * Create a new issue to track the fact that we should revert this ignoring of print.html during link checking once the mdbook issue is resolved. * Make a similar change to the [Bookself version of the Travis script](https://github.com/rust-embedded/bookshelf/blob/master/ci/script.sh). I should also point out that running a `sed` script on print.html can fix most of the link issues that it contains so that the images will at least show up in a printout. Something like: ```console cp book/print.html print.html sed 's: src="\.\./assets/: src="assets/:g' <print.html >book/print.html rm print.html ``` Co-authored-by: Carlos <[email protected]> Co-authored-by: Adam Green <[email protected]>
2 parents e6fa999 + 9a1a7a9 commit 9391a34

File tree

28 files changed

+49
-47
lines changed

28 files changed

+49
-47
lines changed

ci/script.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ main() {
44
# test that building the book works
55
mdbook build
66

7-
linkchecker book
7+
# mdbook doesn't handle relative links correctly in print.html so skip it.
8+
linkchecker --ignore-url "print.html" book
89

910
# now check this as a directory of the bookshelf
1011
rm -rf shelf
1112
mkdir shelf
1213
mv book shelf
13-
linkchecker shelf
14+
# Skipping bad relative link errors in print.html again here.
15+
linkchecker --ignore-url "print.html" shelf
1416

1517
mv shelf/book .
1618
rmdir shelf

src/02-requirements/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Also, to follow this material you'll need the following hardware:
2525
[3]: http://www.ebay.com/sch/i.html?_nkw=stm32f3discovery
2626

2727
<p align="center">
28-
<img title="STM32F3DISCOVERY" src="/assets/f3.jpg">
28+
<img title="STM32F3DISCOVERY" src="../assets/f3.jpg">
2929
</p>
3030

3131
- OPTIONAL. A **3.3V** USB <-> Serial module. [This particular model][sparkfun] will be used
@@ -39,7 +39,7 @@ cheaper for you to get)
3939
[4]: https://www.aliexpress.com/wholesale?SearchText=CH340G
4040

4141
<p align="center">
42-
<img title="A 3.3v USB <-> Serial module" src="/assets/serial.jpg">
42+
<img title="A 3.3v USB <-> Serial module" src="../assets/serial.jpg">
4343
</p>
4444

4545
- OPTIONAL. A HC-05 Bluetooth module (with headers!). A HC-06 would work too.
@@ -51,14 +51,14 @@ cheaper for you to get)
5151
[6]: https://www.aliexpress.com/wholesale?SearchText=hc-05
5252

5353
<p align="center">
54-
<img title="The HC-05 Bluetooth module" src="/assets/bluetooth.jpg">
54+
<img title="The HC-05 Bluetooth module" src="../assets/bluetooth.jpg">
5555
</p>
5656

5757
- Two mini-B USB cables. One is required to make the STM32F3DISCOVERY board work. The other is only
5858
required if you have the Serial <-> USB module.
5959

6060
<p align="center">
61-
<img title="mini-B USB cable" src="/assets/usb-cable.jpg">
61+
<img title="mini-B USB cable" src="../assets/usb-cable.jpg">
6262
</p>
6363

6464
> **NOTE** These are **not** the USB cables that ship with pretty much every Android phone; those
@@ -75,7 +75,7 @@ cheaper for you to get)
7575
[9]: https://www.aliexpress.com/wholesale?SearchText=dupont+wire
7676

7777
<p align="center">
78-
<img title="Jumper wires" src="/assets/jumper-wires.jpg">
78+
<img title="Jumper wires" src="../assets/jumper-wires.jpg">
7979
</p>
8080

8181
> **FAQ**: Wait, why do I need this specific hardware?

src/03-setup/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ LLVM (http://llvm.org/):
109109

110110
Now follow the instructions specific to the OS you are using:
111111

112-
- [Linux](/03-setup/linux.html)
113-
- [Windows](/03-setup/windows.html)
114-
- [macOS](/03-setup/macos.html)
112+
- [Linux](linux.html)
113+
- [Windows](windows.html)
114+
- [macOS](macos.html)

src/03-setup/linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ If you had any board plugged to your laptop, unplug them and then plug them in a
115115

116116
Now, go to the [next section].
117117

118-
[next section]: /03-setup/verify.html
118+
[next section]: verify.md

src/03-setup/macos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Caskroom/tap` first and try again.
1515

1616
That's all! Go to the [next section].
1717

18-
[next section]: /03-setup/verify.html
18+
[next section]: verify.md

src/03-setup/verify.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ crw-rw-rw- 1 root root 189, 20 Sep 13 00:00 /dev/bus/usb/003/004
2929
The permissions should be `crw-rw-rw-`. If it's not ... then check your [udev
3030
rules] and try re-loading them with:
3131

32-
[udev rules]: /03-setup/linux.html#udev%20rules
32+
[udev rules]: linux.md#udev-rules
3333

3434
``` console
3535
$ sudo udevadm control --reload-rules
@@ -104,7 +104,7 @@ Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
104104

105105
(If you don't ... then check the [general troubleshooting] instructions.)
106106

107-
[general troubleshooting]: /appendix/1-general-troubleshooting/README.html
107+
[general troubleshooting]: ../appendix/1-general-troubleshooting/index.html
108108

109109
`openocd` will block the terminal. That's fine.
110110

src/03-setup/windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ instructions and make sure you install the right (32-bit or 64-bit) version of t
4747

4848
That's all! Go to the [next section].
4949

50-
[next section]: /03-setup/verify.html
50+
[next section]: verify.md

src/04-meet-your-hardware/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Let's get familiar with the hardware we'll be working with.
55
## STM32F3DISCOVERY (the "F3")
66

77
<p align="center">
8-
<img title="F3" src="/assets/f3.jpg">
8+
<img title="F3" src="../assets/f3.jpg">
99
</p>
1010

1111
We'll refer to this board as "F3" throughout this book.
@@ -46,7 +46,7 @@ What does this board contain?
4646
## The Serial module
4747

4848
<p align="center">
49-
<img title="Serial module" src="/assets/serial.jpg">
49+
<img title="Serial module" src="../assets/serial.jpg">
5050
</p>
5151

5252
We'll use this module to exchange data between the microcontroller in the F3 and your laptop. This
@@ -55,7 +55,7 @@ module will be connected to your laptop using an USB cable. I won't say more at
5555
## The Bluetooth module
5656

5757
<p align="center">
58-
<img title="The HC-05 Bluetooth module" src="/assets/bluetooth.jpg">
58+
<img title="The HC-05 Bluetooth module" src="../assets/bluetooth.jpg">
5959
</p>
6060

6161
This module has the exact same purpose as the serial module but it sends the data over Bluetooth

src/05-led-roulette/debug-it.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mode, on the GDB shell enter the following command:
3939
> **NOTE** Apologies Windows users. The GDB shipped with the GNU ARM Embedded Toolchain doesn't
4040
> support this TUI mode `:-(`.
4141
42-
![GDB session](/assets/gdb-layout-src.png "GDB TUI")
42+
![GDB session](../assets/gdb-layout-src.png "GDB TUI")
4343

4444
At any point you can leave the TUI mode using the following command:
4545

@@ -118,7 +118,7 @@ source code view later by issuing the `layout src` command again.
118118
(gdb) layout asm
119119
```
120120

121-
![GDB session](/assets/gdb-layout-asm.png "GDB disassemble")
121+
![GDB session](../assets/gdb-layout-asm.png "GDB disassemble")
122122

123123
If you are not using the TUI mode, you can use the `disassemble /m` command to disassemble the
124124
program around the line you are currently at.

src/05-led-roulette/flash-it.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $ openocd \
2929
> **NOTE** Older revisions of the board need to pass slightly different arguments to
3030
> `openocd`. Review [this section] for the details.
3131
32-
[this section]: /03-setup/verify.html#First%20OpenOCD%20connection
32+
[this section]: ../03-setup/verify.md#first-openocd-connection
3333

3434
The program will block; leave that terminal open.
3535

@@ -44,7 +44,7 @@ and debug a microcontroller. The ST-LINK is connected to the "USB ST-LINK" port
4444
a USB device when you connect the F3 to your laptop.
4545

4646
<p align="center">
47-
<img height=640 title="On-board ST-LINK" src="/assets/st-link.png">
47+
<img height=640 title="On-board ST-LINK" src="../assets/st-link.png">
4848
</p>
4949

5050

0 commit comments

Comments
 (0)