Skip to main content
Participant
January 31, 2024
Question

Having problems modifying the HTML export

  • January 31, 2024
  • 2 replies
  • 212 views

Hi all,

 

I'm exporting .fml files into HTML. The exported HTML, for my case is 95% there, but there are a couple of issues that I need help with.

 

The figures in the document (images + their captions) are anchored frames and they're always exported as a single low-resolution image (an image that contains both the figure and its caption). In an ideal world, since the pictures are included as external files, i would get that external file location and caption as text in the HTML. 

 

But so far, I wasn't able to that. So I tried a couple of things:

- I tried to get the anchored frame id into the target HTML so that I can then pick the remaining anchor info from the mif file, but no luck there. I wasn't even able to get the id into the generated html.

- I'm able to programatically set the alt text for the Figure Anchored Frame (I was hoping to write the location of the original image + caption in there), but I cannot get that alt text into the generated HTML

- I tried creating a custom HTML conversion macro and that does get applied to the generated HTML, but I'm not sure on how to include variables to it. Ideally, to each anchored frame I would programatically attach a special variable (e.g. one for the figure path, one for the caption) and then that would be used when generating the target HTML. But so far I wasn't able to get it running. I'm able to write some standard variables (e.g. $paratext) into a normal paragraph's HTML, but no such luck with frames that fully get converted to an image.

 

Any tips would be welcome.

 

Thank you!

    This topic has been closed for replies.

    2 replies

    Participant
    February 1, 2024

    Thank you for the answers. I'm using the latest version of FM, the documents are unstructured. The images are imported eps files. I'm creating the HTML just by saving the HTML from Framemaker.

     

    In the meantime, I've made progress on my use case. I've used a mif -> XML converter (https://github.com/aebruno/mif2xml-j) and now i'm going through that XML file and creating the HTML "manually". So far so good. Hopefully i don't need to circle back for some reason 🙂

    Bob_Niland
    Community Expert
    Community Expert
    February 1, 2024

    re: The images are imported eps files.

    Browsers have no idea what to do with an EPS (and never will, since Adobe desires to sunset EPS).

    If you have a decent vector editor, such as Illustrator, you might be able to convert those EPS files to SVG, and perhaps even batch the process. SVG should be passed through as-is, and browsers know how to render it.
    …although lately I haven't been happy with the font rendering in the result, haven't taken the time to see what the font really is in the SVG, so have been setting Illustrator to convert to outlines for simple captions, credits & such.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    January 31, 2024

    Couple of questions - what version of FM? Structured or Unstructured? How are you putting the images in your FM doc - by copy or by reference? How are you creating the HTML - Publish to HTML5 or the old plain HTML mapping?

    Bob_Niland
    Community Expert
    Community Expert
    January 31, 2024

    And what graphics file formats (and content) are the images?
    If they can be re-cast (or perhaps just wrapped) as SVG, they might get passed through to HTML unmolested.