Pages: 1
Print
Author Topic: Using custom image bullets  (Read 4887 times)
Scibert
Member

Posts: 25


« on: June 04, 2012, 11:21:48 AM »

We would like to use custom image bullets for <steps-unordered> elements rendered in XHTML. Although this can be achieved by modifying the commonltr.css file, that is by setting the list-style-image property of relevant <ul> tags, how do we let XMetaL 7.0 automatically include bullet images in WebHelp output?
« Last Edit: June 04, 2012, 11:30:01 AM by Scibert » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: June 04, 2012, 11:41:00 AM »

I'm not sure I understand the question as it seems that you have your solution already.

I think what I need to know to help you is: "What do you want output to generate that it is not already generating?"
Logged
Scibert
Member

Posts: 25


« Reply #2 on: June 04, 2012, 12:44:27 PM »

Hi Derek,

I found that if you place .gif files in the DITA_OT/resource folder, they are automatically included in the WebHelp output. However, .png and .jpg files are not included. So it seems that if you want to use custom image bullets in XMetaL (or the DITA Open Toolkit), you must use the .gif format.

If we did want to use .png of .jpg files though, is there any way to have them automatically published in WebHelp output?
« Last Edit: June 04, 2012, 12:49:06 PM by Scibert » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: June 04, 2012, 05:30:12 PM »

I see. That's not specific to WebHelp, that's the DITA OT outputting to the XHTML transtype, which is what WebHelp (and many of the other output types that the DITA OT supports, CHM, Eclipse Help, etc) use as the basis for its content (the HTML pages that are transformed from individual topics).

The DITA OT seems coded to copy only specific file types from that resource folder (CSS and GIF apparently). I'm not sure where that code lives but I suspect it would likely be in a Java file somewhere. Not sure how easy it will be to track that down.
« Last Edit: June 04, 2012, 05:32:15 PM by Derek Read » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #4 on: June 04, 2012, 05:35:34 PM »

Found it. This stuff is actually defined in the following file (thankfully not Java):
<DITA_OT>\build_preprocess.xml

The following contains hard coded file names to copy over from the "resource" folder:

 <target name="copy-flag" if="dita.input.valfile"
    description="Copy flag files">
    <copy todir="${dita.map.output.dir}">
      <fileset dir="${dita.resource.dir}"
        includes="delta.gif,deltaend.gif" casesensitive="no"/>
    </copy>
    <dita-ot-copy todir="${output.dir}" includes="${flagimagelist}" relativepaths="${relflagimagelist}" />
  </target>


The quick and dirty solution is to add your file names to the list of "includes".
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #5 on: June 04, 2012, 06:00:04 PM »

Note that, strictly speaking, that section of the file defines things for DITAVAL flags.

So, to be "clean" you might wish to add a new section to keep it separate from the standard DITA OT stuff:

<target name="copy-list-style-images" if="dita.input.valfile" description="Copy list style images for use by CSS in HTML">
    <copy todir="${dita.map.output.dir}">
      <fileset dir="${dita.resource.dir}" includes="mycustomimage1.jpg,mycustomimage2.jpg,mycustomimage3.jpg" casesensitive="no"/>
    </copy>
        <dita-ot-copy todir="${output.dir}" />
</target>


But then to have that called you would need to change the following line:

<target name="copy-files" depends="debug-filter, copy-image, copy-html, copy-flag, copy-subsidiary, copy-generated-files, copy-list-style-images" />
Logged
Scibert
Member

Posts: 25


« Reply #6 on: June 05, 2012, 11:11:01 AM »

Thanks, Derek! Your solution works.

I modified your code snippet to automatically include all files in the DITA_OT\resource folder:

<fileset dir="${dita.resource.dir}" includes="*.*" casesensitive="no"></fileset>

Do the <fileset> or <copy> elements have attributes to include subfolders as well? This would allow files to be organized in subfolders, which would automatically be included in WebHelp output.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #7 on: June 05, 2012, 03:20:13 PM »

I don't see anything obvious that would include sub-folders. There's no documentation for stuff at this level included with the DITA OT either, that I know of anyway.

Might be a good question to ask at a place where there are real DITA OT experts:
http://tech.groups.yahoo.com/group/dita-users/
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #8 on: June 05, 2012, 03:31:23 PM »

So, since this is ANT we should really be checking here:
http://ant.apache.org/manual/Types/fileset.html

I don't see anything mentioning sub-folders though. Seems like something that must be supported somehow. If I wasn't so busy I'd see if I can dig into this further right away. Might take me a while to hunt it down.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #9 on: June 05, 2012, 03:32:49 PM »

Just found this:
http://stackoverflow.com/questions/3423555/copy-content-of-subfolders-with-ant

See the top answer. I haven't tried it but seems reasonable.
Logged
Pages: 1
Print
Jump to: