Support relative paths for HTML headers/footers
See original GitHub issueCurrently several HTML parameters require absolute path values, which prevents portable cross-platform builds with the dita
command:
args.ftr
args.hdf
args.hdr
If absolute paths for these parameters are defined on one system, the same command/value may not work on other operating systems or machines where paths differ.
Allowing the dita
command to interpret relative paths in these cases would reduce the need for Ant or other build scripts to set paths with variables that resolve to the correct local path when the build runs.
These parameter values could then be passed in .properties
files that work on multiple systems, which is apparently not possible at the moment per comments in https://github.com/dita-ot/docs/pull/163:
WRT the absolute paths and properties file: cannot be fixed so that it will work every[w]here and will not break OT itself.
Various toolkit parameters currently use different approaches to path resolution. Perhaps the resolution mechanism for the HTML header/footer files could be aligned with one of these other approaches:
-
args.filter
Relative paths are resolved against the DITA-OT base directory (for backwards compatibility) and internally converted to absolute paths.
-
args.input
The path can be absolute, relative to
args.input.dir
, or relative to the directory where your project’s Ant build script resides ifargs.input.dir
is not defined.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
The only correct base path is the properties file when the properties are set in a properties file, and the current directory when set using
-D
.If those properties are made to support relative paths, it will only be at the outer API, i.e. in
dita
command. They will need to be resolved to absolute paths before the files are read by XSLT. Thus this will not automatically fix the case where you pass these properties with relative paths as a properties file to Ant. Ant will not convert these to absolute paths when it reads the properties files, thus it’s somewhat uncertain what will be used as the base path when XSLT resolves them. Withdita
command, we can convert those to absolute paths using the properties file as the base path.