• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language SCSS
  • License
    Other
  • Created over 12 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

sources for the Scala language website

scala-lang.org

This repository contains the source for the scala-lang.org web site.

It does not contain the source for the docs.scala-lang.org subdomain. You can visit the docs.scala-lang repository if you are interested in contributing to the Scala documentation site.

The source for the Scala compiler and standard library are at https://github.com/scala/scala. Bug reports are at https://github.com/scala/bug.

Dependencies

To build the site you can either use Compose or Bundler. Compose is a good option if you are just getting started and want something simple. If you are already familiar with the Ruby ecosystem then Bundler might be the most comfortable for you.

Either way the site is built with Jekyll and is typeset mostly in Markdown.

Building the site

Make sure you are in the root directory of the cloned repository.

With Docker Compose:

You need to have Docker Engine and Docker Compose installed on your machine. Under macOS (Intel or Apple silicon), instead of installing Docker Desktop you can also use HomeBrew with Colima: brew install colima docker docker-compose.
UID and GID environment variables are needed to avoid docker from writing files as root in your directory. By default, docker-compose will use the file docker-compose.yml which will build the website and serve it on 0.0.0.0:4000 . If you just need to build the website, add -f docker-compose_build-only.yml

env UID="$(id -u)" GID="$(id -g)" docker-compose up

The generated site is available at http://localhost:4000.

When the website dependencies change (the content of the Gemfile), you have to re-build the Docker image:

env UID="$(id -u)" GID="$(id -g)" docker-compose up --build

If you have problems with the Docker image or want to force the rebuild of the Docker image:

env UID="$(id -u)" GID="$(id -g)" docker-compose build --no-cache

With Bundler:

Install bundler first:

sudo gem install bundler

Then:

bundle install
bundle exec jekyll serve --incremental

Viewing the site

Regardless of your method of running Jekyll, the generated site is available at http://localhost:4000.

Editing the Site

YAML Front Matter

The "YAML Front Matter" is nothing more than the header on each page that you intend for Jekyll to parse. It contains information such as the name of the HTML template (layout) chosen for the specific document, and the title of the document. An example YAML front matter might look like:

---
layout: page
title: My page title
---

You can use these fields in the YAML front matter later in your document. For example, to make a header with the title of the document, in Markdown you would write:

---
layout: page
title: My page title
---

# {{ page.title }}

Body text here...

# {{ page.title }} would be rendered in HTML as, <h1>My page title</h1>.

Recommended Markdown Editor

Visual Studio Code has great support for Scala, Git, and Markdown.

Linking to internal pages

The least error-prone way to make links is to use this format: [link text]({{ site.baseurl }}/path/to/page/page.html)

{{ site.baseurl }} is a site-wide variable that represents the root directory of the static site. So, to display the Scala logo image you can simply write: ![Img alt text]({{ site.baseurl }}/resources/img/scala-logo.png)

Permalinks

We try to follow a pretty permalink style, so that any generated page will have a link finishing in a slash character (/). This will tell Jekyll to build that particular page as an index.html inside a folder with a name as specified in the provided permalink. i.e.: if a page has a permalink as follows:

permalink: /what-is-scala/

This will tell Jekyll to create a what-is-scala directory, with an index.html file inside. Links to this page will refer to the {{site.baseurl}}/what-is-scala/.

Custom collections and data

Every collection is a directory starting with an underscore character (_), containing a Markdown file for each member of the collection. These Markdown files start with a YAML front matter containing the data for this item, and can optionally contain markdown text to be rendered as html.

Right now there are no collections being rendered as specific pages in the site. They are only consumed internally as data. In the future this can be changed by specifying the global output: true variable in the _config.yml custom collections section. You will also need to specify a layout by using the defaults settings in the _config.yml file. i.e.:

defaults:
  - scope:
      path: ""
      type: collection_name
    values:
      layout: layout_name

To access data from a custom collection refer to site.<collection-name>. The collection's name will be the name of it's directory without the underscore character. i.e.: to access the data inside _downloads, use site.downloads.

Some of our data has been modelled as YAML files inside the _data folder. We generally do this for data that is used throughout the whole site. For example we do this for the navigation bar links.

The Backend

On every commit to the scala/scala-lang repository a jenkins job will generate the site using jekyll and copy the resulting files to the webserver. NOTE: the rsync of this job also deletes whatever is in the webserver directory with explicit exceptions: we need to keep the files listed below. Kind of a hack.

There are additional files on the webserver:

  • Subdirectory scala-lang.org/old is a static copy of the old website. It was generated once and copied there, and it stays like that.
  • Most of the files in /home/linuxsoft/archives/scala/ (on chara, accessible through ssh with your LAMP account) are synchronized to the subdirectory scala-lang.org/files/archive by another hourly jenkins job. This folder is used by the nightly and release jenkins jobs to publish scala releases:
    • distribution files (tarballs etc) in /
      • older distribution files, RCs in /old/ (not sure how exactly this is split up..)
    • api docs for distributions in /api/
    • nightly builds in /nightly/distributions/
    • nightly api builds in /nightly/docs-xxx/
    • nightly pdf builds (spec etc) in /nightly/pdfs

