openSUSE / daps

DocBook Authoring and Publishing Suite (DAPS)
https://openSUSE.github.io/daps
Other
62 stars 19 forks source link

Provide a Method to Add Resource Files (CSS, JS, Images) [sf#102] #102

Closed tomschr closed 9 years ago

tomschr commented 9 years ago

Reported by tom_schr on 2012-08-31 11:45 UTC DAPS doesn't support "resource" files. A resource file in this ticket can be of type:

Currently, daps allows to add only one CSS file in the DC file or as a command line option. This method is a bit too restrictive as there might be situations where it is desirable to have more CSS files. For example, you want to maintain your CSS in different files or you need to incorporate a CSS file from a remote resource.

Apart from the CSS file(s), some layout needs JavaScript or image files. As they are not referenced directly in any DocBook source, they need to be kept separately.

Please investigate, how we could add these resource files to daps.

tomschr commented 9 years ago

Commented by tom_schr on 2012-10-19 13:06 After discussing this topic with Frank, we came up with the following structures in our xhtml/ subdirectory:

suse
 +-- xslt
     +-- xhtml
         +-- static (was: styles)
             +-- css
             +-- js
             +-- images

What does it mean?

Stefan, do you think this is useful?

tomschr commented 9 years ago

Commented by sknorr on 2012-10-19 13:35 Thanks, Tom & Frank. Sound good to me. I have two remarks:

And a final note: We should be very careful with symlinks in the resources. I think they're handled differently in Chrome/Chromium and Firefox. (Firefox seems resolve the symlink target and consequently finds resources that are referenced relatively from within the symlinked resource; Chrome doesn't seem to.)

tomschr commented 9 years ago

Commented by sknorr on 2012-10-19 13:43 Because my note above about symlinks probably isn't very clear, I'll try an example: Suppose we have symlinked the CSS file actual/path/style.css into the directory output/path/ where index.html expects it. Then suppose we have an image actual/path/image.png which is referenced relatively in style.css as "image.png". Firefox: notices that style.css actually comes from actual/path/ and finds image.png Chrome: thinks that style.css is located in output/path/ and won't find image.png Tom and Frank can't reproduce. Ignore this, then.

tomschr commented 9 years ago

Commented by tom_schr on 2012-10-19 14:41 I like the static name. :)

tomschr commented 9 years ago

Commented by tom_schr on 2012-10-22 06:29 Ok, basic static/ subdirectories created in suse/xslt/xhtml/ and suse/xslt_suse2/xhtml/ (see revision 2160).

tomschr commented 9 years ago

Commented by tom_schr on 2012-10-22 06:49 Ok, copied content in former contrib/layout/wip directory to suse/xslt_suse2/xhtml/ and created maintenance links. See revisions 2161-2163.

tomschr commented 9 years ago

Updated by fsundermeyer on 2012-12-06 15:06

tomschr commented 9 years ago

Commented by fsundermeyer on 2012-12-06 15:06 DAPS now (SVN commit 2341 (branch) supports a static/ directory.It needs to be placed directly in the STYLEROOT (and not in the html or xhtml subdirectory) and needs to have the following structure:

/static |--css/ |--images/ |--js/ Subdirectories in css/, images/, and js/ are allowed. If /static is detected it will automatically be used and all custom css declarations (--css or HTML_CSS) will be ignored. The standard DocBook way of providing images and CSS files is still supported - it will be used when no static/ directory is found. In this case you need to provide a css file with --css or HTML_CSS (otherwise no css link will be geneated in the HML).