Permalink
Browse files

[fix] opadoc: clean + added some functions that might use some day

  • Loading branch information...
Aqua-Ye committed Oct 25, 2011
1 parent 4498056 commit 8334574fad06f9b128ceca580e23186117df4a00
Showing with 5 additions and 2 deletions.
  1. +1 −0 opadoc/generator/opaApiFile.opa
  2. +3 −2 opadoc/generator/opaDocTree.opa
  3. +1 −0 opadoc/opadoc.js
@@ -40,6 +40,7 @@ OpaApiFile = {{
path_name = String.concat(".", entry.path)
path_html = OpaDocUtils.sanitize_path("{entry.pkg}.{path_name}")
entry_html = (path_name, (entry, path_html, OpaDocUtils.uri_of_path(entry.fname))) : Entry.html
+ //do jlog("{entry_html.f2.f3}")
type_table =
match entry.code_elt with
| { value = { ty = opatype ; ... } } ->
@@ -214,7 +214,7 @@ OpaDocTree = {{
| [] -> leaf
| [hd|tl] ->
key = {module = hd}
- /* If a value with the same name (case insensitive) exists, suffix it
+ /* If a value with the same name (case insensitive) exists, suffix it
* with '_bis' */
/*(hd, path_name) =*/
/* if OpaDocTree.Map.exists((k, _ -> key_equals(k, key)), tree) then*/
@@ -345,6 +345,7 @@ OpaDocTree = {{
@private
json_of_node(label: OpaDocTree.node_kind, node: OpaDocTree.node)
: RPC.Json.json =
+ idify = identity // String.replace(".", "-", _)
json_children =
match node.tree with
| {none} -> []
@@ -359,7 +360,7 @@ OpaDocTree = {{
] }:RPC.Json.json)
]}:RPC.Json.json),
("attr", { Record = [
- ("id", { String = node.id }:RPC.Json.json),
+ ("id", { String = idify(node.id) }:RPC.Json.json),
("rel", { String = string_of_kind(node.kind) }:RPC.Json.json),
] }:RPC.Json.json)
] ++ json_children
View
@@ -69,6 +69,7 @@ function open_parent_node(id, scroll) {
if (node_id === "" && file.endsWith(".html"))
node_id = file.substr(0, file.length-5);
var node_anchor = "#node_"+node_id.replace(/\./g, "\\.");
+ //node_anchor = node_anchor.replace(/\\./g, "-");
$(node_anchor).parents().each(function(i, e) {
open_node($('#' + id), $(e));
});

0 comments on commit 8334574

Please sign in to comment.