#1417 util::PathEnv and DocCompiler

msl Sun 20 Feb 2011

Hi All,

I'm currently playing a bit more with the macports fantom config for noticed that when running build::BuildPod.doc an error (sys::IOErr: Cannot create dir: /opt/local/share/java/fantom/doc/blah) is thrown if the user can't write to the fantom install directory.

This is the case when using PathEnv to separate the core fantom install from their own pods, etc.

It looks like the fan doc compiler is writing to Env.homeDir (DocCompiler.fan:28), which in turn resolves to $FAN_HOME - ignoring the $FAN_ENV_PATH setting.

Should DocCompiler be using the same mechanism to generate paths for pods (ie $FAN_ENV_PATH/lib/fan/<NAME>.pod) to generate doc paths (ie $FAN_ENV_PATH/doc/<NAME>/)?

M

brian Sun 20 Feb 2011

I pushed a fix - changeset

Note: I deprecated BuildPod.outDir, it is replaced by BuildPod.outPodDir (since we now have a separate doc output dir)

msl Wed 23 Feb 2011

Thanks Brian - that's done the trick.

Although now the CSS/JS and links (eg to sys classes) are now all broken (nothing a few symlinks couldn't fix).

Looking through the various uses of docCompiler::UriMapper.toUri and docCompiler::HtmlGenerator.pathToRoot I don't think there's any reasonable way to replace the existing use of ".." while avoiding system specific absolute paths (atleast nothing that could be done anywhere near as quickly as a 10 line shell script).

So, in the interest of documenting the fix - for anyone using the MacPorts fantom installation, if you want your docs to work properly, you'll need to run:

ln -s $FAN_HOME/doc/doc.css $FAN_ENV_PATH/doc/doc.css
ln -s $FAN_HOME/doc/doc.js $FAN_ENV_PATH/doc/doc.js
for FILE in `ls $FAN_HOME/doc`
do
    if [ -d $FAN_HOME/doc/$FILE ]
    then
        ln -s $FAN_HOME/doc/$FILE $FAN_ENV_PATH/doc/$FILE
    fi
done

M

brian Wed 23 Feb 2011

Yeah with the way HTML links work everything is going to have be under one directory to have one HTML base work locally and on the file system.

A simpler solution to symlinking might be just copy/regenerate everything to working directory.

Also a future direction is that we are examining the documentation lifecycle and deployment in SkySpark (which is all based on fandoc) to be more dynamic with built-in search. That will likely make its way back into fantom where documentation is more of a dynamic WebMod than a static HTML compiler.

Login or Signup to reply.