question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support relative paths for HTML headers/footers

See original GitHub issue

Currently 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 if args.input.dir is not defined.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jelovirtcommented, Oct 17, 2017

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.

1reaction
jelovirtcommented, Oct 17, 2017

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. With dita command, we can convert those to absolute paths using the properties file as the base path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - wkhtmltopdf relative paths in HTML with redirected in/out ...
My problem is getting javascript, stylesheets and images to work by only specifying relative paths in the html. Right now I have it...
Read more >
HTML File Paths - W3Schools
A file path describes the location of a file in a web site's folder structure. ... A relative file path points to a...
Read more >
Export - Typora Support
Typora supports you to export current document into PDF, HTML, ... typora will convert to absolute path relative to current md file, ...
Read more >
HTML to PDF Headers & Footers in C#, Code Examples
ChromePdfRenderer(); // Build a footer using html to style the text // mergeable ... Note the use of BaseUrl to set a relative...
Read more >
Relative and Absolute Links - LibreOffice Help
This is the relative path, starting from the location of the file "index.html". On the provider's server, you would place the picture in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found