Scala/spec
som-snytt e59b420e8a
SIP 42 Binary literals finds acceptance (#10656)
undefined
2024-01-11 13:37:44 -08:00
..
_includes Change math delimiter to ACUTE ACCENT (´) 2020-12-09 11:07:05 -08:00
_layouts Merge commit '4152c02cd8' into merge-2.12-to-2.13-20220118 2022-01-18 21:09:17 -08:00
public PDF spec generation script fixups, & add to Travis 2020-12-09 11:07:12 -08:00
01-lexical-syntax.md SIP 42 Binary literals finds acceptance (#10656) 2024-01-11 13:37:44 -08:00
02-identifiers-names-and-scopes.md Include top-level symbols from same file in outer ambiguity error 2023-05-17 16:14:21 +02:00
03-types.md fix a tiny error in the spec 2022-09-16 18:03:50 -07:00
04-basic-declarations-and-definitions.md Specify tail-recursive call elimination and annotation 2023-11-07 04:03:55 -08:00
05-classes-and-objects.md spec companion objects extending apply template 2023-12-04 10:25:30 +01:00
06-expressions.md Accept implicit _, implicit (x: Int) in lambda 2023-03-15 10:47:44 -07:00
07-implicits.md Clarify implicit params 2023-10-16 14:03:58 -07:00
08-pattern-matching.md Spec for name based and irrefutable patterns 2021-02-18 14:29:55 +00:00
09-top-level-definitions.md Change math delimiter to ACUTE ACCENT (´) 2020-12-09 11:07:05 -08:00
10-xml-expressions-and-patterns.md Change math delimiter to ACUTE ACCENT (´) 2020-12-09 11:07:05 -08:00
11-annotations.md Specify tail-recursive call elimination and annotation 2023-11-07 04:03:55 -08:00
12-the-scala-standard-library.md Tweak spec for subrange unary_- 2023-06-18 19:47:59 -07:00
13-syntax-summary.md SIP 42 Binary literals finds acceptance (#10656) 2024-01-11 13:37:44 -08:00
14-references.md Use HTTPS for links 2020-12-19 22:21:00 +01:00
15-changelog.md Use HTTPS for links 2020-12-19 22:21:00 +01:00
README.md upgrade Redcarpet (avoid sec vuln) 2021-01-20 17:30:36 -08:00
_config.yml mark 2.12 spec as not current anymore 2019-06-19 08:08:18 +02:00
id_dsa_travis.enc New keypair for 2.13 spec forced command 2016-12-12 11:28:30 -08:00
index.md Add scripts for generating specification PDF 2020-12-09 09:44:21 -08:00
spec-toc.xslt Add scripts for generating specification PDF 2020-12-09 09:44:21 -08:00

README.md

Scala Language Reference

First of all, the language specification is meant to be correct, precise and clear.

Second, editing, previewing and generating output for the markdown should be simple and easy.

Third, we'd like to support different output formats. An html page per chapter with MathJax seems like a good start, as it satisfies the second requirement, and enables the first one.

Editing

We are using Jekyll and Redcarpet to generate the html.

Check Gemfile for the current versions.

We aim to track the configuration GitHub Pages uses but differences may arise as GitHub Pages evolves.

Building

Travis CI builds the spec automatically after every merged pull release and publishes to https://www.scala-lang.org/files/archive/spec/2.13/.

To preview locally, run the following commands in the root of your checkout scala/scala: bundle install to install Jekyll and bundle exec jekyll serve -d build/spec/ -s spec/ -w --baseurl="" to start it, and open http://0.0.0.0:4000/ to view the spec. Jekyll will rebuild as you edit the markdown, but make sure to restart it when you change _config.yml.

General Advice for editors

  • All files must be saved as UTF-8: ensure your editors are configured appropriately.
  • Use of the appropriate unicode characters instead of the latex modifiers for accents, etc. is necessary. For example, é instead of \'e.
  • MathJAX errors will appear within the rendered DOM as span elements with class mtext and style attribute color: red applied. It is possible to search for this combination in the development tools of the browser of your choice. In chrome, CTRL+F / CMD+F within the inspect element panel allows you to do this.

Macro replacements:

  • While MathJAX just support LaTeX style command definition, it is recommended to not use this as it will likely cause issues with preparing the document for PDF or ebook distribution.
  • \SS (which I could not find defined within the latex source) seems to be closest to \mathscr{S}
  • \TYPE is equivalent to `\boldsymbol{type}'
  • As MathJAX has no support for slanted font (latex command \sl), so in all instances this should be replaced with \mathit{}
  • The macro \U{ABCD} used for unicode character references can be replaced with \uABCD.
  • The macro \URange{ABCD}{DCBA} used for unicode character ranges can be replaced with \uABCD-\uDBCA.
  • The macro \commadots can be replaced with , … ,.
  • There is no adequate replacement for \textsc{...} (small caps) in pandoc markdown. While unicode contains a number of small capital letters, it is notably missing Q and X as these glyphs are intended for phonetic spelling, therefore these cannot be reliably used. For now, the best option is to use underscore emphasis and capitalise the text manually, _LIKE THIS_.

Unicode Character replacements

  • The unicode left and right single quotation marks ( and (U+2018 and U+2019, respectively)) have been used in place of ` and ', where the quotation marks are intended to be paired. These can be typed on a mac using Option+] for a left quote and Option+Shift+] for the right quote.
  • Similarly for left and right double quotation marks (“ and ” (U+201C and U+201D, respectively)) in place of ". These can be typed on a mac using Option+[ and Option+Shift+].