Skip to content
Snippets Groups Projects
Commit 4c60fef9 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

experimental export feature

parent 07c3a926
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,9 @@ my $toc; ...@@ -62,6 +62,9 @@ my $toc;
my $op_code; my $op_code;
my @PAR; my @PAR;
my $notebook;
my $export_path;
binmode (STDOUT, ':utf8'); binmode (STDOUT, ':utf8');
while (my $arg= shift (@ARGV)) while (my $arg= shift (@ARGV))
...@@ -77,6 +80,8 @@ while (my $arg= shift (@ARGV)) ...@@ -77,6 +80,8 @@ while (my $arg= shift (@ARGV))
print "op=[$op] val=[$val]\n"; print "op=[$op] val=[$val]\n";
if ($op eq 'note-path') { $note_dir= $val || shift(@ARGV); $note_dir_changed= 1; } if ($op eq 'note-path') { $note_dir= $val || shift(@ARGV); $note_dir_changed= 1; }
elsif ($op eq 'export-path') { $export_path= $val || shift(@ARGV); }
elsif ($op eq 'notebook') { $notebook= $val || shift(@ARGV); }
else else
{ {
usage(); usage();
...@@ -144,6 +149,10 @@ elsif ($op_code eq 'mergecheck') ...@@ -144,6 +149,10 @@ elsif ($op_code eq 'mergecheck')
my $merge_dir= shift (@PAR); my $merge_dir= shift (@PAR);
merge_check ($merge_label, $merge_dir); merge_check ($merge_label, $merge_dir);
} }
elsif ($op_code eq 'export')
{
export ($export_path, $notebook);
}
else else
{ {
usage(); usage();
...@@ -157,6 +166,38 @@ sub usage ...@@ -157,6 +166,38 @@ sub usage
exit; exit;
} }
sub export
{
my $path= shift;
my $nb= shift;
my $toc= setup_toc();
# print "toc: ", Dumper ($toc);
usage unless (defined ($path) && defined ($nb));
$toc->scan_dir();
my $rows= $toc->{_toc}->{data};
foreach my $row (@$rows)
{
next unless ($row->{notebook} eq $nb);
print "row: ", Dumper ($row);
my $target_fnm= $path.'/'.$row->{uuid}.'.note';
# print "target_fnm=[$target_fnm]\n";
system ('cp', $row->{fnm}, $target_fnm);
my @tom= ('tomboy', '--note-path', $path, '--addin:html-export-all-quit', '.'); # , $path);
print 'tom: [', join (' ', @tom), "]\n";
system (@tom);
unlink ($target_fnm);
# ZZZ
}
}
sub setup_toc sub setup_toc
{ {
$toc_file= join ('/', $note_dir, 'Tomboy-TOC.csv') unless (defined ($toc_file)); $toc_file= join ('/', $note_dir, 'Tomboy-TOC.csv') unless (defined ($toc_file));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment