New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make language specification available as a PDF #7432
Make language specification available as a PDF #7432
Conversation
I signed the CLA. |
Wow, great work! 😍 I browsed the generated html locally and it looks really good. |
Very cool. May I request that we store the generated output at http://www3.scala-lang.org/files/archive/nightly/pdfs/ScalaReference.pdf where version 2.9 currently lives ? This is what you get when you search for "scala specification" on Google Scholar currently. It would also be useful to have the first page of the PDF explain that this document was generated from |
Thanks guys! I have 2 quick questions:
@smarter "that this document was generated from" ..? HTML version of Scala spec? |
No because it's describing the definition of FunctionN which uses R, I think it's fine as is.
Yes.
Yes, that's what I meant. |
@sake92 interested in returning to this...? |
@SethTisue I merged the latest changes and updated the linked PDF example. |
@sake92 can you rebase and squash this into a smaller number of commits? I put this on the 2.13.1 milestone since it isn't a release blocker, but it could still make 2.13.0-RC1 |
3c21433
to
60af077
Compare
@SethTisue I did the rebase/squash thing. Never done squashing before, I hope everything's ok.. 😄 |
60af077
to
caadc3e
Compare
I took the liberty of force-pushing to your branch to fix a further merge conflict and to make some changes to the bash script. note to anyone who wants to try this, on MacOS you can the bash script needs some more work. I need to work on some other things right now, but I'll come back to this |
02edced
to
95f764e
Compare
I stabbed it with my steely knives for a while, but we won't be dining on roast beast tonight, it seems. The bash script now generates a PDF on my Mac (Darwin doesn't do but Travis says:
And then later it prints some dusty old Google Code URL, remember Google Code? So apparently It's first and 10 again, at least. |
in a dusty corner of the internet I found an old thing where someone used:
seems like I ought to be able to massage this into something that works |
also includes: * Fix JS issue in spec PDF building * Generate HTML for PDF in a separate folder Co-authored-by: Sakib Hadziavdic <sake.etf@gmail.com>
f128c02
to
6fb0680
Compare
Leaving scala/bug#10218 open for now since I still need to do the publish-it-to-the-website part. So let's not pop too many champagne corks until I get around to that :-) Thank you, @sake92, for taking this on and remaining committed to it despite the long wait. |
Thank you @SethTisue for all the help! Glad that this is finally over. 😄 |
as for the publishing part: at e.g. https://travis-ci.org/github/scala/scala/jobs/749278429 we see https://github.com/scala/scala-dev/blob/scala-dev/.github/ISSUE_TEMPLATE/release.md has instructions for ssh'ing to chara (I can never remember). if I ssh there and look in so, okay, now this is familiar from doing releases actually, you have to wait for https://scala-webapps.epfl.ch/jenkins/view/All/job/production_scala-lang.org-scala-dist-archive-sync/ to sync the files into production but this PR was merged two days ago and that job has run a number of times since then... ah but then there's also https://scala-webapps.epfl.ch/jenkins/view/All/job/production_scala-lang.org-builder/ ... hmm no, that doesn't seem relevant I triggered https://scala-webapps.epfl.ch/jenkins/view/All/job/production_scala-lang.org-scala-dist-archive-sync/154699/ manually just now on the off chance it might help interesting, it's been running for 12 minutes now... recent past runs seem to be in the 3–10 minute range (why such variation?) OMG THAT DID IT, we're live! https://scala-lang.org/files/archive/spec/2.13/spec.pdf champagne consumption may commence 🥂 |
Awesome! By the way, if I type "scala language specification" on Google the first result is the venerable spec of Scala 2.6 ( |
@fsalvi could you add that redirect, please? |
Ok, I added a redirect to the new spec page. |
the language in question was added by Adriaan in scala#7680 but then accidentally got removed in 2020 by scala#7432 I looked through other spec commits in that date span and didn't find anything else that went missing
the language in question was added by Adriaan in scala#7680 but then accidentally got removed in 2020 by scala#7432 I looked through other spec commits in that date span and didn't find anything else that went missing
The PDF is now published at https://scala-lang.org/files/archive/spec/2.13/spec.pdf
This is an attempt to help with scala/bug#10218
Wkhtmltopdf (v 0.12.6-dev) is used for generating PDF from HTML(s).
I tried first to render with existing setup, but had to make a few changes in print CSS and hide some divs from output.
Unfortunately, Mathjax doesn't behave well:
This solution uses a more lightweight library called KaTeX.
A problem with KaTeX is that you can't escape a
$
sign outside of math rendering scope.Mathjax has this
processEscapes: true
property so you can do a\$
anywhere.So I had to pick a different delimiter, ACUTE ACCENT (´) character (I also call it "forward-tick").
Here is PDF example: https://www.dropbox.com/s/yjcrs2ztk9myd0a/Spec.pdf?dl=0
NOTE: I used Batch script, didn't try Bash script, if someone could verify it works also that would be great. 🙂