Hello Peter,
You are right : nothing has been developped on Gendoc2 to handle correctly
images from RichText content.
On ODT documents, it is not possible currently.
But HTML content is handled natively by MS Word : images links are kept but are
image files are not embedded into the document, so the linked image file has to
be accessible.
I suppose that is not exactly what you expect : in this case, you actually have
to develop a new Acceleo service to split HTML documentation into paragraph or
images and do something like the following :
[for (XXX e : splitDocumentation(getDocumentation()))]
[if( e.isParagraph()]
[e/]
[else]
<image filePath='[e.getImageFilePath()/]'>
</image>
[/if]
[/for]
The problem is that for Acceleo to work correctly, XXX must be a VALID type
from a meta-model, type that we do not have currently.
The simplest solution we have found is to use the simplest type that you can
handle : String .
Combined with a specific notation (Ex. : "para://text of your paragraph" or
"img://image file path"),
and additional methods (Ex. : isParagraph(String), isImage(String) ,
getImageFilePath(String) ) ,
you can get the same behavior.
Please keep us in touch on this problem.
Note : The full description on how to create external bundles from your own
Java services is detailed in the Gendoc2 developer tutorial available here :
http://gforge.enseeiht.fr/docman/view.php/102/4045/TPC_GenDoc2_v1.1.0_developer_tutorial.pdf
Best regards,
Anne
De : [email protected]
[mailto:[email protected]] De la part de Topcased user
list where issues are discussed
Envoyé : jeudi 9 juin 2011 22:39
À : '[email protected]'
Objet : [Topcased-users] Translating HTML documentation with GenDoc2
I am creating Topcased tutorials using SysML
(http://thinksysml.org/Tutorials/index.html). I now want to use GenDoc2 to
export the tutorials in a .docx or .odt format. The problem is that the html
formatting and images I am using in the documentation properties are lost in
translation. I must use .getDocumentation().clean() to convert to strings. I
don't mind losing the text formatting but the images are critical to the
tutorial application.
It would seem that I need to write an Acceleo service to provide a more
sophisticated getDocumentation function. Has anyone already done this?
I am thinking that the service could break the documentation into a list of
objects (paragraphs and images) and return the list as a sequence. Then I could
use the Acceleo for-loop to go through the list and depending on whether the
object is a paragraph or an image, print the string or display the image. Are
there any examples of custom sequences like this?
Thanks, Peter
Peter L. Jackson
Director of Graduate Studies,
Systems Engineering Program
Professor,
School of Operations Research
and Information Engineering
Rhodes Hall 218
(607) 255-9122
[email protected]
________________________________
Ce message et les pièces jointes sont confidentiels et réservés à l'usage
exclusif de ses destinataires. Il peut également être protégé par le secret
professionnel. Si vous recevez ce message par erreur, merci d'en avertir
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant
être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra
être recherchée quant au contenu de ce message. Bien que les meilleurs efforts
soient faits pour maintenir cette transmission exempte de tout virus,
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne
saurait être recherchée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for
the addressee; it may also be privileged. If you receive this e-mail in error,
please notify the sender immediately and destroy it. As its integrity cannot be
secured on the Internet, the Atos Origin group liability cannot be triggered
for the message content. Although the sender endeavours to maintain a computer
virus-free network, the sender does not warrant that this transmission is
virus-free and will not be liable for any damages resulting from any virus
transmitted.
_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/cgi-bin/mailman/listinfo/topcased-users