Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] opadoc: fix for files node

  • Loading branch information...
commit 03210d53e194a904570f6eee8743f226c26e93a3 1 parent e93e2a5
@Aqua-Ye Aqua-Ye authored
View
11 opadoc/common/opaDocComment.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
| [] -> []
View
15 opadoc/common/opaDocUtils.opa
@@ -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
+
}}
View
1  opadoc/generator/opaDocTree.opa
@@ -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 = {
Please sign in to comment.
Something went wrong with that request. Please try again.