More Repositories

1

scala

Scala 2 compiler and standard library. Bugs at https://github.com/scala/bug; Scala 3 at https://github.com/scala/scala3
Scala
14,269
star
2

scala3

The Scala 3 compiler, also known as Dotty.
Scala
5,786
star
3

scala-async

An asynchronous programming facility for Scala
Scala
1,138
star
4

pickling

Fast, customizable, boilerplate-free pickling support for Scala
Scala
833
star
5

scala-parser-combinators

simple combinator-based parsing for Scala. formerly part of the Scala standard library, now a separate community-maintained module
Scala
642
star
6

docs.scala-lang

The Scala Documentation website
HTML
559
star
7

scala-java8-compat

A Java 8 (and up) compatibility kit for Scala.
Scala
436
star
8

legacy-svn-scala

OBSOLETE, we're over there:
Scala
366
star
9

scala3-example-project

An example sbt project that compiles using Dotty
Scala
332
star
10

scala-xml

The standard Scala XML library
Scala
295
star
11

scala-dist

sbt project that packages the Scala distribution
Scala
276
star
12

scala-abide

obsolete; visit https://github.com/scalacenter/scalafix instead
Scala
232
star
13

bug

Scala 2 bug reports only. Please, no questions โ€” proper bug reports only.
230
star
14

collection-strawman

Implementation of the new Scala 2.13 Collections
Scala
201
star
15

scala-collection-compat

makes some Scala 2.13 APIs (primarily collections, also some others) available on 2.11 and 2.12, to aid cross-building
Scala
200
star
16

scala-parallel-collections

Parallel collections standard library module for Scala 2.13+
Scala
194
star
17

scala-seed.g8

Giter8 template for a simple hello world app in Scala.
Scala
150
star
18

scala-dev

Scala 2 team issues. Not for user-facing bugs or directly actionable user-facing improvements. For build/test/infra and for longer-term planning and idea tracking. Our bug tracker is at https://github.com/scala/bug/issues
132
star
19

community-build

Scala 2 community build โ€”ย a corpus of open-source repos built against Scala nightlies
Shell
129
star
20

scala-swing

Scala wrappers for Java's Swing API for desktop GUIs
Scala
126
star
21

scala3.g8

Scala
123
star
22

scala-collection-contrib

community-contributed additions to the Scala 2.13 collections
Scala
107
star
23

scala-module-dependency-sample

Depend on Scala modules like a pro
Scala
95
star
24

scala-continuations

the Scala delimited continuations plugin and library
Scala
89
star
25

toolkit

The batteries-included Scala
Scala
87
star
26

make-release-notes

The project that generates Scala release notes.
HTML
85
star
27

vscode-scala-syntax

Visual Studio Code extension for syntax highlighting Scala sources
Scala
72
star
28

slip

obsolete โ€”ย archival use only
68
star
29

compiler-benchmark

Benchmarks for scalac
Scala
68
star
30

scala-library-next

backwards-binary-compatible Scala standard library additions
Scala
66
star
31

improvement-proposals

Scala Improvement Proposals
42
star
32

scala.epfl.ch

web site for the Scala Center @ EPFL in Switzerland
SCSS
37
star
33

scala-tool-support

XML
34
star
34

hello-world.g8

Scala
27
star
35

scala-collection-laws

partially-automatic generation of tests for the entire collections library
Scala
21
star
36

scala3-cross.g8

Scala
17
star
37

scabot

Scala's PR&CI automation bot
Scala
14
star
38

sbt-scala-module

sbt plugin for scala modules.
Scala
14
star
39

scala-jenkins-infra

A Chef cookbook that manages Scala's CI infrastructure.
Shell
14
star
40

scalatest-example.g8

Scala
13
star
41

scala3-mill-example-project

Shell
12
star
42

scala-asm

A fork of https://gitlab.ow2.org/asm/asm for the Scala compiler
12
star
43

compiler-interface

a binary contract between Zinc and Scala Compilers
Scala
10
star
44

scala-partest

Legacy repo for testing framework for Scala versions <= 2.12
Scala
9
star
45

scala-asm-legacy

A fork of asm.ow2.org for the Scala compiler
Java
8
star
46

scala3-staging.g8

Scala
7
star
47

scala-modules-build

Build support for the various Scala Modules
Shell
1
star
48

dotty.epfl.ch

The nightly documentation of scala 3
HTML
1
star
49

actors-migration

Scala
1
star
50

scala-partest-interface

SBT interface to partest
1
star
51

scala-library-all

Conglomerate pom file to pull in components of Scala standard library easily.
Scala
1
star
52

scala-dist-smoketest

Smoke Test for newly created Scala distributions
Shell
1
star
53

scala3-tasty-inspector.g8

Scala
1
star