File tree Expand file tree Collapse file tree 8 files changed +47
-37
lines changed
parent_id/missing_indexes.t
separate_doc_lib_folders.t Expand file tree Collapse file tree 8 files changed +47
-37
lines changed Original file line number Diff line number Diff line change @@ -863,7 +863,7 @@ end = struct
863863 Arg. (
864864 value
865865 & opt (some convert_fpath) None
866- & info [ " index " ] ~doc ~docv: " FILE.odoc-index" )
866+ & info [ " sidebar " ] ~doc ~docv: " FILE.odoc-index" )
867867
868868 let cmd =
869869 let syntax =
Original file line number Diff line number Diff line change @@ -68,9 +68,7 @@ let generate_odoc ~syntax ~warnings_options:_ ~renderer ~output ~extra_suffix
6868 ~sidebar extra file =
6969 (match sidebar with
7070 | None -> Ok None
71- | Some x ->
72- Odoc_file. load_index x >> = fun index ->
73- Ok (Some (Odoc_document.Sidebar. of_lang index)))
71+ | Some x -> Odoc_file. load_sidebar x >> = fun sidebar -> Ok (Some sidebar))
7472 >> = fun sidebar ->
7573 document_of_odocl ~syntax file >> = fun doc ->
7674 render_document renderer ~output ~sidebar ~extra_suffix ~extra doc;
Original file line number Diff line number Diff line change 2020 File " index.mld" , line 1 , characters 0 -40:
2121 Warning: (children) doesn't include ' omitted' .
2222
23- $ odoc html-generate -- indent -- index index . odoc-index -o _html _odoc/ pkg/ page-index. odocl
24- $ odoc html-generate -- index index . odoc-index -o _html _odoc/ pkg/ page-content. odocl
25- $ odoc html-generate -- index index . odoc-index -o _html _odoc/ pkg/ page-omitted. odocl
26- $ odoc html-generate -- index index . odoc-index -o _html _odoc/ pkg/ dir1/ page-index. odocl
27- $ odoc html-generate -- index index . odoc-index -o _html _odoc/ pkg/ dir1/ page-content_in_dir. odocl
28- $ odoc html-generate -- index index . odoc-index -o _html _odoc/ pkg/ dir1/ page-dontent. odocl
23+ Turn the index into a sidebar (removes all unnecessary entries)
24+ $ odoc sidebar-generate index . odoc-index
25+
26+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o _html _odoc/ pkg/ page-index. odocl
27+ $ odoc html-generate -- sidebar sidebar. odoc-sidebar -o _html _odoc/ pkg/ page-content. odocl
28+ $ odoc html-generate -- sidebar sidebar. odoc-sidebar -o _html _odoc/ pkg/ page-omitted. odocl
29+ $ odoc html-generate -- sidebar sidebar. odoc-sidebar -o _html _odoc/ pkg/ dir1/ page-index. odocl
30+ $ odoc html-generate -- sidebar sidebar. odoc-sidebar -o _html _odoc/ pkg/ dir1/ page-content_in_dir. odocl
31+ $ odoc html-generate -- sidebar sidebar. odoc-sidebar -o _html _odoc/ pkg/ dir1/ page-dontent. odocl
2932 $ odoc support-files -o _html
3033
3134 $ odoc_print _odoc/ pkg/ page-index. odocl | jq . frontmatter
Original file line number Diff line number Diff line change 88 $ odoc link _odoc/ page-bar. odoc
99 $ odoc link _odoc/ baz/ page-bli. odoc
1010 $ odoc compile-index -P _: _odoc
11+ $ odoc sidebar-generate index . odoc-index
1112
12- $ odoc html-generate -- index index . odoc-index -- indent -- output-dir _html _odoc/ page-foo. odocl
13+ $ odoc html-generate -- sidebar sidebar . odoc-sidebar -- indent -- output-dir _html _odoc/ page-foo. odocl
1314
1415Missing index for Baz makes it unclickable but use the ID for the name .
1516Root is used for the missing index in the unnamed root directory.
Original file line number Diff line number Diff line change @@ -23,12 +23,14 @@ Let's link it:
2323
2424Let's html-generate it (with a sidebar):
2525
26- $ odoc compile-index -P pkg: _odoc/ pkg/ -L libname: _odoc/ pkg/ libname -o sidebar. odoc-index
27- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ page-file. odocl
28- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ dir1/ page-my_page. odocl
29- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ dir1/ page-index. odocl
30- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ page-index. odocl
31- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ libname/ unit. odocl
26+ $ odoc compile-index -P pkg: _odoc/ pkg/ -L libname: _odoc/ pkg/ libname
27+ $ odoc sidebar-generate index . odoc-index
28+
29+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ page-file. odocl
30+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ dir1/ page-my_page. odocl
31+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ dir1/ page-index. odocl
32+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ page-index. odocl
33+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ libname/ unit. odocl
3234
3335Now, let 's see the result
3436
Original file line number Diff line number Diff line change @@ -23,12 +23,14 @@ Let's link it:
2323
2424Let's html-generate it (with a sidebar):
2525
26- $ odoc compile-index -P pkg: _odoc/ pkg/ doc/ -L libname: _odoc/ pkg/ lib / libname -o sidebar. odoc-index
27- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ doc/ page-file. odocl
28- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ doc/ dir1/ page-my_page. odocl
29- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ doc/ dir1/ page-index. odocl
30- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ doc/ page-index. odocl
31- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ lib / libname/ unit. odocl
26+ $ odoc compile-index -P pkg: _odoc/ pkg/ doc/ -L libname: _odoc/ pkg/ lib / libname
27+ $ odoc sidebar-generate index . odoc-index
28+
29+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ doc/ page-file. odocl
30+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ doc/ dir1/ page-my_page. odocl
31+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ doc/ dir1/ page-index. odocl
32+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ doc/ page-index. odocl
33+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ lib / libname/ unit. odocl
3234
3335Now, let 's see the result
3436
Original file line number Diff line number Diff line change 1212 $ odoc link -P pkg: _odoc/ pkg/ _odoc/ pkg/ page-index. odoc
1313 $ odoc link -P pkg: _odoc/ pkg/ _odoc/ pkg/ libname/ unit. odoc
1414
15- $ odoc compile-index -P pkg: _odoc/ pkg/ -L libname: _odoc/ pkg/ libname -o sidebar. odoc-index
16- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ page-file. odocl
17- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ dir1/ page-my_page. odocl
18- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ dir1/ page-index. odocl
19- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ page-index. odocl
20- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ libname/ unit. odocl
15+ $ odoc compile-index -P pkg: _odoc/ pkg/ -L libname: _odoc/ pkg/ libname
16+ $ odoc sidebar-generate index . odoc-index
17+
18+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ page-file. odocl
19+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ dir1/ page-my_page. odocl
20+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ dir1/ page-index. odocl
21+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ page-index. odocl
22+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ libname/ unit. odocl
2123
2224A json version of a sidebar can be obtained using the sidebar-generate command:
2325
24- $ odoc sidebar-generate -- json sidebar . odoc-index
26+ $ odoc sidebar-generate -- json index . odoc-index
2527 $ cat sidebar. json | jq
2628 {
2729 " pages" : [
Original file line number Diff line number Diff line change @@ -18,13 +18,15 @@ Since -L subfolders are omitted from -P roots, the index page should not be adde
1818 $ odoc link -P pkg: _odoc/ pkg/ _odoc/ pkg/ libname/ unit. odoc
1919 $ odoc link -P pkg: _odoc/ pkg/ _odoc/ pkg/ libname/ page-index. odoc
2020
21- $ odoc compile-index -P pkg: _odoc/ pkg/ -L libname: _odoc/ pkg/ libname -o sidebar. odoc-index
22- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ page-file. odocl
23- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ dir1/ page-my_page. odocl
24- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ dir1/ page-index. odocl
25- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ page-index. odocl
26- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ libname/ unit. odocl
27- $ odoc html-generate -- indent -- index sidebar. odoc-index -o html _odoc/ pkg/ libname/ page-index. odocl
21+ $ odoc compile-index -P pkg: _odoc/ pkg/ -L libname: _odoc/ pkg/ libname
22+ $ odoc sidebar-generate index . odoc-index
23+
24+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ page-file. odocl
25+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ dir1/ page-my_page. odocl
26+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ dir1/ page-index. odocl
27+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ page-index. odocl
28+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ libname/ unit. odocl
29+ $ odoc html-generate -- indent -- sidebar sidebar. odoc-sidebar -o html _odoc/ pkg/ libname/ page-index. odocl
2830
2931 $ cat html/ pkg/ index . html | grep odoc-global-toc -A 15
3032 <nav class="odoc-toc odoc-global-toc" >
You can’t perform that action at this time.
0 commit comments