Skip to content

Commit 35410e3

Browse files
committed
update documentation for json index
Signed-off-by: Paul-Elliot <peada@free.fr>
1 parent f1a8d26 commit 35410e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/driver.mld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,11 @@ Some more details about the json format:
774774
{- ["display"], which is a json object. It contains two fields:
775775
{ul
776776
{- ["url"], a string. It is the URL to the entry in the documentation, relative to the base of the documentation}
777-
{- ["html"], also a string. It is the html odoc uses to display the entry in the search results.}}}}}}
777+
{- ["html"], also a string. It is the html odoc uses to display the entry in the search results.}}}
778+
{- Additionally, the ["occurrences"] field exists if and only if the [--occurrences] flag was given to the [odoc compile-index] command. When it exists, it contains a json object, with two fields:
779+
{ul
780+
{- ["direct"], an integer. It is the number of direct use of the entry. For instance, [open M] and [Make(M)] contain direct uses of [M], while [1 + M.v] contains an indirect use of [M] and a direct use of [M.v].}
781+
{- ["indirect"], an integer containing the number of indirect uses of the entry.}}}}}}
778782

779783
Search engines written in OCaml can also call the [Odoc_model.Fold.unit] and [Odoc_model.Fold.page] function, in conjunction with [Odoc_search.Entry.entry_of_item] in order to get an OCaml value of each element to be indexed.
780784

0 commit comments

Comments
 (0)