Index: trunk/src/converters/atom.ml
===================================================================
--- trunk/src/converters/atom.ml	(revision 1)
+++ 	(revision )
@@ -1,50 +1,0 @@
-let esc = Xml_print.encode_unsafe_char
-
-let header config url =
-  let open Logarion.Meta in
-  let open Logarion.Archive.Configuration in
-  "<title>" ^ config.title ^ "</title>"
-  (* TODO: ^ "<subtitle>A subtitle.</subtitle>"*)
-  ^ "<link rel=\"alternate\" type=\"text/html\" href=\"" ^ url ^ "\"/>"
-  ^ "<link rel=\"self\" type=\"application/atom+xml\" href=\"" ^ url ^ "/feed.atom\" />"
-  ^ "<id>urn:uuid:" ^ Id.to_string config.id ^ "</id>"
-  ^ "<updated>" ^ Ptime.to_rfc3339 (Ptime_clock.now ()) ^ "</updated>"
-
-let opt_element tag_name content =
-  if content <> ""
-  then "<" ^ tag_name ^ ">" ^ content ^ "</" ^ tag_name ^ ">"
-  else ""
-
-let entry url note =
-  let open Logarion in
-  let meta = note.Note.meta in
-  let u = "note/" ^ Meta.alias meta in
-  let open Meta in
-  let authors elt a =
-    a ^ "<author>"
-    ^ (opt_element "name" @@ esc elt.Author.name)
-    ^ (opt_element "uri" @@ esc (Uri.to_string elt.Author.address))
-    ^ "</author>"
-  in
-  ("<entry>"
-   ^ "<title>" ^ meta.title ^ "</title>"
-   ^ "<id>urn:uuid:" ^ Meta.Id.to_string meta.uuid ^ "</id>"
-   ^ "<link rel=\"alternate\" href=\"" ^ url ^ "/" ^ u ^ "\" />"
-   ^ "<updated>" ^ Date.(meta.date |> listing |> rfc_string) ^ "</updated>"
-   ^ Meta.AuthorSet.fold authors meta.authors ""
-   ^ opt_element "summary" @@ esc meta.abstract)
-  ^ Meta.StringSet.fold (fun elt a -> a ^ "<category term=\"" ^ elt ^ "\"/>") meta.topics ""
-  ^ "<content type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">"
-  ^ (Omd.to_html @@ Omd.of_string @@ esc note.Note.body)
-  ^ "</div></content>"
-  ^ "</entry>"
-
-let feed config url note_fn articles =
-  let fold_valid feed m = match note_fn m.Logarion.Meta.uuid with
-    | Some note -> feed ^ "\n" ^ entry url note
-    | None -> feed
-  in
-  "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<feed xmlns=\"http://www.w3.org/2005/Atom\">\n"
-  ^ header config url
-  ^ List.fold_left fold_valid "" articles
-  ^ "</feed>"
Index: trunk/src/converters/html.ml
===================================================================
--- trunk/src/converters/html.ml	(revision 1)
+++ 	(revision )
@@ -1,133 +1,0 @@
-open Tyxml.Html
-open Logarion
-
-let to_string tyxml = Format.asprintf "%a" (Tyxml.Html.pp ()) tyxml
-
-let head ~style linker t =
-  head (title (pcdata t)) [
-         link ~rel:[`Stylesheet] ~href:(linker style) ();
-         link ~rel:[`Alternate]  ~href:(linker "/feed.atom") ~a:[a_mime_type "application/atom+xml"] ();
-         meta ~a:[a_charset "utf-8"] ();
-       ]
-
-let default_style = "/static/main.css"
-
-let page ?(style=default_style) linker head_title header main =
-  html (head ~style linker head_title) (body [ header; main ])
-
-let anchor url content = a ~a:[ a_href (uri_of_string url) ] content
-
-let div ?(style_class="") content =
-  let a = if style_class <> "" then [a_class [style_class]] else [] in
-  div ~a content
-
-let main = main
-
-let unescaped_data = Unsafe.data
-let data = pcdata
-let title = h1
-let header = header
-
-let pipe = span ~a:[a_class ["pipe"]] [pcdata " | "]
-
-let meta ~abstract ~authors ~date ~series ~topics ~keywords ~uuid =
-  let opt_span name value = if String.length value > 0 then (span [pipe; pcdata (name ^ value)]) else pcdata "" in
-  let authors = List.fold_left (fun acc x -> a ~a:[a_rel [`Author]] [pcdata x] :: acc) [] authors in
-  [ p ~a:[a_class ["abstract"]] [Unsafe.data abstract]; ]
-  @ authors
-  @ [
-      pipe;
-      time ~a:[a_datetime date] [pcdata date];
-      pipe;
-      opt_span "series: " series;
-      opt_span "topics: " topics;
-      opt_span "keywords: " keywords;
-      div [pcdata ("id: " ^ uuid)];
-    ]
-  |> div ~style_class:"meta"
-
-let note = article
-
-let text_item path meta =
-  let module Meta = Logarion.Meta in
-  tr [
-      td [ a ~a:[a_class ["title"]; a_href (path ^ Meta.alias meta ^ ".html")] [data meta.Meta.title] ];
-      td [ span [pcdata Meta.(stringset_csv meta.keywords)] ];
-      td [ time @@ [unescaped_data Meta.Date.(pretty_date (listing meta.Meta.date))] ];
-    ]
-
-let listing_texts path metas =
-  let item meta = text_item path meta in
-  table @@ List.map item metas
-
-let listing_index path metas =
-  let items topic =
-    List.fold_left Meta.(fun a e -> if StringSet.mem topic e.topics then text_item path e :: a else a)
-      [] metas
-  in
-  let item topic =
-    let module Meta = Logarion.Meta in
-    [ h3 ~a:[a_id topic] [pcdata topic]; table (items topic)]
-  in
-  List.fold_left (fun a e -> a @ item e) []
-  @@ Meta.StringSet.elements
-  @@ List.fold_left Meta.(fun a e -> unique_topics a e) Meta.StringSet.empty metas
-
-module Renderer = struct
-  let meta meta e =
-    let e = List.hd e in
-    match e with
-    | "urn_name" -> [unescaped_data @@ "/note/" ^ Logarion.Meta.alias meta]
-    | "date" | "date_created" | "date_edited" | "date_published" | "date_human" ->
-       [time @@ [unescaped_data @@ Logarion.Meta.value_with_name meta e]]
-    | tag -> [unescaped_data @@ Logarion.Meta.value_with_name meta tag]
-
-  let note note e = match List.hd e with
-    | "body" -> [unescaped_data @@ Omd.to_html @@ Omd.of_string note.Logarion.Note.body]
-    | _      -> meta note.Logarion.Note.meta e
-
-  let archive archive e = match List.hd e with
-    | "title" -> [h1 [anchor ("index.html") [data archive.Logarion.Archive.Configuration.title]]]
-    | tag -> prerr_endline ("unknown tag: " ^ tag); [unescaped_data ""]
-end
-
-let form ymd =
-  let article_form =
-    let input_set title input = p [ label [ pcdata title; input ] ] in
-    let open Note in
-    let open Meta in
-    let authors = AuthorSet.to_string ymd.meta.authors in
-    [
-      input ~a:[a_name "uuid"; a_value (Id.to_string ymd.meta.uuid); a_input_type `Hidden] ();
-      input_set
-        "Title"
-        (input ~a:[a_name "title"; a_value ymd.meta.title; a_required ()] ());
-      input_set
-        "Authors"
-        (input ~a:[a_name "authors"; a_value authors] ());
-      input_set
-        "Topics"
-        (input ~a:[a_name "topics"; a_value (stringset_csv ymd.meta.topics)] ());
-      input_set
-        "Categories"
-        (input ~a:[a_name "categories"; a_value (CategorySet.to_csv ymd.meta.categories)] ());
-      input_set
-        "Keywords"
-        (input ~a:[a_name "keywords"; a_value (stringset_csv ymd.meta.keywords)] ());
-      input_set
-        "Series"
-        (input ~a:[a_name "series"; a_value (stringset_csv ymd.meta.series)] ());
-      input_set
-        "Abstract"
-        (input ~a:[a_name "abstract"; a_value ymd.meta.abstract] ());
-      input_set
-        "Text"
-        (textarea ~a:[a_name "body"] (pcdata ymd.body));
-      p [ button ~a:[a_button_type `Submit] [pcdata "Submit"] ];
-    ]
-  in
-  div
-    [ form
-        ~a:[a_method `Post; a_action (uri_of_string "/post.note"); a_accept_charset ["utf-8"]]
-        [ fieldset ~legend:(legend [pcdata "Article"]) article_form ]
-    ]
Index: trunk/src/converters/jbuild
===================================================================
--- trunk/src/converters/jbuild	(revision 1)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(library
- ((name        converters)
-  (public_name logarion.converters)
-  (libraries (logarion logarion.file mustache tyxml ptime ptime.clock.os))
-  ))
Index: trunk/src/converters/template.ml
===================================================================
--- trunk/src/converters/template.ml	(revision 1)
+++ 	(revision )
@@ -1,81 +1,0 @@
-type t = Mustache.t
-
-let of_string = Mustache.of_string
-let of_file f = File.load f |> of_string
-
-let string s = [Html.data s]
-let section ~inverted:_ _name _contents = prerr_endline "Mustache sections unsupported"; []
-let unescaped _elts = prerr_endline "Mustache unescaped not supported; used escaped instead"; []
-let partial ?indent:_ _name _ _ = prerr_endline "Mustache sections unsupported"; []
-let comment _ = [Html.data ""]
-let concat = List.concat
-
-let escaped_index ~from:_ ~n:_ _metas _e = [Html.data "temp"]
-  (* match List.hd e with *)
-  (* | "topics" -> *)
-  (*    let topics = *)
-  (*      ListLabels.fold_left *)
-  (*        ~init:(Logarion.Meta.StringSet.empty) *)
-  (*        ~f:(fun a e -> Logarion.Meta.unique_topics a e ) metas *)
-  (*    in *)
-  (*    Logarion.Meta.StringSet.fold (fun e a -> a ^ "<li><a href=\"/topic/" ^ e ^ "\">" ^ e ^ "</a></li>") topics "" *)
-
-let header_custom template _linker archive =
-  Mustache.fold ~string ~section ~escaped:(Html.Renderer.archive archive) ~unescaped ~partial ~comment ~concat template
-  |> Html.header
-
-let header_default linker archive =
-  Html.(header [title [anchor (linker "/") [data archive.Logarion.Archive.Configuration.title]]])
-
-let meta meta =
-  let open Logarion.Meta in
-  let abstract = meta.abstract in
-  let authors = List.map (fun elt -> elt.Author.name) @@ AuthorSet.elements meta.authors in
-  let date = Date.(pretty_date @@ listing meta.date) in
-  let series = stringset_csv meta.series in
-  let topics = stringset_csv meta.topics in
-  let keywords = stringset_csv meta.keywords in
-  let uuid = Id.to_string meta.uuid in
-  Html.meta ~abstract ~authors ~date ~series ~topics ~keywords ~uuid
-
-let body_custom template note =
-  Mustache.fold ~string ~section ~escaped:(Html.Renderer.note note) ~unescaped ~partial ~comment ~concat template
-  |> Html.note
-
-let body_default note =
-  Html.note
-    [ Html.title [Html.unescaped_data note.Logarion.Note.meta.Logarion.Meta.title]; (* Don't add title if body contains one *)
-      meta note.meta;
-      Html.unescaped_data @@ Omd.to_html @@ Omd.of_string note.Logarion.Note.body ]
-
-let page ~style linker title header body =
-  Html.to_string @@ Html.page ~style linker title header body
-                
-let of_config config k = match config with
-  | Error msg -> prerr_endline ("Couldn't load [templates] section;" ^ msg); None
-  | Ok c ->
-     let open Confix.ConfixToml in
-     path c ("templates" / k)
-
-let converter default custom = function
-  | Some p ->
-     if Confix.Config.Path.path_exists p then custom @@ of_file p
-     else (prerr_endline @@ "Couldn't find: " ^ Fpath.to_string p; default)
-  | None -> default
-          
-let header_converter config = converter header_default header_custom @@ of_config config "header"
-let body_converter   config = converter body_default   body_custom   @@ of_config config "body"
-
-let default_style = Html.default_style
-
-let page_of_index ~style linker header archive metas =
-  page ~style linker ("Index | " ^ archive.Logarion.Archive.Configuration.title) (header linker archive) (Html.main (Html.listing_index "" metas))
-
-let page_of_log ~style linker header archive metas =
-  page ~style linker ("Log | " ^ archive.Logarion.Archive.Configuration.title) (header linker archive) (Html.main [Html.listing_texts "" metas])
-
-let page_of_note ~style linker header body archive note =
-  page ~style linker note.Logarion.Note.meta.Logarion.Meta.title (header linker archive) (body note)
-
-let page_of_msg ~style linker header archive title msg =
-  page ~style linker title (header linker archive) (Html.div [Html.data msg])
