From d80f8013078387d18eace7d54f7caa7f8bddba4a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Mar 2016 20:07:53 -0400 Subject: lesser hack to get rid of the css hack --- doc/txt/txt.css | 13 ------------- 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 "
  • "; print pp p; printf "\n"; @@ -297,7 +301,7 @@ let rec dochtml titles d = else printf "
    \n";
           escape v;
           printf "\n
    \n"; - | Par p -> + | Par (p, _) -> printf "

    \n"; print pp p; printf "\n

    \n"; in -- cgit 1.4.1