Skip to content

Commit

Permalink
[fix] opadoc: fix for files node
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ye committed Oct 25, 2011
1 parent e93e2a5 commit 03210d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
11 changes: 1 addition & 10 deletions opadoc/common/opaDocComment.opa
Expand Up @@ -265,16 +265,7 @@ OpaDocComment =
content = file_content(fname) content = file_content(fname)


//do jlog(fname) //do jlog(fname)
len = String.length(fname) fname = OpaDocUtils.relative_path(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


match Parser.parse(private.extract, content) with match Parser.parse(private.extract, content) with
| [] -> [] | [] -> []
Expand Down
15 changes: 15 additions & 0 deletions opadoc/common/opaDocUtils.opa
Expand Up @@ -98,4 +98,19 @@ OpaDocUtils = {{
then String.replace(File.dir_sep, ".", p) then String.replace(File.dir_sep, ".", p)
else legacy_uri_of_path(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

}} }}
1 change: 1 addition & 0 deletions opadoc/generator/opaDocTree.opa
Expand Up @@ -280,6 +280,7 @@ OpaDocTree = {{


of_files(files) = of_files(files) =
aux(acc, path) = aux(acc, path) =
path = OpaDocUtils.relative_path(path)
key = {file = path} key = {file = path}
path_dot = OpaDocUtils.uri_of_path(path) path_dot = OpaDocUtils.uri_of_path(path)
node = { node = {
Expand Down

0 comments on commit 03210d5

Please sign in to comment.