Code Monkey home page Code Monkey logo

scala-lang's Introduction

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 repository for Scala 3 itself is https://github.com/scala/scala3 .

Scala 2 is at https://github.com/scala/scala. Scala 2 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

scala-lang's People

Contributors

adpi2 avatar adriaanm avatar anatoliykmetyuk avatar andy1138 avatar ashawley avatar bishabosha avatar cvogt avatar darjutak avatar dependabot[bot] avatar dickwall avatar dominv avatar dwijnand avatar fsalvi avatar gourlaysama avatar gzm0 avatar heathermiller avatar jarrodu avatar julienrf avatar jvican avatar kordyjan avatar lrytz avatar masseguillaume avatar odersky avatar olafurpg avatar philippus avatar propensive avatar retronym avatar sethtisue avatar sjrd avatar travissarles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scala-lang's Issues

"Concise and powerful. (...)" Java example in "See Scala in action" scroller has a bug.

I think that the Java example in the "Concise and powerful. (...)" slide is not doing what the corresponding Scala code is doing. The last line might overwrite the contents of minors (which at this point is an alias to people) with that of adultsList.

Fix: replace the last two lines with

minors = minorsList.toArray(new Person[minorsList.size()])
adults = adultsList.toArray(new Person[adultsList.size()])

Link to Typesafe?

Would be nice to have a "Commercial support" link or "Part of the Typesafe Platform" mentioned somewhere. Maybe @odersky could suggest the appropriate wording / prominence.

Loving the new front page, BTW!

Remove list of blogs from Community page

Blogs promote individuals and their ideas, they're not so much of a community effort. We think that the community page should contain only resources for the community; e.g., mailing lists, events, QA websites like SO, etc.

JS Type error in moveScrooler()

There is a JS Type error in function moveScroller() in main.js:162:

TypeError: $(".sidebar").offset() is undefined @ main.js:162

Triggered at least on the front page because $(".sidebar") does not exist.

Need to produce RSS feeds for frontpage updates

@sjrd would you be up to have a look at this? I think it's pretty easy, for example:
https://gist.github.com/stammy/795024
http://www.daveperrett.com/articles/2010/09/14/integrating-jekyll-with-feedburner/
http://www.functionn.in/2012/06/jekyll-github-blog-feeds-template-rss.html#.UYejWishozI

I suppose the only tricky bit would be figuring out how to organize it.

Personally, I'd think that just one feed with the updates to the frontpage (announcements, news, blog articles) would be enough, as new releases and anything else of interest would be written there. But then again there's other exciting stuff that we might want included in the feed, like the monthly hall of fame updates.

redirects old archive to new site

We need to compose a list of paths of the old site, which should be redirected to paths in the new site. Heather, can you compose the list and I install the redirects?

Add binary compatibility guide

Provide a guide that covers:

  • history of binary compatibility in Scala so we can show that our policy evolves in the right direction
  • define binary compatibility (there different concerns like serialization, linkage errors, etc.)
  • present tradeoffs we face when it comes to binary compatibility
  • describe current policy in 2.10.x series
  • mention tools we use (mima) which is related to hackers guide

move over to new server

we can go live with the current server but at some point should move over to the new server Fabien bought.

In this process we should try to enable caching and compression, see #38

go live

@heathermiller tell me when everything is ready. Takes at least a day until it is through and it will require changes by epfl support.

Yslow tuning

Tune the website for performance.

Meta tags should enable caching!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.