diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-14 20:07:53 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-14 20:07:53 -0400 |
commit | d80f8013078387d18eace7d54f7caa7f8bddba4a (patch) | |
tree | b27f0e5cc0f4603d77cee9c4a3f33f34cd9691f3 | |
parent | 08803ecc602d4345642a8baa6843aff3d28e4d04 (diff) | |
download | roux-d80f8013078387d18eace7d54f7caa7f8bddba4a.tar.gz |
lesser hack to get rid of the css hack
-rw-r--r-- | doc/txt/txt.css | 13 | ||||
-rw-r--r-- | doc/txt/txt.ml | 16 |
2 files changed, 10 insertions, 19 deletions
diff --git a/doc/txt/txt.css b/doc/txt/txt.css index bb1bfd9..6f11930 100644 --- a/doc/txt/txt.css +++ b/doc/txt/txt.css @@ -7,16 +7,3 @@ h3 { background-color: white; padding-left: 0.7em; } - -/* Those two are hacks, they were added - for the Memory section of il.html - */ - -ul { - margin-bottom: 1em; - margin-top: 1em; -} - -ul:last-child { - margin: 0; -} diff --git a/doc/txt/txt.ml b/doc/txt/txt.ml index 9f4f082..5652e28 100644 --- a/doc/txt/txt.ml +++ b/doc/txt/txt.ml @@ -3,7 +3,7 @@ let dent = 4 type doc = item list and item = | Verb of string * string - | Par of string + | Par of (string * bool) | Ulist of doc list | Olist of doc list | Title of int * int * string @@ -119,6 +119,9 @@ let getverb lines idnt = f [] let getpar lines idnt = + let empty = function + | Some (_, _, l) -> String.trim l = "" + | _ -> false in let rec f ls = match top lines with | Some (n, i, l) @@ -128,9 +131,9 @@ let getpar lines idnt = && not (isulist l) -> pop lines; f (l :: ls) - | _ -> - List.rev ls |> - String.concat "\n" in + | t -> + String.concat "\n" (List.rev ls), + empty t in f [] let mergedoc = @@ -265,7 +268,8 @@ let rec dochtml titles d = let rec plist = List.iter begin fun d -> match d with - | Par p :: d -> + | Par (p, nl) :: d when + not nl || d = [] -> printf "<li>"; print pp p; printf "\n"; @@ -297,7 +301,7 @@ let rec dochtml titles d = else printf "<pre>\n"; escape v; printf "\n</pre>\n"; - | Par p -> + | Par (p, _) -> printf "<p>\n"; print pp p; printf "\n</p>\n"; in |