Href sub-document model (Martin Owens)
Hi Martin,
Let me start with telling that I'm thrilled that you're doing work on external <use> links and have some working code. I hope it will find its way into the 0.91 version as it will make my life so much easier.
However, while you're at it.
Three questions arise.
- Can this mechanism be used to add external CSS as well? I know Bruno Wick is working on that as well, but it seems you're on a roll here and would be the missing link (pun intended).
- Would it be possible to create a save option where such external files are concatenated into one big whopper of a file? Or even better, send it all to a single root file of users choice (oh joy!)? With some nice check marks to add or not CSS, external <USE> objects, etc? It would solve a problem for all those browsers that do not support external linking or have bugs*.
*(like webkit that supported external links till Chrome version 19 and then Blink had this nice regression that yet has to get solved. Opera works fine till version 12.5 and then they went Blink, Firefox can only handle links one directory level deep these days, sigh. I foresee a brighter future though)
- And the very whopper question that probably stretches your patience.. How about kicking all <use> objects to external files and style info to external CSS? <script> to external files? Again with switches for each type of export. I gather this to be a whole other ball game and probably not ready for 0.91, but what power would that give to Inkscape as authoring tool for web projects!
Ehm,.. sorry if this abuses the dev list as it sounds very much like something I should throw at the bugtracker wish list, but 95% of my request get timed out due to latency I experience in Chongqing, China, so I never manage to send something there. On the other hand, I think it is on topic.
Jubilant cheers,
Jelle Mulder
Message: 1 Date: Tue, 21 Jan 2014 11:09:58 -0500 From: Martin Owens <doctormo@...400...> Subject: [Inkscape-devel] Href sub-document model To: Inkscape Devel List inkscape-devel@lists.sourceforge.net Message-ID: <1390320598.10117.59.camel@...2056...> Content-Type: text/plain; charset="UTF-8"
Hey developers,
This is the model I'm going to implement for documents to reference other documents:
SPDocument { GSList *child_documents; SPDocument *parent_document;
// Parent of parents until parent == NULL; SPDocument *getRootDocument(); }
Then in uri-reference, check paths of existing child_documents, load the referenced document and add to child_documents. Set parent_document.
That should keep things consistant.
The idea here is that we'll use this to track documents referenced in <use tags> as well as <image tags> and attributes like 'marker-*: url(...);' but not for non-vector graphics used in the image tag.
Thoughts? Advice?
Best Regards, Martin Owens
I'll field your wish-list Jelle for others as well as yourself:
On Wed, 2014-01-22 at 04:31 +0800, Jelle Mulder wrote:
I hope it will find its way into the 0.91 version
There's no reason to think it won't make 0.91
- Can this mechanism be used to add external CSS as well? I know Bruno
Wick is working on that as well, but it seems you're on a roll here and would be the missing link (pun intended).
No, the css document loading must happen before the root document loads and there's some good solid ideas and code for doing that with libcroco. I have this particular item as my number 5 in a list of things to fix.
- Would it be possible to create a save option
This is a different but related feature and I do not have it on my roadmap. I'd be happy to work with any developer interested in it though.
How about kicking all <use> objects to external files and style info to external CSS? <script> to external files?
This is another different feature, also not on my roadmap, but even more disconnected from this particular work as it doesn't need C++ access. One could write a python extension to do it, and the reason is hasn't is that opening the file back would be impossible at the moment but in the future should be very doable. Any extension developer that wants to work on this should get in touch for details.
Martin,
On Wed, 2014-01-22 at 04:31 +0800, Jelle Mulder wrote:
- Would it be possible to create a save option where such external files
are concatenated into one big whopper of a file? Or even better, send it all to a single root file of users choice (oh joy!)? With some nice check marks to add or not CSS, external <USE> objects, etc? It would solve a problem for all those browsers that do not support external linking or have bugs*.
*(like webkit that supported external links till Chrome version 19 and then Blink had this nice regression that yet has to get solved. Opera works fine till version 12.5 and then they went Blink, Firefox can only handle links one directory level deep these days, sigh. I foresee a brighter future though)
There are security issues with externally linked files. The browser vendors enforce a "same origin" rule. If the file is on your local disk, the browsers are not smart enough to know that the linked files are of the same origin. You need to be running a local server. With this Chrome 32 works. With Firefox, set security.fileuri.strict_origin_policy to false in about:config and the restart.
To see that the browsers do support external links look at:
http://tavmjong.free.fr/SVG/EXTERNAL/external.svg
I've tested on Linux with:
Google Chrome 32 Firefox 26 Opera 12.16
Tav
On Wed, 2014-01-22 at 11:26 +0100, Tavmjong Bah wrote:
To see that the browsers do support external links look at:
http://tavmjong.free.fr/SVG/EXTERNAL/external.svg
I've tested on Linux with:
Google Chrome 32 Firefox 26 Opera 12.16
That's a pretty good test. I localised the files and ran them through inkview previous trunk and inkview now. We went from 3 included and 1 fuzzy image to 6 included and one broken image.
Now we just have to get those damn viewports working for image tags. I heard viewports were possible to create in inkscape so it shouldn't be too much work.
Martin,
participants (3)
-
Jelle Mulder
-
Martin Owens
-
Tavmjong Bah