Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mor1 committed Dec 8, 2013
1 parent f339902 commit a6215e5
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 48 deletions.
13 changes: 6 additions & 7 deletions src/blog.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ let entry_css = <:css<
margin-left: 0px;
margin-bottom: 0px;
}
.blog_entry_title {
font-size: 1.6em;
.blog_entry_title {
font-size: 1.6em;
font-weight: bold;
}
.blog_entry_info {
Expand Down Expand Up @@ -238,7 +238,7 @@ let permalink_exists x = List.exists (fun e -> e.permalink = x) entries
let atom_entry_of_ent filefn e =
let links = [
Atom.mk_link ~rel:`alternate ~typ:"text/html"
(Config.mk_uri (permalink e))
(Config.mk_uri (permalink e))
] in
let meta = {
Atom.id = permalink e;
Expand All @@ -248,16 +248,16 @@ let atom_entry_of_ent filefn e =
updated = atom_date e.updated;
links;
rights;
} in
} in
lwt content = filefn e.body in
return {
Atom.entry = meta;
summary = None;
base = None;
content;
}
let atom_feed filefn es =

let atom_feed filefn es =
let es = List.rev (List.sort cmp_ent es) in
let updated = atom_date (List.hd es).updated in
let id = "/blog/" in
Expand All @@ -270,4 +270,3 @@ let atom_feed filefn es =
let feed = { Atom.id; title; subtitle; author=None; rights; updated; links } in
lwt entries = Lwt_list.map_s (atom_entry_of_ent filefn) es in
return { Atom.feed=feed; entries }

2 changes: 1 addition & 1 deletion src/dispatch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Resp = struct
| "" :: "wiki" :: page ->
let headers, t = Pages.Wiki.t page in
dyn ~headers req t
| [""; "styles";"index.css"] ->
| [""; "styles";"index.css"] ->
dyn ~headers:Style.content_type_css req Style.t
| x -> CL.Server.respond_not_found ~uri:(CL.Request.uri req) ()
end
Expand Down
35 changes: 17 additions & 18 deletions src/pages.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let file_template f =
| Some content -> Util.string_of_stream content
| None -> raise_lwt (Failure (sprintf "File template not found: %s" f))
end
with exn ->
with exn ->
printf "Pages.read_file: exception %s\n%!" (Printexc.to_string exn);
exit 1

Expand All @@ -22,14 +22,14 @@ let read_file f =
String.sub f (n+1) (String.length f - n - 1)
with _ -> "" in
match suffix with
| "md" -> file_template f >|= Markdown.of_string >|= Markdown.to_html
| "md" -> file_template f >|= Markdown.of_string >|= Markdown.to_html
| "html" -> file_template f >|= Html.of_string
| _ -> return []
with exn ->
with exn ->
printf "Pages.read_file: exception %s\n%!" (Printexc.to_string exn);
exit 1

let col_files l r = <:xml<
let col_files l r = <:xml<
<div class="left_column">
<div class="summary_information"> $l$ </div>
</div>
Expand All @@ -55,12 +55,12 @@ let content_type_xhtml = ["content-type","text/html"]

module Index = struct
let body =
lwt l1 = read_file "/intro.md" >|= (fun l -> col_files l none) in
lwt l1 = read_file "/intro.md" >|= (fun l -> col_files l none) in
lwt l2 = read_file "/intro-r.html" >|= (fun l -> col_files l none) in
return (<:xml<
<div class="left_column">
$l1$
</div>
</div>
<div class="right_column">
$l2$
</div>
Expand All @@ -71,10 +71,10 @@ end
module Resources = struct
let body = read_file "/docs.md" >|= (fun l -> col_files l Paper.html)
let t = Template.t "Resources" "resources" body >|= Html.to_string
end
end

module About = struct

let body =
lwt l = read_file "/about.md" in
lwt r = read_file "/about-r.md" in
Expand All @@ -86,7 +86,7 @@ end
module Blog = struct
open Blog


(* Make a full Html.t including RSS link and headers from a list
of Html.t entry fragments *)
let make ?title body =
Expand Down Expand Up @@ -129,7 +129,7 @@ module Blog = struct
| x -> content_type_xhtml, return (not_found x)

end

module Wiki = struct
open Wiki

Expand All @@ -141,12 +141,12 @@ module Wiki = struct
(* Make a full Html.t including RSS link and headers from an wiki page *)
let make ?title ?disqus left_column =
let url = sprintf "/wiki/atom.xml" in
let extra_header = <:xml<
let extra_header = <:xml<
<link rel="alternate" type="application/atom+xml" href=$str:url$ />
>> in
let title = "wiki" ^ match title with
let title = "wiki" ^ match title with
|None -> "" |Some x -> " :: " ^ x in
let body = Wiki.html_of_page ?disqus ~left_column ~right_column in
let body = Wiki.html_of_page ?disqus ~left_column ~right_column in
Template.t ~extra_header "Wiki" title body >|= Html.to_string

(* Main wiki page Html.t fragment with the index page *)
Expand Down Expand Up @@ -183,16 +183,16 @@ module Wiki = struct
) lt2s
) Wiki.categories

let atom_feed =
let atom_feed =
lwt f = Wiki.atom_feed read_file Wiki.entries in
return (Xml.to_string (Atom.xml_of_feed ~self:("/wiki/atom.xml") f))

let not_found x =
let left =
sprintf "Not found: %s (known links: wiki/%s)"
(String.concat " ... " x)
(String.concat " "
(Hashtbl.fold (fun k v a -> k :: a)
(String.concat " ... " x)
(String.concat " "
(Hashtbl.fold (fun k v a -> k :: a)
ent_bodies [])) in
make ~title:"Not Found" (return <:xml<$str:left$>>)

Expand All @@ -208,4 +208,3 @@ module Wiki = struct
| [lt1;lt2] -> (try Hashtbl.find lt2_bodies lt2 with Not_found -> not_found [lt2])
| x -> not_found x
end

4 changes: 2 additions & 2 deletions src/paper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ let papers = [
issues that have made past library operating systems impractical to
deploy in the real-world. >>;
};

{ name = "openflow";
items = [
pdf "http://www.cs.nott.ac.uk/~rmm/papers/pdf/iccsdn12-mirageof.pdf";
Expand All @@ -136,7 +136,7 @@ let papers = [
authors = [ jon; anil; malte; theo; mort ];
descr = <:xml<
Proceedings of 12th International Conference on Distributed Computing and Networking
<a href="http://icdcn2012.comp.polyu.edu.hk/">ICDCN '11</a>, January 2011. Invited paper.
<a href="http://icdcn2012.comp.polyu.edu.hk/">ICDCN '11</a>, January 2011. Invited paper.
>>;
abstract = <:xml<
>>;
Expand Down
10 changes: 5 additions & 5 deletions src/style.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let linkbar = <:css<
height: 23px;
padding: 8px 20px 0px 20px;
}

li a.current_page {
border-bottom: 5px solid #222;
color: #222;
Expand All @@ -49,7 +49,7 @@ let content = <:css<
padding-top: 10px;
padding-bottom: 10px;
font-size: 1.3em;

h2 {
color: #222;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
Expand Down Expand Up @@ -123,13 +123,13 @@ let content = <:css<
font-size: 1.2em;
padding: 2px 0px 2px 5px;
}

a {
text-decoration: none;
border-bottom: 1px dotted #ccc;
color: #000077;
}

a:hover {
border-bottom: 1px solid #aaa;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ let wrapper = <:css<

#content { $content$; }
>>

let footer = <:css<
border-top: 1px solid #888;
height: 30px;
Expand Down
2 changes: 1 addition & 1 deletion src/util.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Lwt

(* XXX very inefficient *)
let string_of_stream s =
let string_of_stream s =
Lwt_stream.to_list s >|= Cstruct.copyv
26 changes: 13 additions & 13 deletions src/wiki.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let html_of_author author =

type category = string * string (* category, subcategory, see list of them below *)

type body =
type body =
|File of string
|Html of Html.t

Expand Down Expand Up @@ -98,7 +98,7 @@ let html_of_index read_file =
<div class="wiki_entry_body">$body$</div>
</div>
>>

let entry_css = <:css<
.wiki_entry {
margin-bottom: 20px;
Expand Down Expand Up @@ -167,7 +167,7 @@ let num_of_entries entries =
(* One categorie on the right column *)
let short_html_of_category num (l1, l2l) =
let l2h = List.map (fun l2 ->
match num.l2 l1 l2 with
match num.l2 l1 l2 with
| 0 -> <:xml<<div class="wiki_bar_l2">$str:l2$</div>&>>
| nl2 ->
let num = <:xml<<i>$str:sprintf " (%d)" nl2$</i>&>> in
Expand Down Expand Up @@ -285,9 +285,9 @@ let html_of_page ?disqus ~left_column ~right_column =
let disqus_html permalink = <:xml<
<div class="wiki_entry_comments">
<div id="disqus_thread"/>
<script type="text/javascript">
var disqus_identifer = '/wiki/$str:permalink$';
(function() {
<script type="text/javascript">
var disqus_identifer = '/wiki/$str:permalink$';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://openmirage.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
Expand Down Expand Up @@ -384,7 +384,7 @@ let entries = [
permalink = "dev-preview-checklist";
categories = ["overview","meetings"];
};

weekly ~y:2013 ~m:6 ~d:11;
weekly ~y:2013 ~m:6 ~d:4;
weekly ~y:2013 ~m:5 ~d:28;
Expand All @@ -393,7 +393,7 @@ let entries = [
weekly ~y:2013 ~m:4 ~d:30;
weekly ~y:2013 ~m:4 ~d:23;
weekly ~y:2013 ~m:4 ~d:16;

{ updated = date (2013, 08, 15, 16, 0);
author = balraj;
subject = "Getting Started with Lwt threads";
Expand All @@ -417,7 +417,7 @@ let entries = [
permalink = "delimcc-vs-lwt";
categories = ["concurrency","threads"];
};

{ updated = date (2013, 08, 10, 15, 00);
author = mort; (* ++ vb -- need multiple author support *)
subject = "Installation";
Expand Down Expand Up @@ -490,7 +490,7 @@ let entries = [
categories = ["language","syntax"];
};

{
{
updated = date (2010, 11, 4, 16, 30);
author = thomas;
subject = "Introduction to HTCaML";
Expand All @@ -512,7 +512,7 @@ let permalink_exists x = List.exists (fun e -> e.permalink = x) entries
let atom_entry_of_ent filefn e =
let links = [
Atom.mk_link ~rel:`alternate ~typ:"text/html"
(Uri.of_string (permalink e))
(Uri.of_string (permalink e))
] in
lwt content = body_of_entry filefn e in
let meta = {
Expand All @@ -530,8 +530,8 @@ let atom_entry_of_ent filefn e =
base = None;
content
}
let atom_feed filefn es =

let atom_feed filefn es =
let es = List.rev (List.sort cmp_ent es) in
let updated = atom_date (List.hd es).updated in
let id = "/wiki/" in
Expand Down
1 change: 0 additions & 1 deletion tmpl/about-proj.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ We are grateful to funding by the RCUK Horizon Digital Economy Research Hub gran
Amazon also gave us an [Amazon in Education](http://aws.amazon.com/education/) award to help test on EC2.

Verisign is [sponsoring](http://www.cl.cam.ac.uk/news/2011/03/anil-madhavapeddy-wins-verisign-grant/) work on the secure DNS library.

0 comments on commit a6215e5

Please sign in to comment.