After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 338860 - Export to Separate HTML Files
Export to Separate HTML Files
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
unspecified
Other Linux
: Normal enhancement
: Future
Assigned To: Tomboy Maintainers
Tomboy Maintainers
sandy[affects-ui]
Depends on:
Blocks:
 
 
Reported: 2006-04-18 06:43 UTC by Richard Laager
Modified: 2012-05-01 16:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Patch allowing commandline args to be parsed by add-ins (9.12 KB, patch)
2011-08-15 21:27 UTC, Robert Nordan
committed Details | Review
Patch to add info on html eport to --help option (1.03 KB, patch)
2012-04-27 08:30 UTC, Robert Nordan
committed Details | Review

Description Richard Laager 2006-04-18 06:43:23 UTC
I'd really love a way to say (especially from the command-line, silently, so I could use it in scripts), "Export the note named Ideas, recursively following links, and put each note in a separate file."
Comment 1 Boyd Timothy 2008-02-26 19:16:17 UTC
Setting the default assignee and QA Contact to "tomboy-maint@gnome.bugs".
Comment 2 Sandy Armstrong 2009-03-01 17:05:19 UTC
Past feature freeze. Pushing to next cycle.
Comment 3 Jared Jennings 2011-06-22 05:13:57 UTC
This bgo relates to #356871 and I wonder if it would take very much for Robert to add the command-line support?
Comment 4 Robert Nordan 2011-06-23 21:08:03 UTC
I've snooped around, and it seems to be quite possible to add this to the command line as any actions (like New Note etc.) are delayed until after add-ins are loaded. Presumably we would make the application quit after export to make it silent-like, although at any rate the tomboy icon will show up for a split second on the taskbar because of the aforementioned loading in.

The big question is one of principle: Should  we hard-code command-line actions referring to an add-in that may be disabled or missing? It would be easy to just check for that and return nothing, but should we have command-line options where we can't guarantee consistent behaviour?
Comment 5 Jared Jennings 2011-08-10 01:04:49 UTC
I could see returning a message "Not implemented". It's probably not "best practice", but surely it could be acceptable.
Comment 6 Robert Nordan 2011-08-14 22:35:34 UTC
I had a brainwave and came up with a better-practice way of doing it, which I've already implemented to the point of working with export locations without spaces. (Needs some more polish and error management to be finished.)

By making the TomboyCommandLine a public property of the NoteManager, all add-ins can hook up to an event which is fired when an arg starting with "--addin:" is encountered. They can then process these args as needed. For example, the ExportAllApplication add-in is now wired so that when you pass "--addin:XXXexportall /home/rpvn/exports/yay", the appropriate subclassed exporter will do a GUI-less export all to that location.

The great advantage of this method is that not only do we get command-line html export, but also export to any other format you like, and we will also have established a framework for arbitrary application add-ins to define command-line args.
Comment 7 Jared Jennings 2011-08-15 00:21:40 UTC
I like it.
Comment 8 Sandy Armstrong 2011-08-15 18:17:19 UTC
Sorry, command line arguments are processed before add-ins are loaded.  To do otherwise really hurts start up.  Any solution that involved command line arguments being passed to add-ins would need to prove that it didn't slow things down.
Comment 9 Robert Nordan 2011-08-15 18:39:26 UTC
I'm sorry, i may have formulated myself unclearly.

From what I can see, the actual argument parsing happens before add-in loading (indeed before most loading of anything), but any actions needing full Tomboy functionality like "Create New Note" are deferred until after loading is completed via a needsexecute bool set during parsing and an execute call after loading is complete. The way I'm setting it up, when the parsing finds an "addin:" a bool is set just like for the other tasks, and the event is fired during the execute call. I don't really think there will be any significant impact on start-up time. (But since the proof is in the pudding, the patch will soonish be ready for testing.)
Comment 10 Sandy Armstrong 2011-08-15 19:01:49 UTC
Ah, I see.  That makes sense, though I'm not sure how user friendly that is.  Still, better than nothing.
Comment 11 Robert Nordan 2011-08-15 21:27:45 UTC
Created attachment 193899 [details] [review]
Patch allowing commandline args to be parsed by add-ins

This patch is my proposed solution. I don't think it carries any significant performance penalty. The ExportAllAddin has been modified and will now accept the command --addin:html-export-all and --addin:html-export-all-quit for exporting all notes. (All Export All Add-ins will work with the --addin:XXX-export-all  format, for example --addin:txt-export-all which works with my text exporter without any modifications to the add-in DLL.)
Comment 12 Jared Jennings 2012-04-26 01:34:03 UTC
Rob,
The example of --addin:html-export-all doesn't actually do anything yet right?

I also tried [1] with no results.
[1]tomboy --addin:txt-export-all ~/temp/tomboy/
Comment 13 Robert Nordan 2012-04-26 07:52:05 UTC
Erh, As far as I remember it worked properly when I submitted the patch. Just to be sure, you applied the patch manually before building? Because it has never actually been committed, since nobody followed up on it until now. Also, the relevant add-ins have to be installed and enabled.

It might actually be the ~ that isn't being handled correctly, but there should be an error printed when it fails.
Comment 14 Jared Jennings 2012-04-26 21:26:36 UTC
Ya, there was something up with my build. Here's the command lines I tried that worked for me.

tomboy --debug --addin:html-export-all /home/jjennings/temp/tomboy/html/
tomboy --debug --addin:html-export-all /home/jjennings/temp/tomboy/html2
tomboy --debug --addin:html-export-all-quit /home/jjennings/temp/tomboy/html-quit
tomboy --debug --addin:txt-export-all-quit /home/jjennings/temp/tomboy/txt-quit

The documentation of this will get a bit tricky.
Comment 15 Jared Jennings 2012-04-26 21:39:16 UTC
Review of attachment 193899 [details] [review]:

These changes have been committed. Shall the bug be closed out?
Comment 16 Robert Nordan 2012-04-27 07:34:05 UTC
I'll add some documentation to https://live.gnome.org/Tomboy/HowToCreateAddins on using command line arguments for add-ins, but maybe we should hold off with closing this bug entirely until we update the commandline --help argument to inform of the new options. I'll get right on that!
Comment 17 Robert Nordan 2012-04-27 08:30:59 UTC
Created attachment 212935 [details] [review]
Patch to add info on html eport to --help option

This patch adds some info to the --help command, Now I'd say we can close this bug.
Comment 18 Jared Jennings 2012-05-01 16:57:41 UTC
Review of attachment 212935 [details] [review]:

Committed a4a8b32174833f8351eb59ebbee8034710e90d87