Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
valderman committed Jun 29, 2016
0 parents commit d2819ed
Show file tree
Hide file tree
Showing 31 changed files with 2,937 additions and 0 deletions.
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Compiler Construction course homepage
=====================================

This is the course homepage for the Chalmers course Compiler Construction
(TDA283/DIT300). The homepage is built using Hakyll. To build it, you will need
a recent copy of the Haskell Platform, plus Hakyll itself (which is available
from Hackage).


Overview
--------

The homepage is largely configurable from the build script, `website.hs`, which
is divided into three sections.

The first section contains information which is likely to change as the course
progresses: news items, lectures and files to be published on the course homepage.
The second section contains information which is likely to change from year to
year, such as information about the course responsible and assistants, various
URLs, etc.

The settings in these two sections are made available to the markdown-based
pages of the course homepage through *template variables*. Please see the
Haddock for each setting for more information on how to use them.

The third section contains the build script itself, which is unlikely to change
very much at all. This part is largely considered implementation details.

Page content lives in the `pages` directory as markdown files; one file per
page on the course homepage. Larger edits -- modifications to the project
description, updates from course evaluation meetings, etc. -- are made to the
relevant markdown file. Please remember to *avoid* including information such
as the name of the examiner, URL of the Google group, etc. verbatim in these
pages. Instead, use the template variables `$teacher$`, `$group$`, etc., to
ensure that this information is kept consistent across all pages and is easy
to update if the course changes hands.

Files -- lecture notes, the test suite, etc. -- live in the `files` directory.
Any files you want to distribute should be put in this directory and linked
from the appropriate news item or markdown page.

The look of the course homepage mainly lives in the `css` and `templates`
directories. Please exercise caution when updating the CSS and HTML in these
directories, as you might inadvertently break the site for mobile devices.
Make sure to test any changes both in your normal browsing environment and with
your browser window shrunk to less 750 pixels wide.


Day to day tasks
----------------

### Rebuilding the site

To rebuild the site, simply run `runghc website.hs build`. If the build has
somehow become messed up, use `runghc website.hs rebuild` to rebuild it from
scratch.


### Deploying the updated site

After rebuilding the site, deploy it by copying the contents of the `_site`
directory to the appropriate directory on the Chalmers server. You should
use `rsync` for this, to avoid updating any files that were not changed. An
example of a deployment command line would be
`rsync -r _site/* /path/to/homepage/root`.


### Updating news

To add a news item, simply add a line to the `newsItem` list and rebuild the
site. Make sure that the prefixes of the lines are consistent, i.e. give the
date that the news item was added. News items may contain markdown, so you can
add emphasis, links and other styling.


### Lectures

To update a lecture, simply add/remove/modify the relevant entry in the
`lectures` list and rebuild the site. Each lecture has three fields:

* the date of the lecture;
* the title of the lecture; and
* a list of (title, file name) pairs, containing files (usually slides) tied
to the lecture.

Don't forget to put any files you added/changed into the `files` directory.
If you removed a file from the list, you should also remove it from the `files`
directory.
40 changes: 40 additions & 0 deletions css/highlighting.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* keywords */
.kw {
color: purple;
font-weight: bold;
}

/* Haskell operators */
.haskell .fu {
color: brown;
}

/* Java methods, fields, annotations */
.java .fu {
color: indigo;
}

/* Data types */
.dt {
color: green;
}

/* Comments */
.co {
color: crimson;
}

/* Literals */
.dv {
color: black;
}

/* Other(?) */
.ot {
color: black;
}

/* String literals */
.st {
color: chocolate;
}
202 changes: 202 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
/* Global styling */
body {
font-family: sans-serif;
}

h1 {
font-size: 24pt;
font-weight: bold;
margin-top: 3em;
}

h1:first-of-type {
margin-top: 0em;
}

h2 {
font-size: 14pt;
font-weight: bold;
margin-top: 2em;
}

h3 {
font-size: 14pt;
font-weight: normal;
text-decoration: underline;
margin-top: 1.5em;
}

li {
padding: 0.5em;
}


/* The sidebar and menu */
#sidebar {
position: fixed;
padding-left: 4em;
width: 10em;
}

@media (max-width: 750px) {
.sidebar {display: none;}
#sidebar img {display: none;}
#sidebarheading {display: none;}

#sidebar {
width: 100%;
left: 0em;
padding-top: 2em;
background-color: white;
border-bottom: 1px solid black;
z-index: 1000;
}
}

#topbar {
position: fixed;
background-color: #f0f0f0;
left: 0em;
right: 0em;
top: 0em;
height: 2.5em;
padding-left: 0.5em;
font-size: 14pt;
font-weight: bold;
cursor: pointer;
z-index: 1500;
}

#topbar img {
height: 2em;
float: right;
padding-right: 1em;
padding-top: 0.25em;
}

#topbar div {
padding-top: 0.5em;
float: left;
}

@media (min-width: 751px) {
.topbar {
display: none;
}
}

#sidebarheading {
list-style: none;
text-align: left;
font-family: verdana;
text-align: center;
margin-left: -4em;
}

#menu {
margin-top: 2em;
margin-bottom: 2em;
margin-left: -1em;
padding-left: 0em;
font-family: verdana;
list-style: none;
}

#menu li {
padding: 0.5em;
}

#menu li.selected {
background-color: black;
color: white;
}

#menu .selected a {
color: white;
}

#menu li:hover.unselected {
background-color: #f0f0f0;
}

#menu .selected .submenu li:hover {
background-color: #505050;
}

#menu a {
color: black;
text-decoration: none;
}

ul.submenu {
padding-top: 0.5em;
margin-left: -1em;
margin-right: -1em;
}


/* Page content */
#content {
position: absolute;
margin: 3em;
left: 15em;
right: 15em;
min-width: 30em;
}

@media (max-width: 750px) {
#content {
position: absolute;
left: auto;
right: auto;
margin-left: 1em;
margin-right: 1em;
min-width: auto;
}
}

.newslink {
font-size: smaller;
}

.hide {
display: none;
}

.lectures th {
background-color: #fffff0;
}

pre {
background-color: #f5f5f5;
padding: 1.5em;
margin-top: 1.5em;
margin-left: 1.5em;
max-width: 60em;
}

div.javaletteref {
position: fixed;
top: 0em;
right: 0em;
height: 100%;
background-color: #f5f5f5;
padding-left: 1em;
padding-right: 1em;
font-size: 11pt;
}

.javaletteref a {
color: black;
text-decoration: none;
}

.javaletteref ul {
padding-left: 1em;
}

@media (max-width: 750px) {
div.javaletteref {
display: none;
}
}
Loading

0 comments on commit d2819ed

Please sign in to comment.