0

I would like to do the following:

  • Link to external source code file (for example a SQL script in ASCII format)
  • Automatically apply syntax highlighting to the imported text
  • Place the highlighted text inside a frame
  • Add a caption to the frame
  • Frame contents must always contain the contents of the external source

Is this possible? If so, how? I could not find any examples.

Thank you!

Dave Jarvis
  • 3,427

2 Answers2

0

I see what you need. Open a .odt then go to insert->object->OLE object. Then click create from file, choose the file and check link.

Once the object is created, right click and select activate OLE object outplace Do not resize or modify until you activate. Finally, if you have the right package installed (e.g. coooder), then select all the text inside of the OLE object and click the coooder button (Looks like: <>). It'll ask you for the language.

If you change the source file then reactivating the OLE object should update the information, but I had to redo the syntax highlight every time :|

There is a handy caption button when you click on an inactive OLE object, so...

This should get you where you want to be.

jnewman
  • 79
0

A work-around is to embed an image of the source code:

Convert HTML to image

From the OpenOffice users mailing list:

I expect that you will not find a fully automated working solution for your specific problem.

...

In a perfect world I suppose that you will setup a repository which you can then poll. Your document must then be set to update itself based on the files. Come to think of it, perhaps you can wet something so that the document can generate itself in some specified format. Seems doable if you have the skills.

Dave Jarvis
  • 3,427