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 <gsolracchz@gmail.com> Co-authored-by: Adam Green <adamgreen@users.noreply.github.com>
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

src/05-led-roulette/the-challenge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Here's the GIF again:
1212
Also, this may help:
1313

1414
<p align="center">
15-
<img src="/assets/timing-diagram.png">
15+
<img src="../assets/timing-diagram.png">
1616
</p>
1717

1818
This is a timing diagram. It indicates which LED is on at any given instant of time and for how long

src/06-hello-world/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[User Manual]: http://www.st.com/resource/en/user_manual/dm00063382.pdf
1111

1212
<p align="center">
13-
<img height=640 title="Manual SWD connection" src="/assets/f3-swd.png">
13+
<img height=640 title="Manual SWD connection" src="../assets/f3-swd.png">
1414
</p>
1515

1616
---
@@ -46,7 +46,7 @@ To retrieve the original string, OpenOCD's output file will have to be parsed. W
4646

4747
You should have already installed the `itmdump` program during the [installation chapter].
4848

49-
[installation chapter]: /03-setup/README.html#itmdump
49+
[installation chapter]: ../03-setup/index.html#itmdump
5050

5151
In a new terminal, run this command inside the `/tmp` directory, if you are using a *nix OS, or from
5252
within the `%TEMP%` directory, if you are running Windows. This should be the same directory from

src/10-serial-communication/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ will see the microcontroller as a virtual serial device.
4747
Now, let's get familiar with the serial module and the serial communication tools that your OS
4848
offers. Pick a route:
4949

50-
- [*nix](/10-serial-communication/nix-tooling.html)
51-
- [Windows](/10-serial-communication/windows-tooling.html)
50+
- [*nix](nix-tooling.md)
51+
- [Windows](windows-tooling.md)

src/10-serial-communication/loopbacks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ can send us some data ... or is there?
66
Enter: loopbacks
77

88
<p align="center">
9-
<img title="Serial module loopback" src="/assets/serial-loopback.png">
9+
<img title="Serial module loopback" src="../assets/serial-loopback.png">
1010
</p>
1111

1212
You can send data to yourself! Not very useful in production but very useful for debugging.

src/10-serial-communication/nix-tooling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ This tells `minicom` to open the serial device at `/dev/ttyUSB0` and set its bau
6767
A text-based user interface (TUI) will pop out.
6868

6969
<p align="center">
70-
<img height="480" title="minicom" src="/assets/minicom.png">
70+
<img height="480" title="minicom" src="../assets/minicom.png">
7171
</p>
7272

7373
You can now send data using the keyboard! Go ahead and type something. Note that the TUI *won't*

src/10-serial-communication/windows-tooling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on the list. That's the COM port assigned to the serial module.
1616
Now launch `putty`. A GUI will pop out.
1717

1818
<p align="center">
19-
<img title="PuTTY settings" src="/assets/putty-settings.png">
19+
<img title="PuTTY settings" src="../assets/putty-settings.png">
2020
</p>
2121

2222
On the starter screen, which should have the "Session" category open, pick "Serial" as the
@@ -35,7 +35,7 @@ that the serial port is configured as follows:
3535
Finally, click the Open button. A console will show up now:
3636

3737
<p align="center">
38-
<img title="PuTTY console" src="/assets/putty-console.png">
38+
<img title="PuTTY console" src="../assets/putty-console.png">
3939
</p>
4040

4141
If you type on this console, the TX (red) LED on the Serial module should blink. Each key stroke

src/11-usart/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ microcontroller's TX pin to the serial module's RX pin and the micro's RX pin to
2626
TX pin. The wiring diagram below shows all the necessary connections.
2727

2828
<p align="center">
29-
<img height=640 title="F3 <-> Serial connection" src="/assets/f3-serial.png">
29+
<img height=640 title="F3 <-> Serial connection" src="../assets/f3-serial.png">
3030
</p>
3131

3232
These are the recommended steps to connect the microcontroller and the serial module:

src/12-bluetooth-setup/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The first thing we'll need to do is: turn on the Bluetooth module. We'll have to
1111
F3 power to it using the following connection:
1212

1313
<p align="center">
14-
<img height=640 title="F3 <-> Bluetooth connection (power only)" src="/assets/f3-bluetooth-power-only.png">
14+
<img height=640 title="F3 <-> Bluetooth connection (power only)" src="../assets/f3-bluetooth-power-only.png">
1515
</p>
1616

1717
The recommend steps to wire this up are:
@@ -33,4 +33,4 @@ is 1234.
3333

3434
Linux users will have to follow (some of) [these instructions].
3535

36-
[these instructions]: /12-bluetooth-setup/linux.html
36+
[these instructions]: linux.md

src/12-bluetooth-setup/at-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> **NOTE** incomplete
44
55
<p align="center">
6-
<img height=640 title="Bluetooth <-> Serial connection" src="/assets/bluetooth-serial.png">
6+
<img height=640 title="Bluetooth <-> Serial connection" src="../assets/bluetooth-serial.png">
77
</p>
88

