AttachFilePlugin - Is there anyway to edit the format of the output Tiddler ?

17 views
Skip to first unread message

AndyF

unread,
Apr 6, 2010, 10:16:06 AM4/6/10
to TiddlyWiki
Hi,

I have over 1,500 pdf files to be linked into TW using the
FileDropPlugin. This I have tested and am happy with the result (after
quite a bit of experimentation). My problem is the output tiddler. The
title is fine (the same as the pdf) but the issue I have is the
content....

usage
notes
type
file
url
data

As usage contains the actual link this is ok but can I change the
notation from 'usage' to 'Reference Document'. I'd like to keep notes
(but lose the 'attached by FileDropPlugin') but the others are not
required. Can the plugin (which I believe is the AttachFilePlugin) be
edited and if so how, by what means and what are the lurking dangers !

Many thanks for your help.

AndyF

PMario

unread,
Apr 6, 2010, 2:07:45 PM4/6/10
to TiddlyWiki
Hi Andy,

I tried, but there was no detailed testing!

NewTiddler: AttachFilePluginTuning tagged: systemConfig contains:

/*{{{*/
if (config.macros.attach) {
merge( config.macros.attach, {
tiddlerFormat: '!Reference Document\n{{{%0}}}\n/%\n!usage\n{{{%0}}}
\n%0\n!notes\n%1\n!type\n%2\n!file\n%3\n!url\n%4\n!data\n%5\n!end\n%/'
});
} // if ..
/*}}}*/


There should be 7 lines. The list will break the long line. you have
to fix it.
It should look something like this:

tiddlerFormat: ===looong=== !end\n%/'
});
} // if ..
/*}}}*/

What does it do:
Eric wisely put the tiddlerFormat: into a lingo section. Which means
it is open for translation. The procedure can be done as shown below.

tiddlerFormat: .. the variable name
' .. start of a string
!Reference Document .. TW syntax heading 1
\n .. a linebreak
{{{%0}}} .. %0 will be replaced by the plugin
\n .. linebreak
/% .. invisibility starts here
\n .. lbeak .. end of new data

.. the following lines where there in the plugin
!usage\n{{{%0}}}\n%0\n
!notes\n%1\n
!type\n%2\n
!file\n%3\n
!url\n%4\n
!data\n%5\n

!end .. needed if you include data into the tiddler
\n .. lb
%/ .. end of invisibility
' .. end of string

I didn't rename/delete !usage because I think it makes it more visible
what happens. I think you can rename it to "Reference Document" and
place the start of invisibility in front of !notes.

I wouldn't touch !notes ... because someone else may find it usful in
the future. See Info about NotesPlugin[1] below.

On Apr 6, 4:16 pm, AndyF <andy.fra...@mansys.net> wrote:
> snip ...
> ...I'd like to keep notes
Do you want to insert notes by program or by hand? If by hand, I would
suggest TiddlerNotesPlugin [1], because it doesn't change the original
tiddler. Editing an independent notes tiddler imho is more fail-safe
than editing the faluable original tiddler. Also comments plugin could
be used instead. It is more flexible.

TiddlerNotesPlugin can be placed into the ViewTemplate, and generates
a new Notes tiddler if edited.

> (but lose the 'attached by FileDropPlugin') but the others are not
> required. Can the plugin (which I believe is the AttachFilePlugin) be
> edited and if so how, by what means and what are the lurking dangers !

With the above procedure there is no need for changing the original
plugins.

I did a short test, and it did the job. If someone sees an error in my
thinking, please be so kind and post it.

kind regards
Mario Pietsch
[1] http://tw.lewcid.org/#TiddlerNotesPlugin

Reply all
Reply to author
Forward
0 new messages