arrow-kt / Category-Theory-for-Programmers.kt

Kotlin sample code for Bartosz Milewski's CT for Programmers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrate with PDF generation

hmemcpy opened this issue · comments

In the spirit of making it easily modifiable in the future if there are any additions ... Should we organize the code in this repo differently so it matches the format you have in that PR?

I mean having each snippet in its very own file like you have here:

src/content/1.1/code/scala/snippet04.scala

I've arrived at this structure after struggling a bit with the macro to try a more convention-based approach. I think this is good, putting all samples into e.g. kotlin/snippet04.kt files, but perhaps this could be a post-build step, generating them from the markdown files? I suppose whatever's easier from Ank's point of view :)

sounds good, ank doesn't really care but for translation purposes the current layout comparing haskell and kotlin it's easier. We'll figure it out after they are all translated and ready and we can separate them there.

Hi! I was playing with some small scripts and I've just created #56 pull request to include them 🎉

I've just created this issue in milewski-ctfp-pdfrepository, because we're including the translation of all the snippets (sections 1.7, 1.10 and 2.2) and some of them haven't been extracted for the translation in Scala.

  • Good news! 🎉 Reviewed sections: 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.9, 2.1 and 2.3.
  • Existing sections that are affected by this issue: 1.7 (still in progress), 1.10 and 2.2.
  • I've uploaded the drafts for the missing sections. They only include the considered snippets in the book until now.
  • I've updated READMEto comment the existence of drafts for next contributors. Maybe it can be announced at Slack or Twitter to encourage people (I'll try to help with some section as well 😉 ).

Hi! Thanks for listing the missing snippets. I'll look closely, but there are a few snippets that I know of: some parts were Haskell pseudocode which was not converted. Also, the snippets in the exercises were not converted.

Thanks here as well, @hmemcpy !! When taking into account the Challenges section, the new list that I get for the issue is shorter and with a smaller number of snippets 👏

  • After having the new list in the issue:
    • I'll wait for an answer to review 1.7 (still in progress) and 2.2.
    • I'll review the additional snippets in 1.10 (not included in the list now)
  • Included hypothetical files for Scala in drafts/scala as a help to add the translation in Kotlin.
  • README: second last section Initial drafts updated with the previous point.

Repository milewski-ctfp-pdf

Local environment requirements for creating the book:

  • Packages:
    • latexmk
    • texlive-xetex
    • texlive-fonts-extra
    • texlive-math-extra
  • Fonts:
    • Inconsolata LGC
    • Libertinus Math

This repository

  • Pending: reviewing and fixing 1.7, 1.10 and 2.2
  • 💡 by @i-walker!
    • Adding an additional task for checking the translation when pushing a contribution.
      • Dependency: it will be possible when 1.7, 1.10 and 2.2 are reviewed and fixed. Now there are errors with the numbers of snippets. If I activate this control now, all the builds will fail.

I really appreciate the awesome work you folks doing here, it's going to be amazing :)
If it helps, I recently hacked together (with lots of help!) a Nix installation shell script that pulls all the required LaTeX environment + packages + fonts, to be able to build the book without manually installing anything. I just added the instructions to the main README.

TL;DR Install Nix, then in the root of the project type nix-shell. It will work for a while, then ONE INTERNET LATER you will have an environment in which you could run the makefile. It will appear as a regular shell prompt, so you can navigate to src and run make.

Please see https://github.com/hmemcpy/milewski-ctfp-pdf/blob/master/shell.nix

(I needed to install a patched version of Pygments due to a highlighting bug in Scala, as well as pulling a github theme for Pygments which I couldn't install in nix directly, had to use a python virtualenv for that...)

Wow, I didn't see it! That's a big treasure. Super useful, @hmemcpy !!

Thank you so much!!

Related issue closed! ✔️

We can ask for help with the current drafts.

I've just created #57 for adding extra checks with GitHub actions.

Those extra checks don't make the build fail for now.

They will be able to be activated when sections 1.7, 1.10 and 2.2 are reviewed and fixed.

Sections 1.7, 1.10 and 2.2 have been reviewed and fixed.

There are 3 pull requests. Two of them are drafts where I need help.

I'll add 2 more checks:

  • The length of the lines (so far, there is a case outside the margins in the book )
  • Non empty snippets in Kotlin

I've created a new PR for the mentioned checks. So... everything is ready!! 🎉

Only a comment: it will be necessary to review the Editor Note (there is a TODO mark at the end).