@@ -36,26 +36,25 @@ let itemkind_str_pl (ik : itemkind) : string =
3636
3737
3838(* -------------------------------------------------------------------- *)
39- let md_pre_format ~( kind : string ) (s : string ) =
40- pre [txt s]
39+ let md_pre_format ~kind (s : string ) =
40+ match kind with | _ -> pre [txt s]
4141
4242let md_href_format (env : EcEnv.env ) (hr : Markdown.href ) : Html_types.phrasing elt =
4343 let il_format = Str. regexp " ^>\\ ([^|]+\\ )|\\ ([^|]+\\ )$" in
4444 if Str. string_match il_format hr.href_target 0 then
4545 let tkind = Str. matched_group 1 hr.href_target in
4646 let tname = Str. matched_group 2 hr.href_target in
47- (*
48- let tscope : string option = assert false in
49- let env =
50- match tscope with
51- | None -> env
52- | Some tscope ->
53- let tscope = EcSymbols.qsymbol_of_string tscope in
54- let tscope = EcEnv.Theory.lookup_path ~mode:`All tscope in
55- EcEnv.Theory.env_of_theory tscope env (* Merge with main to have this *)
56- in
57- *)
5847 let tqs = EcSymbols. qsymbol_of_string tname in
48+ Printf. eprintf " QSymbol: %s\t " (EcSymbols. string_of_qsymbol tqs);
49+ let env =
50+ match fst tqs with
51+ | [] -> env
52+ | [" Top" ] -> env
53+ | _ ->
54+ let ttopqs = EcSymbols. qsymbol_of_top tqs in
55+ let ttopp = EcEnv.Theory. lookup_path ~mode: `All ttopqs env in
56+ EcEnv.Theory. env_of_theory ttopp env
57+ in
5958 let ikstr, path =
6059 match tkind with
6160 | "Ty" | "Type" -> itemkind_str_pl `Type , EcEnv.Ty. lookup_path tqs env
@@ -68,11 +67,11 @@ let md_href_format (env : EcEnv.env) (hr : Markdown.href) : Html_types.phrasing
6867 begin
6968 match (EcEnv.Mod. lookup_path tqs env).m_top with
7069 | `Concrete (p , None) -> p
71- | `Concrete (_ , Some _ ) -> raise ( failwith " Linking to sub-modules not supported." )
72- | `Local _ -> raise ( failwith " Linking to local/declared modules not supported." )
70+ | `Concrete (_ , Some _ ) -> failwith " Linking to sub-modules not supported."
71+ | `Local _ -> failwith " Linking to local/declared modules not supported."
7372 end
7473 | "Th" | "Theory" -> itemkind_str_pl `Theory , EcEnv.Theory. lookup_path ~mode: (`All ) tqs env
75- | _ -> raise ( failwith " Invalid item/entity kind." )
74+ | _ -> failwith " Invalid item/entity kind."
7675 in
7776 Printf. eprintf " Root Path: %s\n " (EcPath. tostring (EcEnv. root env));
7877 Printf. eprintf " QSymbol: %s\t Path: %s\n " (EcSymbols. string_of_qsymbol tqs) (EcPath. tostring path);
@@ -82,8 +81,8 @@ let md_href_format (env : EcEnv.env) (hr : Markdown.href) : Html_types.phrasing
8281 else
8382 a ~a: [a_href (uri_of_string hr.href_target)] [txt hr.href_desc]
8483
85- let md_img_format (ir : Markdown.img_ref ) =
86- raise ( failwith " Image embedding not supported." )
84+ let md_img_format (_ : Markdown.img_ref ) =
85+ failwith " Image embedding not supported."
8786
8887let c_markdown (input : string ) (env : EcEnv.env ) =
8988 let input = Markdown. parse_text input in
@@ -133,7 +132,7 @@ let c_section_intro (gdoc : string list) (env : EcEnv.env) =
133132 let ids = " Introduction" in
134133 section ~a: [a_id ids; a_title ids; a_class [" intro-section" ]] [
135134 div ~a: [a_class [" intro-text-container" ]]
136- (List. map (fun s -> div ~a: [a_class [" item-details- par" ]] (c_markdown s env)) gdoc)
135+ (List. map (fun s -> div ~a: [a_class [" intro- par-container " ]] (c_markdown s env)) gdoc)
137136 ]
138137 ]
139138
@@ -201,7 +200,7 @@ let c_section_main ?(supthf : string option) (th : string) (lents : EcScope.doce
201200 let lents_ik = List. filter (fun ent ->
202201 match ent with
203202 | ItemDoc (_ , (md , ikp , _ , _ )) -> md = `Specific && ikp = ik
204- | SubDoc ((_ , (md , ikp , _ , _ )), _ ) -> ikp = ik) lents
203+ | SubDoc ((_ , (_ , ikp , _ , _ )), _ ) -> ikp = ik) lents
205204 in
206205 match lents_ik with
207206 | [] -> []
@@ -259,7 +258,7 @@ let emit_pages (dp : string) (th : string) (tstr : string) (gdoc : string list)
259258 | de :: docents' ->
260259 match de with
261260 | ItemDoc _ -> c_subpages ?supths ?supthf th docents'
262- | SubDoc ((sgdoc , (smd , sik , sth , _ )), sldocents ) ->
261+ | SubDoc ((sgdoc , (smd , _ , sth , _ )), sldocents ) ->
263262 let ststr = (if smd = `Abstract then " Abstract " else " " ) ^ " Theory " ^ sth in
264263 let stsupf =
265264 match supthf with
0 commit comments