gnc-register protocol?

Derek Atkins warlord at MIT.EDU
Mon Feb 9 14:58:56 EST 2009


Quoting "D. R. Evans" <doc.evans at gmail.com>:

> Derek Atkins said the following at 02/09/2009 10:10 AM :
>
>>>
>>> If that's not what I'm supposed to expect, what am I actually supposed to
>>> do with this HTML file?
>>
>> Send it to somebody to view the numbers?
>> Load it into a spreadsheet?
>
> But then why is it a *hypertext* document? Hypertext means that it has
> links that can be clicked to take me to a URL.

Because the HREFs aren't stripped by GtkHTML when the data is exported
out of GnuCash.

GnuCash uses an embedded HTML viewer for reports, and it hooks the
GnuCash-specific "protocols" in order to implement report-based
actions.  So internally it's using hypertext to perform actions on
the report like to open a register when you click on a report item.

However, when you export the report those internal markings are not
removed.   Why not?   Well, nobody complained about it before, and
it was easier to just not do it.  Also, it makes it easier to test
the report code when you can export and see what's being sent to
GtkHTML.

> It seems to me that there's a ginormous conceptual disconnect if one puts
> something that contains unusable-on-purpose links into a hypertext document.

They are not unusable-on-purpose..  They are 100% usable from within
GnuCash!   The issue is the export mechanism not stripping it out.

> The "protocol" portion of a URL is supposed to tell the browser what to do;
> in this case, the "gnc-register" protocol doesn't even seem to exist. So it
> shouldn't be an HTML document.
>
> (Or, I suppose one could have gnucash create an HTML document *without
> links*, if one just wants to be sure it will render in a browser. But as it
> stands, the HREFs seem [unless I'm misunderstanding something, which is
> certainly possible] to be completely useless -- and confusing to poor
> people like me who expect a semblance of the normal behaviour when one
> clicks on them.)

They are useless outside GnuCash, yes.

Feel free to send in a patch to get the report exporter to strip
out any HREFs.  I have no idea how hard adding that would be.

>  Doc

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-user mailing list