M2Doc balise issue

Hi everyone,
Using M2Doc 2.0 in Capella 1.3 gives be this strange behaviour :
While writing an actor’s description in my word file, the patern " " is inserted several time in the middle of the paragraph. Moreover, the

balise is by default displayed.
As anybody else experienced (and solved) this problem ?
regards,

Currently M2Doc does not work with descriptions in html formats. Only with descriptions as plain text.
To solve this problem I’ve implemented small M2doc service that removes all html tags from description.
Only hyperlinks are not removed from the descriptions. They are converted from html to M2Doc bookmarks references.
{m:element.getFormattedDoc()}
If you are intereseted I can upload this plugin. You will need to add it to dropins folder and
add property with plugin name to M2Doc template.

Thanks for sharing this, it looks quite useful, I would be interested to get it!
Stéphane

I will also be very interested to get that plugin !
As for the {m:element.getFormattedDoc()} to use to have hyperlink not removed, have one to insert it in the beginning of the document or every time you use an hyperlink ?
Thank you for your quick answer,
Julien

Atached to this message the plugin and template example
that can show how htmls tags from elements description can be removed when publishing document from M2Doc example.
To use this plugin and template

  1. Copy plugin into Capella 1.3.0 dropins folder
  2. Install M2Doc 2.0.2 into Capella 1.3.0
  3. Install M2Doc for Capella services (
    http://www.m2doc.org/capella/index.html)
  4. Create new example project In-Flight Entertainment System With M2Doc (File > New > Capella - M2Doc)
  5. Replace template Template LA Complete.docx in the project with the template in this message.
  6. Generate document using Template LA Complete.genconf from the example
    In the template attached template properties are added to use M2Doc services from the plugin attached.
    In the template {m:element.getFormatedDescription()} service is used to print documentation of elements.
    This version of plugin has an error with model element links handling.
    I will publish coorect plugin on Monday.
    Forgot to commit the right code from my work computer.
    After commit I will also publish a sorce code.

It works perfectly, thank you very much !
I will give you a feedback after using this on my personal project if I find any strange behaviour.
Once again, thanks for sharing this !
Regards,

Good to here it works. Thanks for testing.
Attached is the last version of the plugin.
It works with hyperlinks without errros.
All hyperlinks to model elements, diagrams are kept in the generated word documents.

Atached file is the source code for this M2DOC service.

Hello all,
Thank you a lot for this service for rich descriptions in M2Doc.
I tried to implement this new service in existing M2Doc templates.
I know you need to add the service in the word template, using the command “Edit Template properties”.
The template you provide list the new services you have developed (as shown in “template provided.PNG” enclosed).
However, when I try to add those services in an existing template, I find nothing in the tab services (as shown in “can’t add service.PNG”).
Does anyone know how to add services to M2Doc template??

I don’t know how to add service in interface.
I am adding services in the following way:

  1. rename template from *.docx to *.zip
  2. copy custom.xml from docProps subdirectory
  3. add new property at the beginning of the custom.xml file
    vt:lpwstrrds.capella.m2doc.services</vt:lpwstr>
  4. rewrite custom.xml in *.zip file with updated version
  5. rename *.zip to *.docx
    I assume that all properties’ fmtid should be unique.

Some
Some time ago i’ve discovered the possibility to create sub templates in M2Doc (version 2.0.2) and call them as functions inside main template and even recursively!
http://www.m2doc.org/ref-doc/1.0.0/index.html#write-a-templa te
A template construct is basically a block of template with parameters that can be called like a service. When the template construct is called its contents is inserted after all dynamic parts have been interpreted by M2Doc.
{m:template myTemplate(a : Integer, b : Integer)} …user block… {m:endtemplate}
This template can be called as follow using a simple query:
{m:1.myTemplate(3)}
Without template construct it’s very hard to generate hierarchical documents, for function hierarchyies for example.
Using templates it’s very easy to create reusable template blocks and construct hierarchical documents
Unfortunately there are some mistakes when using templates constructs:

  1. bookmark references from templates does not work when bookmark is not defined before the place where template is called. It works only when
    https://github.com/ObeoNetwork/M2Doc/issues/343
  2. I’ve tried to use {m:link …} to generate links but not bookmarks (see description in bug). Unfortunately links does not work when are used in templates
  3. There are some problems with tables when they are used in recursive templates
    Now I’ve started using template construct to generate hierarchical data values reqursively calling subtemplates.
    After bookmarks\links problems would be solved it will be possible to use m:template construct for other parts
Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.