Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
420 changes: 0 additions & 420 deletions src/voodoo-gen/generator.ml

This file was deleted.

9 changes: 0 additions & 9 deletions src/voodoo-gen/generator.mli

This file was deleted.

96 changes: 0 additions & 96 deletions src/voodoo-gen/link.ml

This file was deleted.

17 changes: 0 additions & 17 deletions src/voodoo-gen/link.mli

This file was deleted.

17 changes: 8 additions & 9 deletions src/voodoo-gen/markdown.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ let rec block : 'attr block -> intermediate = function
| Code_block (_, _a, b) ->
Bl
[
{ desc = Source [ Elt [ { desc = Text b; attr = [] } ] ]; attr = [] };
{
desc = Source ("markdown", [ Elt [ { desc = Text b; attr = [] } ] ]);
attr = [];
};
]
| Html_block _ -> Bl []
| Definition_list _ -> Bl []
Expand All @@ -68,16 +71,13 @@ let of_content content ~name ~url =
let items = List.map (function It x -> x | Bl x -> Text x) intermediate in
Ok
(match items with
| [] ->
Odoc_document.Types.Page.{ title = name; header = []; items = []; url }
| [] -> Odoc_document.Types.Page.{ preamble = []; items = []; url }
| (Heading _ as x) :: rest ->
Odoc_document.Types.Page.
{ title = name; header = [ x ]; items = rest; url }
Odoc_document.Types.Page.{ preamble = [ x ]; items = rest; url }
| _ ->
Odoc_document.Types.Page.
{
title = name;
header =
preamble =
[
Heading
{
Expand Down Expand Up @@ -111,10 +111,9 @@ let read_plain f url =
Ok
Odoc_document.Types.Page.
{
title = name;
url;
items = [ Text [ { desc = Verbatim content; attr = [] } ] ];
header =
preamble =
[
Heading
{
Expand Down
25 changes: 17 additions & 8 deletions src/voodoo-gen/rendering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,33 @@ let render_document ~output odoctree =
Format.fprintf fmt "%t@?" content;
close_out oc)
in
aux @@ Generator.render_content ~indent:false odoctree;
aux @@ Generator.render_toc ~indent:false odoctree;
aux
@@ Odoc_html.Generator.render
~config:
(Odoc_html.Config.v ~semantic_uris:true ~indent:false ~flat:false
~open_details:true ~as_json:true ())
odoctree;
Ok ()

let docs_ids parent docs =
Odoc_file.load parent >>= fun root ->
match root.content with
| Page_content odoctree -> (
match odoctree.Odoc_model.Lang.Page.name with
| `LeafPage _ -> Error (`Msg "Parent is a leaf!")
| `Page _ as parent_id ->
| { iv = `LeafPage _; _ } -> Error (`Msg "Parent is a leaf!")
| { iv = `Page (maybe_container_page, _); _ } as parent_id ->
let result =
List.map
(fun doc ->
let id =
let basename = Fpath.basename doc in
`LeafPage
(Some parent_id, Odoc_model.Names.PageName.make_std basename)
{
parent_id with
iv =
`LeafPage
( maybe_container_page,
Odoc_model.Names.PageName.make_std basename );
}
in
(id, doc))
docs
Expand All @@ -53,8 +62,8 @@ let otherversions parent vs =
match root.content with
| Page_content odoctree -> (
match odoctree.Odoc_model.Lang.Page.name with
| `LeafPage _ -> Error (`Msg "Parent is a leaf!")
| `Page (parent_id, _) ->
| { iv = `LeafPage _; _ } -> Error (`Msg "Parent is a leaf!")
| { iv = `Page (parent_id, _); _ } ->
let result =
List.map
(fun v -> `Page (parent_id, Odoc_model.Names.PageName.make_std v))
Expand Down
1 change: 1 addition & 0 deletions voodoo-gen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ build: [
dev-repo: "git+https://github.com/jonludlam/voodoo.git"
pin-depends: [
["pandoc.dev" "git+https://github.com/tatchi/opam-pandoc-bin#5eeb415c7023323045371ad803f88365c7003b38"]
["odoc.dev" "git+https://github.com/ocaml/odoc#503a2e895c211f555ff1a5e0ae11f2ab1697db73"]
]
1 change: 1 addition & 0 deletions voodoo-gen.opam.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pin-depends: [
["pandoc.dev" "git+https://github.com/tatchi/opam-pandoc-bin#5eeb415c7023323045371ad803f88365c7003b38"]
["odoc.dev" "git+https://github.com/ocaml/odoc#503a2e895c211f555ff1a5e0ae11f2ab1697db73"]
]