summaryrefslogtreecommitdiff
path: root/src/config_tree.mli
diff options
context:
space:
mode:
authorShon Feder <abathologist@gmail.com>2017-04-02 20:10:58 -0400
committerDaniil Baturin <daniil@baturin.org>2017-04-03 07:10:58 +0700
commit9cd999ca97788988902913a5d8b86bbd1ac1cf71 (patch)
tree04042e2f92fc2141b895d77fe935e66ffa46fcbb /src/config_tree.mli
parent12ea26cdd1f717b1204d42dcdd4612b4bf1b17a1 (diff)
downloadvyconf-9cd999ca97788988902913a5d8b86bbd1ac1cf71.tar.gz
vyconf-9cd999ca97788988902913a5d8b86bbd1ac1cf71.zip
T255: Add curly config renderer (#8)
* Add stand-alone config_tree renderer * Add tests for stand-alone config_tree renderer * Add renderer with reference tree * Add tests for Config_tree renderer with reftree * Update config files * Add refactoring functions and correct tests
Diffstat (limited to 'src/config_tree.mli')
-rw-r--r--src/config_tree.mli28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/config_tree.mli b/src/config_tree.mli
index 4da734e..f724df1 100644
--- a/src/config_tree.mli
+++ b/src/config_tree.mli
@@ -35,3 +35,31 @@ val is_inactive : t -> string list -> bool
val set_ephemeral : t -> string list -> bool -> t
val is_ephemeral : t -> string list -> bool
+
+(** Interface to two rendering routines:
+ 1. The stand-alone routine, when [reftree] is not provided
+ 2. The reference-tree guided routine, when [reftree] is provided.
+
+ If an {i incomplete} reftree is supplied, then the remaining portion of the
+ config tree will be rendered according to the stand-alone routine.
+
+ If an {i incompatible} reftree is supplied (i.e., the name of the nodes of
+ the reftree do not match the name of the nodes in the config tree), then the
+ exception {! Config_tree.Renderer.Inapt_reftree} is raised.
+
+ @param indent spaces by which each level of nesting should be indented
+ @param reftree optional reference tree used to instruct rendering
+ @param cmp function used to sort the order of children, overruled
+ if [reftree] specifies [keep_order] for a node
+ @param showephemeral boolean determining whether ephemeral nodes are shown
+ @param showinactive boolean determining whether inactive nodes are shown
+*)
+val render :
+ ?indent:int ->
+ ?reftree:Reference_tree.t ->
+ ?cmp:(string -> string -> int) ->
+ ?showephemeral:bool ->
+ ?showinactive:bool ->
+ t ->
+ string
+