From 69306f623915af591569cc8dfdbffe2ef32ee8b9 Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Mon, 19 Feb 2024 09:33:47 +0100 Subject: [PATCH] update documentation for json index Signed-off-by: Paul-Elliot --- doc/driver.mld | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/driver.mld b/doc/driver.mld index 614c4d99c0..e36ff31003 100644 --- a/doc/driver.mld +++ b/doc/driver.mld @@ -754,7 +754,11 @@ Some more details about the json format: {- ["display"], which is a json object. It contains two fields: {ul {- ["url"], a string. It is the URL to the entry in the documentation, relative to the base of the documentation} - {- ["html"], also a string. It is the html odoc uses to display the entry in the search results.}}}}}} + {- ["html"], also a string. It is the html odoc uses to display the entry in the search results.}}} + {- 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: + {ul + {- ["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].} + {- ["indirect"], an integer containing the number of indirect uses of the entry.}}}}}} 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.