ocaml
0
fork

Configure Feed

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

rename Xml_tree.Resource => Xml_tree.Artefact

+23 -21
+2 -2
lib/compiler/Eval.ml
··· 390 390 T.{ type_ = "latex"; part = "body"; source = body } 391 391 ] 392 392 in 393 - let resource = T.{ hash; content; sources } in 394 - T.Content [T.Resource resource] 393 + let artefact = T.{ hash; content; sources } in 394 + T.Content [T.Artefact artefact] 395 395 in 396 396 let job = LaTeX_to_svg { hash; source; content } in 397 397 Jobs.modify (List.cons job);
+5 -5
lib/core/Xml_tree.ml
··· 118 118 | Remote of string 119 119 [@@deriving show, repr] 120 120 121 - type resource_source = { 121 + type artefact_source = { 122 122 type_: string; 123 123 part: string; 124 124 source: string 125 125 } 126 126 [@@deriving show, repr] 127 127 128 - type 'content resource = { 128 + type 'content artefact = { 129 129 hash: string; 130 130 content: 'content; 131 - sources: resource_source list 131 + sources: artefact_source list 132 132 } 133 133 [@@deriving show, repr] 134 134 ··· 145 145 | TeX_cs of TeX_cs.t 146 146 | Link of 'content link 147 147 | Img of img 148 - | Resource of 'content resource 148 + | Artefact of 'content artefact 149 149 | Iri of iri 150 150 | Datalog_script of (string, 'content vertex) Datalog_expr.script 151 151 | Results_of_datalog_query of (string, 'content vertex) Datalog_expr.query ··· 253 253 | CDATA str -> Format.fprintf fmt "%s" str 254 254 | KaTeX (_, xs) -> pp_content fmt xs 255 255 | TeX_cs cs -> pp_tex_cs fmt cs 256 - | Xml_elt _ | Transclude _ | Contextual_number _ | Results_of_query _ | Section _ | Prim _ | Link _ | Img _ | Resource _ | Iri _ | Datalog_script _ | Results_of_datalog_query _ -> 256 + | Xml_elt _ | Transclude _ | Contextual_number _ | Results_of_query _ | Section _ | Prim _ | Link _ | Img _ | Artefact _ | Iri _ | Datalog_script _ | Results_of_datalog_query _ -> 257 257 Reporter.fatalf Type_error "Cannot render this kind of content as TeX-like string" 258 258 259 259 let string_of_content =
+4 -4
lib/forest/Forest.ml
··· 70 70 analyse_content scope content 71 71 | KaTeX (_, content) -> 72 72 analyse_content scope content 73 - | Resource resource -> 74 - analyse_resource scope resource 73 + | Artefact artefact -> 74 + analyse_artefact scope artefact 75 75 | Datalog_script script -> 76 76 execute_datalog_script script 77 77 78 - and analyse_resource scope resource = 79 - analyse_content scope resource.content 78 + and analyse_artefact scope artefact = 79 + analyse_content scope artefact.content 80 80 81 81 and analyse_transclusion (scope : Iri.t) (transclusion : T.content T.transclusion) : unit = 82 82 match transclusion.target with
+1 -1
lib/forest/Json_client.ml
··· 3 3 4 4 type t = { 5 5 host: string; 6 - articles: T.content T.article list 6 + articles: T.content T.article list; 7 7 } 8 8 [@@deriving repr] 9 9
+3 -3
lib/forest/Legacy_xml_client.ml
··· 266 266 [P.txt ~raw: true "\\%s" @@ TeX_cs.show cs] 267 267 | Img img -> 268 268 [render_img img] 269 - | Resource resource -> 270 - [render_resource resource] 269 + | Artefact resource -> 270 + [render_artefact resource] 271 271 | Datalog_script _ -> [] 272 272 273 - and render_resource (resource : T.content T.resource) = 273 + and render_artefact (resource : T.content T.artefact) = 274 274 X.resource 275 275 [X.hash "%s" resource.hash] 276 276 [
+1 -1
lib/forest/Plain_text_client.ml
··· 23 23 | Section section -> pp_section fmt section 24 24 | Prim (_, content) -> pp_content fmt content 25 25 | Link link -> pp_link fmt link 26 - | Results_of_query _ | Results_of_datalog_query _ | Img _ | Resource _ | Datalog_script _ -> () 26 + | Results_of_query _ | Results_of_datalog_query _ | Img _ | Artefact _ | Datalog_script _ -> () 27 27 28 28 and pp_transclusion fmt (transclusion : T.content T.transclusion) = 29 29 pp_content fmt @@ F.get_content_of_transclusion transclusion
+2 -2
lib/frontend/DSL.ml
··· 47 47 modifier = Identity 48 48 } 49 49 50 - let resource content = 51 - X.Resource 50 + let artefact content = 51 + X.Artefact 52 52 X.{ 53 53 hash = ""; 54 54 content = Content content;
+4 -2
lib/frontend/Forester.ml
··· 193 193 194 194 let export ~env ~host ~asset_dirs : unit = 195 195 let@ () = Reporter.profile "Export forest" in 196 + let all_resources = List.of_seq @@ F.get_all_resources () in 197 + let all_articles = List.filter_map (function F.Article article -> Some article | _ -> None) all_resources in 198 + 196 199 let cwd = Eio.Stdenv.cwd env in 197 - let trees = FU.get_all_articles () in 198 - let result = Json_client.render_trees ~host trees in 200 + let result = Json_client.render_trees ~host all_articles in 199 201 let dir = Eio.Path.(cwd / "export" / host) in 200 202 Eio.Path.mkdirs ~exists_ok: true ~perm: 0o755 dir; 201 203 Eio.Path.save ~create: (`Or_truncate 0o644) Eio.Path.(dir / "forest.json") result;
+1 -1
test/dsl.ml
··· 28 28 tex "\\begin{}"; 29 29 link "https://git.sr.ht/~jonsterling/ocaml-forester" [txt "Forester"]; 30 30 img "img.png"; 31 - resource [txt "res"]; 31 + artefact [txt "res"]; 32 32 ] 33 33 34 34 let () = Format.printf "%a" (pp_content_node pp_content) content