this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Sidebar: Add a `hidden` value for `toc_status`.

authored by

Paul-Elliot and committed by jon.recoil.org db0a4ec2 9caa3cff

+36 -9
+7 -2
src/document/sidebar.ml
··· 6 6 url : Url.t; 7 7 valid_link : bool; 8 8 content : Inline.t; 9 - toc_status : [ `Open ] option; 9 + toc_status : [ `Open | `Hidden ] option; 10 10 } 11 11 12 12 open Odoc_index ··· 113 113 let name = Odoc_model.Paths.Identifier.name entry.id in 114 114 [ inline (Text name) ] 115 115 in 116 - { url; content; toc_status; valid_link = true } 116 + let valid_link = 117 + match entry.kind with 118 + | Page { toc_status = Some `Hidden; _ } -> false 119 + | _ -> true 120 + in 121 + { url; content; toc_status; valid_link } 117 122 in 118 123 let f x = 119 124 match x.Entry.kind with
+1 -1
src/document/sidebar.mli
··· 5 5 url : Url.t; 6 6 valid_link : bool; 7 7 content : Inline.t; 8 - toc_status : [ `Open ] option; 8 + toc_status : [ `Open | `Hidden ] option; 9 9 } 10 10 11 11 type t = entry Tree.forest
+1 -1
src/driver/landing_pages.ml
··· 25 25 26 26 let library ~dirs ~pkg ~index lib = 27 27 let content ppf = 28 - Format.fprintf ppf "%@toc_status open\n"; 28 + Format.fprintf ppf "%@toc_status hidden\n"; 29 29 Format.fprintf ppf "{0 Library [%s]}@\n" lib.Packages.lib_name; 30 30 let print_module m = 31 31 if not m.Packages.m_hidden then
+6 -1
src/html_support_files/odoc.css
··· 928 928 margin-bottom: 10px; 929 929 } 930 930 931 - .odoc-toc.odoc-global-toc > ul > li > ul > li > a { 931 + .odoc-toc.odoc-global-toc > ul > li > ul > li { 932 932 font-weight: 500; 933 933 font-size: 500; 934 + } 935 + 936 + .odoc-toc.odoc-global-toc > ul > li > ul > li > a { 937 + font-weight: inherit; 938 + font-size: inherit; 934 939 } 935 940 936 941 .odoc-toc.odoc-global-toc > ul > li > a {
+13 -3
src/model/frontmatter.ml
··· 5 5 type line = 6 6 | Children_order of child Location_.with_location list 7 7 | Short_title of short_title 8 - | Toc_status of [ `Open ] 8 + | Toc_status of [ `Open | `Hidden ] 9 9 10 10 type children_order = child Location_.with_location list Location_.with_location 11 11 12 12 type t = { 13 13 children_order : children_order option; 14 14 short_title : short_title option; 15 - toc_status : [ `Open ] option; 15 + toc_status : [ `Open | `Hidden ] option; 16 16 } 17 17 18 18 let empty = { children_order = None; short_title = None; toc_status = None } ··· 91 91 { Location_.value = `Paragraph [ { Location_.value = `Word "open"; _ } ]; _ }; 92 92 ] -> 93 93 Result.Ok (Location_.at loc (Toc_status `Open)) 94 - | _ -> Error (Error.make "@toc_status can only take the 'open' value" loc) 94 + | [ 95 + { 96 + Location_.value = `Paragraph [ { Location_.value = `Word "hidden"; _ } ]; 97 + _; 98 + }; 99 + ] -> 100 + Result.Ok (Location_.at loc (Toc_status `Hidden)) 101 + | _ -> 102 + Error 103 + (Error.make "@toc_status can only take the 'open' and 'hidden' value" 104 + loc) 95 105 96 106 let of_lines lines = 97 107 Error.catch_warnings @@ fun () -> List.fold_left apply empty lines
+1 -1
src/model/frontmatter.mli
··· 9 9 type t = { 10 10 children_order : children_order option; 11 11 short_title : short_title option; 12 - toc_status : [ `Open ] option; 12 + toc_status : [ `Open | `Hidden ] option; 13 13 } 14 14 15 15 val empty : t
+7
src/model_desc/lang_desc.ml
··· 718 718 (t.short_title 719 719 :> Comment.inline_element Location_.with_location list option)), 720 720 Option Comment_desc.inline_element ); 721 + F 722 + ( "toc_status", 723 + (fun t -> 724 + Option.map 725 + (function `Hidden -> "hidden" | `Open -> "open") 726 + t.toc_status), 727 + Option string ); 721 728 ] 722 729 723 730 and child =