Permalink
Browse files

[fix] opadoc: fix for files node

  • Loading branch information...
1 parent e93e2a5 commit 03210d53e194a904570f6eee8743f226c26e93a3 @Aqua-Ye Aqua-Ye committed Oct 25, 2011
Showing with 17 additions and 10 deletions.
  1. +1 −10 opadoc/common/opaDocComment.opa
  2. +15 −0 opadoc/common/opaDocUtils.opa
  3. +1 −0 opadoc/generator/opaDocTree.opa
@@ -265,16 +265,7 @@ OpaDocComment =
content = file_content(fname)
//do jlog(fname)
- len = String.length(fname)
- path = "_build/" // FIXME: VERY specific to build !!!
- path_len = String.length(path)
- fname = match String.index(path, fname)
- {some=idx} ->
- match String.get_suffix(len-idx-path_len, fname)
- {some=s} -> s
- {none} -> fname
- end
- {none} -> fname
+ fname = OpaDocUtils.relative_path(fname)
match Parser.parse(private.extract, content) with
| [] -> []
@@ -98,4 +98,19 @@ OpaDocUtils = {{
then String.replace(File.dir_sep, ".", p)
else legacy_uri_of_path(p)
+ relative_path(fname) =
+ if not(OpaDocParameters.get().long_uris)
+ then fname
+ else
+ len = String.length(fname)
+ path = "_build/" // FIXME: VERY specific to build !!!
+ path_len = String.length(path)
+ match String.index(path, fname)
+ {some=idx} ->
+ match String.get_suffix(len-idx-path_len, fname)
+ {some=s} -> s
+ {none} -> fname
+ end
+ {none} -> fname
+
}}
@@ -280,6 +280,7 @@ OpaDocTree = {{
of_files(files) =
aux(acc, path) =
+ path = OpaDocUtils.relative_path(path)
key = {file = path}
path_dot = OpaDocUtils.uri_of_path(path)
node = {

0 comments on commit 03210d5

Please sign in to comment.