Skip to content

Commit 4a01f97

Browse files
committed
typst PDF: re-add missing images (the remaining)
for #509
1 parent b32efb4 commit 4a01f97

File tree

7 files changed

+59
-8
lines changed

7 files changed

+59
-8
lines changed

STYLEGUIDE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,27 @@ Please exclude them from the EPUB generation with these flags:
6969

7070
We must tweak the markdown links so that internal links work in the
7171
EPUB reader. See `fix-epub-links.sed` to add your link or just ping us on GitHub.
72+
73+
## PDF gotchas
74+
75+
### Images
76+
77+
Now that we transform the markdown sources to Typst to PDF, the HTML
78+
`<img>` tags are not taken care of.
79+
80+
The `![](path/to/image.png)` syntax works fine, however the HTML tag is nice to set CSS attributes such as the `max-width`.
81+
82+
So, to add an image, please do:
83+
84+
```txt
85+
<img src="assets/sockets-lisp-chat.gif"
86+
width="470" height="247" alt="Chat app demo between two browser windows"/>
87+
88+
<!-- pdf-include-start
89+
![](assets/sockets-lisp-chat.gif)
90+
pdf-include-end -->
91+
```
92+
93+
The first IMG works out of the box for the HTML render and the EPUB,
94+
while the second, in-between HTML comments, is always ignored but we
95+
make it present when building the PDF (`make pdf`).

data-structures.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,3 +2313,8 @@ The `access` library given above provides this, with `(accesses var key1 key2…
23132313
<img src="collections.png" alt="Collection Types in Common Lisp"/>
23142314
</div>
23152315
<!-- epub-exclude-end -->
2316+
2317+
2318+
<!-- pdf-include-start
2319+
![](collections.png)
2320+
pdf-include-end -->

emacs-ide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,10 @@ See also [Helpful](https://github.com/Wilfred/helpful), an alternative to the bu
625625

626626
<img src="assets/emacs-helpful.png" style="height: 450px" alt="The Emacs helpful package shows detailed information about a symbol."/>
627627

628+
<!-- pdf-include-start
629+
![](assets/emacs-helpful.png)
630+
pdf-include-end -->
631+
628632

629633
### Built-in tutorial
630634

numbers.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ Some sources:
1111
* [`Numbers, Characters and Strings`][numbers-characters-strings]
1212
in Practical Common Lisp
1313

14-
<!-- epub-exclude-start -->
15-
<div style="text-align: center">
16-
<img src="numbertower.png" alt="Number Types in Common Lisp"/>
17-
</div>
18-
<!-- epub-exclude-end -->
19-
20-
*Types in bold, solid boxes are the ones you will typically use.*
21-
2214
## Introduction
2315

2416
### Integer types
@@ -657,6 +649,20 @@ For example:
657649
Please see the [CLHS page][logand-functions] for a more detailed explanation
658650
or other bit-wise functions.
659651

652+
## Appendix: the number tower
653+
654+
<!-- epub-exclude-start -->
655+
<div style="text-align: center">
656+
<img src="numbertower.png" alt="Number Types in Common Lisp"/>
657+
</div>
658+
<!-- epub-exclude-end -->
659+
660+
<!-- pdf-include-start
661+
![](numbertower.png)
662+
pdf-include-end -->
663+
664+
*Types in bold, solid boxes are the ones you will typically use.*
665+
660666

661667
[numbers]: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node16.html#SECTION00610000000000000000
662668
[numbers-characters-strings]: http://www.gigamonkeys.com/book/numbers-characters-and-strings.html

strings.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,10 @@ _ - Conditional Newline
13171317
<img src="string-and-chars.png" alt="String and Character Types in Common Lisp"/>
13181318
</div>
13191319

1320+
<!-- pdf-include-start
1321+
![](string-and-chars.png)
1322+
pdf-include-end -->
1323+
13201324

13211325
## See also
13221326

web.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,10 @@ Clack users might make a good use of plugins, like the clack-errors middleware:
534534

535535
<img src="assets/clack-errors.png" width="800" alt="The clack-errors plugin shows the error message, a legible backtrace and environment variables."/>
536536

537+
<!-- pdf-include-start
538+
![](assets/clack-errors.png)
539+
pdf-include-end -->
540+
537541
## Weblocks - solving the "JavaScript problem"©
538542

539543
[Weblocks][weblocks] is a widgets-based and

websockets.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ should see your chat app!
220220
<img src="assets/sockets-lisp-chat.gif"
221221
width="470" height="247" alt="Chat app demo between two browser windows"/>
222222

223+
<!-- pdf-include-start
224+
![](assets/sockets-lisp-chat.gif)
225+
pdf-include-end -->
226+
223227
## All The Code
224228

225229
~~~lisp

0 commit comments

Comments
 (0)