Commit graph

2239 commits

Author Message Date
Wen Kokke
5728f68076 Install packages to lua_modules/, add to path if found. 2020-07-02 15:46:48 +01:00
Wen Kokke
0b4df68fba Added EPUB build to Travis 2020-07-02 13:40:12 +01:00
Wen Kokke
95b976ed1b Minor fix. 2020-07-02 13:33:54 +01:00
Wen Kokke
2f8418a8c2 Luarocks install local 2020-07-02 13:14:07 +01:00
Wen Kokke
6edc6e5b85 Fix #487 2020-07-02 13:06:24 +01:00
Wen Kokke
ce40f1d96f Updated EPUB instructions in README. 2020-07-02 13:04:58 +01:00
Wen Kokke
c76940cbb5 Moved generated acknowledgements to out/epub. 2020-07-02 13:02:27 +01:00
Wen Kokke
353ff35644
Merge pull request #485 from mreed20/epubcheck
Fix remaining epubcheck warnings
2020-07-02 10:17:27 +01:00
Wen Kokke
be2478905f
Merge pull request #484 from mreed20/epub-acknowledgements-new
Populate acknowledgements.md with contributors for EPUB
2020-07-02 10:16:30 +01:00
Michael Reed
4e837c0975 run-liquid.lua: Add error checking and file output parameter
When running `make epub`, Make would try to satisfy the target
'src/plfa/acknowledgements_epub.md' by calling run-liquid.lua.  But due
to the use of shell redirection, Make would always create the file
acknowledgements_epub.md, even if run-liquid.lua failed, in which case
acknowledgements_epub.md would be empty.  This empty file would still
satisfy the 'src/plfa/acknowledgements_epub.md' target, allowing the
pandoc command line in the 'out/plfa.epub' target to proceed---and later
fail.

To avoid this, we now (a) add a bunch of error checking to run-liquid.lua,
and (b) write directly to acknowledgements_epub.md instead of relying on
shell redirection, so that acknowledgements_epub.md will only be created
(or modified) if run-liquid.lua succeeds.
2020-07-01 17:08:19 -04:00
Michael Reed
2e6e53d60a Review: Add instructions for building the EPUB 2020-07-01 11:58:46 -04:00
Michael Reed
54f7d9a90a Review: Don't build EPUB by default for now 2020-07-01 10:57:15 -04:00
Michael Reed
024a62d29f Fix remaining epubcheck warnings
HTML does not permit nested <p> elements, which epubcheck complains
about. This change fixes those remaining warnings.

This change also causes the Dedication on the website to be centered
when viewed in Safari, which it was not before. The EPUB output looks
the same in either version with Thorium reader 1.3 on macOS.
2020-06-28 20:28:46 -04:00
Michael Reed
99aa26401f EPUB: Populate acknowledgements.md with contributors
Use liquid-lua to generate acknowledgements_epub.md, which is used by
pandoc to build the EPUB book.  Also stop using the '{%-' / '-%}'
syntax, which liquid-lua does not support, in templates.

Also add a vertical space between the first bullet in each bulleted
list so pandoc recognizes bulleted lists as such. This has no effect on
the the website.
2020-06-28 14:17:45 -04:00
wadler
36ef980840 updated index with Ghica course 2020-06-23 17:53:06 +01:00
wadler
2a5565dca9 updated home page 2020-06-23 17:41:28 +01:00
Wen Kokke
80ba7fdfec Changed acknowledgements. 2020-06-19 13:53:29 +01:00
Wen Kokke
f1296fbd3b Changed acknowledgements. 2020-06-19 13:40:29 +01:00
Wen Kokke
1d4913d89f Fix Dedication. 2020-06-18 12:33:18 +01:00
Wen Kokke
8469ed41cb Changed layout in Dedication. 2020-06-18 08:26:47 +01:00
Wen Kokke
9a8f8c1bb2
Merge pull request #481 from mreed20/rewrite-links
EPUB: Fix broken links
2020-06-18 07:57:47 +01:00
Michael Reed
3c667f3f9b Review: typo and neater regex 2020-06-17 20:00:36 -04:00
Michael Reed
75654740b3 EPUB: Fix broken links
This is done with a lua filter that rewrites links with regular
expressions.

