two requests for SnapshotPlugin

5 views
Skip to first unread message
Message has been deleted

Tobias Beer

unread,
Aug 27, 2010, 4:41:20 PM8/27/10
to TiddlyWiki
Hi everyone, esp. Eric,

I have created a tiddler called Export that outputs a set of the
tiddlers that I want to export into an HTML file... something like
this

for each relevant tid {
out+='{{title{'+tid.title+'}}}\n';
out+=store.getTiddlerText(tid)+'\n\n';
}

Now, when I hit "snap" in my toolbar I would like to do the
following...

1) Have a StyleSheet added to the exported document, e.g. called
"StyleSheetExport", which only applies to the exported HTML, so that I
can override whatever needs correction. It's essentially one line of
code at the end of the head section in function getSnap of
SnapshotPlugin:

"out+=
fmt.format(['StyleSheetExport',store.getTiddlerText('StyleSheetExport')]);"

2) Since I have created anchors via html tags in my summary tiddler
preceeding all included tiddlers being named likewise, I would want
all tiddlyLinks to point to such anchors, instead of a blank
javascript command that doesn't do anything in the exported HTML,
since there is no more tiddlywiki underneath. Those anchors look like
this:

<html><a name="tiddlername" href="#">&nbsp</a></html>

In my Export tiddler I then applied the following jQuery statement to
the viewer in order to redirect all tiddlyLinks:

<script>jQuery('.viewer .tiddlyLink').each(function(i)
{el=jQuery(this);el.attr('href','#'+el.attr('tiddlyLink'));el.unbind('click');});</
script>

After that I would export the entire document.

Maybe either of those steps would be of interest to others as well...
in a more integrated fashion.

Cheers, Tobias.
Reply all
Reply to author
Forward
0 new messages