99
Entering AT mode:

src/12-bluetooth-setup/linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
If you have a graphical Bluetooth manager, you can use that to pair your laptop to the Bluetooth
44
module and skip most of these steps. You'll probably still have to [this step] though.
55

6-
[this step]: /12-bluetooth-setup/linux.html#rfcomm%20device
6+
[this step]: #rfcomm-device
77

88
## Power up
99

src/12-bluetooth-setup/loopback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ indicators for the transmission and reception events like the serial module did,
99
module using a loopback connection:
1010

1111
<p align="center">
12-
<img height=640 title="F3 <-> Bluetooth connection (loopback)" src="/assets/f3-bluetooth-loopback.png">
12+
<img height=640 title="F3 <-> Bluetooth connection (loopback)" src="../assets/f3-bluetooth-loopback.png">
1313
</p>
1414

1515
Just connect the module's TXD pin to its RXD pin using a F/F wire.

src/13-serial-over-bluetooth/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Now that we verify that the Bluetooth module works with minicom/PuTTY, let's con
44
microcontroller:
55

66
<p align="center">
7-
<img height=640 title="F3 <-> Bluetooth connection" src="/assets/f3-bluetooth.png">
7+
<img height=640 title="F3 <-> Bluetooth connection" src="../assets/f3-bluetooth.png">
88
</p>
99

1010
Recommended steps to wire this up:
@@ -22,4 +22,4 @@ Recommended steps to wire this up:
2222
And that's it! You should be able to run all the programs you wrote in [section 11] without
2323
modification! Just make sure you open the right serial device / COM port.
2424

25-
[section 11]: /11-usart/README.html
25+
[section 11]: ../11-usart/index.html

src/15-led-compass/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ but it reports back the *decomposition* of said field along *its axes*.
1111
See below, the magnetometer has three axes associated to it.
1212

1313
<p align="center">
14-
<img height=480 title="Magnetometer axes" src="/assets/f3-lsm303dlhc.png">
14+
<img height=480 title="Magnetometer axes" src="../assets/f3-lsm303dlhc.png">
1515
</p>
1616

1717
Only the X and Y axes are shown above. The Z axis is pointing "out" of your screen.

src/15-led-compass/calibration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ plt.close
101101
```
102102

103103
<p align="center">
104-
<img title="Earth's magnetic field" src="/assets/emf.svg">
104+
<img title="Earth's magnetic field" src="../assets/emf.svg">
105105
</p>
106106

107107
If you rotated the board on a flat horizontal surface, the Z component of the magnetic field should

src/15-led-compass/take-1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For example, what LED would you turn on in the following case. EMF stands for Ea
99
and green arrow has the direction of the EMF (it points north).
1010

1111
<p align="center">
12-
<img title="Quadrant I" src="/assets/quadrant-i.png">
12+
<img title="Quadrant I" src="../assets/quadrant-i.png">
1313
</p
1414
1515
The `Southeast` LED, right?
@@ -21,7 +21,7 @@ If we only looked at the signs of the X and Y components we could determine to w
2121
magnetic field belongs to.
2222
2323
<p align="center">
24-
<img title="Quadrants" src="/assets/quadrants.png">
24+
<img title="Quadrants" src="../assets/quadrants.png">
2525
</p>
2626

2727
In the previous example, the magnetic field was in the first quadrant (x and y were positive) and it

src/16-punch-o-meter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ can also be accessed using the I2C bus. It also has the same coordinate system a
1111
Here's the coordinate system again:
1212

1313
<p align="center">
14-
<img height=480 title="Magnetometer axes" src="/assets/f3-lsm303dlhc.png">
14+
<img height=480 title="Magnetometer axes" src="../assets/f3-lsm303dlhc.png">
1515
</p>
1616

1717
Just like in the previous unit, we'll be using a high level API to directly get the sensor readings

src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ includes the list of [Frequently Asked Questions].
7070

7171
<p align="center">
7272
<a href="http://integer32.com/">
73-
<img style="width: 50%" title="integer 32" src="/assets/integer32.svg">
73+
<img style="width: 50%" title="integer 32" src="assets/integer32.svg">
7474
</a>
7575
</p>
7676

src/appendix/1-general-troubleshooting/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ in procedure 'ocd_bouncer'
2727
- Windows: You are probably missing the ST-LINK USB driver. Installation
2828
instructions [here].
2929

30-
[these instructions]: /03-setup/linux.html#udev%20rules
31-
[here]: /03-setup/windows.html#ST-LINK%20USB%20driver
30+
[these instructions]: ../../03-setup/linux.md#udev-rules
31+
[here]: ../../03-setup/windows.md#st-link-usb-driver
3232

3333
### can't connect to OpenOCD - "Polling again in X00ms"
3434

0 commit comments

Comments
 (0)