References #480.
2020-06-17 19:38:26 -04:00
Wen Kokke
b2b8b324af Moved epub-specific files to epub folder. 2020-06-16 16:10:10 +01:00
Wen Kokke
356b340e51 Removed old index file. 2020-06-16 12:02:25 +01:00
Wen Kokke
d04f594b1f Fixed bug in epub embedded fonts. 2020-06-16 12:01:19 +01:00
Wen Kokke
a5c7db8162 Adding only mononoki, from assets directory. 2020-06-16 11:49:06 +01:00
Wen Kokke
9dad13717d Fix pandoc install on Travis 2020-06-16 11:12:50 +01:00
Wen Kokke
631798263e
Merge pull request #479 from mreed20/pandoc
Add EPUB creation to the build
2020-06-16 11:06:44 +01:00
Michael Reed
5857550a43 Revert "Add internal link checker"
This reverts commit dbed30c659.
For whatever reason, some erroneous links are not detected with
this script, but are detected with epubchecker. So let's just use
epubchecker when the time comes.
2020-06-15 18:42:39 -04:00
Michael Reed
e790ed3b92 Fail on pandoc warnings 2020-06-15 18:32:34 -04:00
Michael Reed
1d6a0c3ca3 Review: Hook the EPUB build up to Travis 2020-06-15 18:32:31 -04:00
Michael Reed
75c6db936b epub.css: Remove false note.
The warning is not related to the contents of `epub.css`.
See https://github.com/jgm/pandoc/pull/6464 for more info.
2020-06-15 17:49:43 -04:00
Michael Reed
dbed30c659 Add internal link checker
This should make the link rewriting process easier. As this does
the same job as epubChecker, it can probably be removed once
epubChecker is integrated into the build process.
2020-06-15 14:24:29 -04:00
Michael Reed
02bf885d6b epub.css: Remove empty rules
This quells some VSCode warnings
2020-06-15 14:21:56 -04:00
Michael Reed
ed33201f61 epub.css: Fix path to embedded fonts
Found with the help of Calibre.
2020-06-15 12:34:06 -04:00
Michael Reed
031ad315b3 Review: Cleanup epub target
- List all dependencies of the `epub` target
- Create non-phony `out/plfa.epub` target, which the phony target `epub`
  is a synonym of.
2020-06-15 11:36:49 -04:00
Michael Reed
feea0a57d2 Review: Makefile: "make clean" should not remove the .epub
Note that clobber already removes the `out` directory.
2020-06-15 11:19:53 -04:00
Michael Reed
3a9845dd3c Review: Makefile: Embed all fonts in fonts directory 2020-06-15 11:16:38 -04:00
Michael Reed
a045f2f8a8 Review: Remove stray copy of DejaVuSansMono.ttf
There's already a copy in the `fonts` directory.
2020-06-15 11:15:08 -04:00
Michael Reed
55c7a10e23 Add EPUB creation to the build
The EPUB is created with `pandoc` in combination with Lua filters, which
rewrite the abstract syntax tree to be more suitable for EPUB creation.
In particular all headings in the markdown files `part[123]/*.lagda.md`
are shifted up by 1 (e.g., level 1 heading -> level 2 heading), so that
we can make a level 1 heading for Appendix, Frontmatter, and different
parts of the book. This is done to match the structure on the website [1].

Syntax highlighting is done using pandoc's builtin syntax highlighter
(which uses the Haskell library `skylighting`). In other words, we do
not use `highlight.sh`, so the syntax highlighting is slightly different
than the website version of the book. This could certainly be dealt with
later.

What follows is a list of things that are currently broken, which is
probably not exhaustive:
- The `Acknowledgements` section is broken.
- Embedded fonts don't work. They're necessary for some ereaders, like my old Sony PRS-300.
- All inline links are broken. I could rewrite them with a Lua filter
  and some regex, although that's not very nice :)
- `epubcheck` validation fails for a variety of reasons.

Closes #112.

[1]: https://plfa.github.io/
[2]: https://github.com/w3c/epubcheck
2020-06-14 21:28:56 -04:00
Philip Wadler
44fb26193f
Merge pull request #478 from mdimjasevic/lambda-highlighting-1
Lambda: fix highlighting of bindings in the text
2020-06-08 08:43:25 +01:00
Marko Dimjašević
3673bc8d26
Lambda: fix highlighting of bindings in the text 2020-06-07 22:38:34 +02:00
Philip Wadler
2b0f229c93
Merge pull request #477 from mdimjasevic/prop-line-break
Properties: fix the rendering of a highlighted expression
2020-06-07 10:23:55 +01:00
Marko Dimjašević
fed1bc2610
Properties: fix the rendering of a highlighted expression by removing a line break in the expression 2020-06-06 21:04:25 +02:00
Jeremy Siek
47cb1433db new verion of the book! beta.md -> index.md 2020-06-04 09:57:27 -04:00
Wen Kokke
8013d91afb
Pragmatic note on matching against decidable equality 2020-06-02 10:33:48 +01:00
wadler
406918768d more publishing stuff 2020-05-29 10:17:50 -03:00
wadler
07934be2b5 merge 2020-05-29 10:17:10 -03:00
wadler
23a84b75d3 publishing info and final pdf 2020-05-29 10:16:30 -03:00