ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 2.0
38 stars 22 forks source link

Support adding ScreenTip text when creating links. #503

Closed e-shreve-ti closed 9 months ago

e-shreve-ti commented 11 months ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

The String.asLink(String) : org.obeonetwork.m2doc.element.MHyperLink service creates a hyperlink, allowing the caller to set the label and the destination. No other settings are possible.

Expected behavior

Provide a way to also specify the ScreenTip text (which can be done in Word if manually creating a link.) The input should be automatically trimmed to fit within the maximum ScreenTip length (250 characters I believe.) If there are other character limitations for the ScreenTip text it would be nice if the service made reasonable changes to the text or produced a useful error message.

Minimal reproduction of the problem with instructions

Not applicable.

What is the motivation / use case for changing the behavior?

I'm using links to link to other locations in the document. (Using links instead of bookmark references allows one to have a style for the link so the reader knows it is a link.) The space I have for the link text is short, so it is just a short identifier like "CL001" or "CG008", for readability I'd like to include additional information in the ScreenTip so that when the user hovers over the link they will get some idea of what the identifier represents.

Environment


M2Doc version: 3.2.1
Eclipse version: X.Y.Z
Platform version:   X.Y.Z

Others:

ylussaud commented 11 months ago

That seems like a nice feature to have. I don't have time to look into this right now, but I'll try to have a look before next release.

Note: You might be able to apply a style to your bookmarks by having a style in the template (an example).

ylussaud commented 11 months ago

I also opened #504 that could solve your initial problem.