Skip to content

Commit

Permalink
Provide an interface for ocamldoc's odoc_to_text module
Browse files Browse the repository at this point in the history
  • Loading branch information
shindere committed Jun 30, 2022
1 parent 614b114 commit 3ef7397
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 5 deletions.
14 changes: 10 additions & 4 deletions ocamldoc/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ odoc_info.cmi : \
../parsing/location.cmi \
../parsing/asttypes.cmi
odoc_latex.cmo : \
odoc_to_text.cmo \
odoc_to_text.cmi \
odoc_messages.cmi \
odoc_latex_style.cmo \
odoc_info.cmi \
Expand Down Expand Up @@ -806,7 +806,7 @@ odoc_test.cmx : \
odoc_args.cmx
odoc_texi.cmo : \
../typing/types.cmi \
odoc_to_text.cmo \
odoc_to_text.cmi \
odoc_messages.cmi \
odoc_info.cmi \
../parsing/asttypes.cmi
Expand Down Expand Up @@ -852,12 +852,18 @@ odoc_to_text.cmo : \
odoc_str.cmi \
odoc_module.cmi \
odoc_messages.cmi \
odoc_info.cmi
odoc_info.cmi \
odoc_to_text.cmi
odoc_to_text.cmx : \
odoc_str.cmx \
odoc_module.cmx \
odoc_messages.cmx \
odoc_info.cmx
odoc_info.cmx \
odoc_to_text.cmi
odoc_to_text.cmi : \
../typing/types.cmi \
odoc_types.cmi \
odoc_info.cmi
odoc_type.cmo : \
../typing/types.cmi \
odoc_types.cmi \
Expand Down
2 changes: 1 addition & 1 deletion ocamldoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OCAMLDOC_LIBA=odoc_info.$(A)

OCAMLDOC_LIBMLIS=$(addsuffix .mli,\
odoc_dep odoc_extension odoc_info odoc_text_lexer odoc_messages \
odoc_parameter odoc_type odoc_value)
odoc_parameter odoc_to_text odoc_type odoc_value)
OCAMLDOC_LIBCMIS=$(OCAMLDOC_LIBMLIS:.mli=.cmi)
OCAMLDOC_LIBCMTS=$(OCAMLDOC_LIBMLIS:.mli=.cmt) $(OCAMLDOC_LIBMLIS:.mli=.cmti)

Expand Down
96 changes: 96 additions & 0 deletions ocamldoc/odoc_to_text.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Sebastien Hinderer, projet Cambium, INRIA Paris *)
(* *)
(* Copyright 2022 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

(** Text generation. *)

class virtual to_text :
object
val mutable tag_functions :
(string * (Odoc_info.text -> Odoc_info.text)) list
method virtual label : ?no_:bool -> string -> string
method normal_class_params :
Odoc_info.Name.t -> Odoc_info.Class.t_class -> string
method normal_class_type : Odoc_info.Name.t -> Types.class_type -> string
method normal_class_type_param_list :
Odoc_info.Name.t -> Types.type_expr list -> string
method normal_cstr_args :
?par:bool ->
Odoc_info.Name.t -> Odoc_info.Type.constructor_args -> string
method normal_module_type :
?code:string -> Odoc_info.Name.t -> Types.module_type -> string
method normal_type : Odoc_info.Name.t -> Types.type_expr -> string
method normal_type_list :
?par:bool ->
Odoc_info.Name.t -> string -> Types.type_expr list -> string
method relative_idents : Odoc_info.Name.t -> string -> string
method relative_module_idents : Odoc_info.Name.t -> string -> string
method text_of_alerts :
Odoc_info.alert list -> Odoc_info.text_element list
method text_of_attribute :
Odoc_info.Value.t_attribute -> Odoc_info.text_element list
method text_of_author_list : string list -> Odoc_info.text_element list
method text_of_before :
(string * Odoc_info.text) list -> Odoc_info.text_element list
method text_of_class_kind :
Odoc_info.Name.t ->
Odoc_info.Class.class_kind -> Odoc_info.text_element list
method text_of_class_params :
Odoc_info.Name.t -> Odoc_info.Class.t_class -> Odoc_types.text
method text_of_class_type_kind :
Odoc_info.Name.t ->
Odoc_info.Class.class_type_kind -> Odoc_info.text_element list
method text_of_class_type_param_expr_list :
Odoc_info.Name.t -> Types.type_expr list -> Odoc_info.text_element list
method text_of_custom : (string * Odoc_info.text) list -> Odoc_info.text
method text_of_exception :
Odoc_info.Exception.t_exception -> Odoc_info.text_element list
method text_of_info :
?block:bool -> Odoc_info.info option -> Odoc_info.text_element list
method text_of_method :
Odoc_info.Value.t_method -> Odoc_info.text_element list
method text_of_module_kind :
?with_def_syntax:bool ->
Odoc_info.Module.module_kind -> Odoc_info.text_element list
method text_of_module_parameter_list :
(Odoc_info.Module.module_parameter * Odoc_info.text_element list option)
list -> Odoc_info.text_element list
method text_of_module_type :
Types.module_type -> Odoc_info.text_element list
method text_of_module_type_kind :
?with_def_syntax:bool ->
Odoc_info.Module.module_type_kind -> Odoc_info.text_element list
method text_of_parameter_description :
Odoc_info.Parameter.parameter -> Odoc_info.text
method text_of_parameter_list :
Odoc_info.Name.t ->
Odoc_info.Parameter.parameter list -> Odoc_info.text_element list
method text_of_raised_exceptions :
Odoc_info.raised_exception list -> Odoc_info.text_element list
method text_of_return_opt :
Odoc_info.text option -> Odoc_info.text_element list
method text_of_see : Odoc_info.see -> Odoc_info.text
method text_of_sees : Odoc_info.see list -> Odoc_info.text_element list
method text_of_short_type_expr :
Odoc_info.Name.t -> Types.type_expr -> Odoc_info.text_element list
method text_of_since_opt : string option -> Odoc_info.text_element list
method text_of_type_expr :
Odoc_info.Name.t -> Types.type_expr -> Odoc_info.text_element list
method text_of_type_expr_list :
Odoc_info.Name.t ->
string -> Types.type_expr list -> Odoc_info.text_element list
method text_of_value :
Odoc_info.Value.t_value -> Odoc_info.text_element list
method text_of_version_opt : string option -> Odoc_info.text_element list
end

0 comments on commit 3ef7397

Please sign in to comment.