Feature request - svg comment tag from the XML editor

Bug #1739230 reported by Fabien Fellay
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Wishlist
Unassigned

Bug Description

Please, add the ability of adding a SVG comment tag <!-- some comment --> directly from the Inkscape XML editor UI. So far, the XML editor UI seems to deal correctly with comments tags <!-- --> but there is no way to create a new one directly from the XML editor UI, forcing us to edit the SVG file with an external text editor, save and then only reopen the file with Inkscape. This is a bit tedious.

Inkscape 0.92.2 (5c3e80d, 2017-08-06), Windows 10 64 bits

Tags: xmleditor
Revision history for this message
Patrick Storz (ede123) wrote :

What would be the use case for this functionality (or rather what part are you missing that could not be covered in a better way by one of the metadata fields available in the document properties)?

Do you want to add a single comment somewhere at the top of the file or would you want to add comment nodes at arbitrary positions of the document?

This is also something that could likely be solved by using an extension.

As a workaround you could even add custom attributes to objects in the XML editor.

Reasons I'm a bit skeptical this would be useful for many users:
- XML comments are invisible for most users
  (most of them would not even be aware of them)
- XML comments are not really suitable to carry metadata
  (thats's what <metadata> is for)
- XML comments are not bound to XML nodes making
  their meaning kind of open to interpretation
In conclusion XML comments are mostly useful for humans looking at the text representation of the XML source - and that is not really how Inkscape is meant to be used.

tags: added: xmleditor
Changed in inkscape:
status: New → Incomplete
importance: Undecided → Wishlist
Revision history for this message
Fabien Fellay (fabien.fellay) wrote :

The initial request was to have the ability to add comment nodes at arbitrary positions in the document and not a single comment at the top (on the form of a new button 'add comment node' aside the existing button 'add new element node).

The background is the following: I created a gigantic A0 poster with a lot of different artworks the size of a A4 page inside it. Each artwork are organized in groups. For each artwork, some technical information on how they have been created are stored in <!-- --> comment tag just manually placed at the top of each groups. Of course, those comments are not meant to be seen by everybody but only by the people interested by how specifics artworks has been built (I often work in Inscape in parallel with XML editor to control and understand what I am doing).

Now I totally agree that this can be easily done by adding custom attribute to XML objects (new attribute to a group for example). But I feared that Inkscape would delete those new attributes if I unintentionally 'ungroup' the group containing the custom attribute (which is more likely to happen than one might initially think).

I also agree that several custom <metadata> elements or even some <desc> elements can be used in my case instead of <!-- --> comments. The proposal for the feature was rather to have a more feature-rich XML editor.

But I understand that 'less is more' or 'keep it simple' and I would not be disappointed if you decide to reject the feature (it seems I would be quite alone to use it, in a scenario that might be seen as marginal or not adequate).

Patrick Storz (ede123)
Changed in inkscape:
status: Incomplete → Triaged
Revision history for this message
Patrick Storz (ede123) wrote :

Thanks for clarifying.

Do you now you can add a <desc> to every object in "Objects Properties" (available from the context menu)?

For adding comments a Python extensions is still the easiest solution in my opinion. I attached a sample extensions which should do just what you need. To add a comment:
- Select a group / layer or any other object
- Select "Extensions -> Document -> Add comment..."
- Enter the comment text and press apply
  The comment will be added in front of the currently selecte object

Revision history for this message
Fabien Fellay (fabien.fellay) wrote :

Thank you very much for your support.

Revision history for this message
TylerDurden (8thrule) wrote :

The extension seems to work well here. :)
Inkscape 0.92.2 (5c3e80d, 2017-08-06), Win 8.1, 64bit

Revision history for this message
Fabien Fellay (fabien.fellay) wrote :

Sorry for the delay: yes, I confirmed that the extension just works well. Thank you very much. :)

Inkscape 0.92.2 (5c3e80d, 2017-08-06), Windows 10 64 bits

(Nevertheless, I still think this feature should be natively available in a release. This is only a personal opinion however...)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.