Importing HTML or PDF to TiddlyWiki 5

4070 views
Skip to first unread message

Tierney Coren

unread,
Apr 8, 2015, 11:08:00 AM4/8/15
to tiddl...@googlegroups.com
I would like to import sections of an HTML document (http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript) or a PDF of the same document into TiddlyWiki in an automated or semi-automated way. The best option I thought I had was to use the Markdown plugin, as I can convert the HTML to Markdown, but that plugin doesn't work anymore. Is there anything else I can try?

Eric Shulman

unread,
Apr 8, 2015, 11:24:51 AM4/8/15
to tiddl...@googlegroups.com
On Wednesday, April 8, 2015 at 8:08:00 AM UTC-7, Tierney Coren wrote:
I would like to import sections of an HTML document (http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript) or a PDF of the same document into TiddlyWiki in an automated or semi-automated way. The best option I thought I had was to use the Markdown plugin, as I can convert the HTML to Markdown, but that plugin doesn't work anymore. Is there anything else I can try?

TiddlyWiki5 supports full use of HTML syntax (except for embedded <script>...</script> and onXXX="..." event handlers), so you should be able to just copy/paste the HTML *source* into a tiddler, and then edit that tiddler's content to remove any unneeded syntax (like the <head>...</head> section).

PDFs are even easier... just drap-and-drop the PDF file onto your TiddlyWiki, and it will be inserted as a text-encoded-binary tiddler that can then be viewed either as a stand alone tiddler, or embedded in other tiddler content using {{NameOfPDFTiddler}}.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

"Inside TiddlyWiki: The Missing Manual"
Note: the IndieGogo funding campaign has ended,
but direct fundraising continues below...

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Alex Hough

unread,
Apr 8, 2015, 2:03:38 PM4/8/15
to TiddlyWiki
Eric,

in other words, dragging a pdf into TW inserts the text of the pdf into the tiddler.... as plain text?

Alex

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/63fb96ce-ed3c-4c40-9ed7-cb3b518569bb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Eric Shulman

unread,
Apr 8, 2015, 2:57:32 PM4/8/15
to tiddl...@googlegroups.com
On Wednesday, April 8, 2015 at 11:03:38 AM UTC-7, AlexHough wrote:
in other words, dragging a pdf into TW inserts the text of the pdf into the tiddler.... as plain text?

Nope.  It inserts the PDF as a binary file, stored using base64-text encoding.  When you view the PDF tiddler directly (or embed it via transclusion), it renders the PDF inline within your browser... but it's still a binary.  It's not plain text.

-e

Michael Wiktowy

unread,
Apr 8, 2015, 4:15:07 PM4/8/15
to tiddl...@googlegroups.com
Also, I have found that if the PDF is large enough or complex enough, your TiddlyWiki document will crash and burn. Small simple PDFs embed quite nicely.

A work-around that is a safer bet is to make a tiddler that is an external link to the document. It can be a relative file:// type link so you can keep everything in one directory tree. Then you can do all the transcluding/tagging/etc. that you can do if it was embedded without the crashiness.

I Frankensteined together a little helper tiddler from tips and tricks from people here to make these external links that I include as a tool in each document I create ... cut and paste the following into a tiddler and start linking.

/Mike

************

\define theTiddler() $(the_tiddler)$!!title


\define myconcat() $(t1)$$(t2)$


|!Filename |<$edit-text tiddler="$:/temp/ExternalLink" placeholder="filename" tag="input" type="text"/> |
|!Directory |<$edit-text tiddler="$:/temp/ExternalLink" field="directory" placeholder="directory" tag="input" type="text"/> |


''Filetype:'' <$select tiddler='$:/temp/ExternalLink' field='type' default='image/gif'>
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'>
<optgroup label={{!!group}}>
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]]'>
<option value={{!!name}}><$view field='description'><$view field='title'/></$view> (<$view field='name'/>)</option>
</$list>
</optgroup>
</$list>
</$select>


<$set name="t1" value={{$:/temp/ExternalLink!!directory}}>
<$set name="t2" value={{$:/temp/ExternalLink!!text}}>


_canonical_uri field = <<myconcat>>


<$reveal type="nomatch" text="" state="$:/temp/ExternalLink">
  <$reveal type="match" text={{$:/temp/ExternalLink}} state={{$:/temp/ExternalLink}}>
    <$button set="$:/temp/ExternalLink!!title" setTo={{$:/temp/ExternalLink}}>
<$action-setfield $tiddler="$:/temp/ExternalLink" $field="_canonical_uri" $value=<<myconcat>>/>
      Modify
    </$button>
    <$set name="the_tiddler" value={{$:/temp/ExternalLink}}>
    <$button setTo="$:/temp/ExternalLink" set=<<theTiddler>>>
      Fetch
    </$button>
    </$set>
  </$reveal>
  <$reveal type="match" text="" state={{$:/temp/ExternalLink}}>
    <$button set="$:/temp/ExternalLink!!title" setTo={{$:/temp/ExternalLink}}>
<$action-setfield $tiddler="$:/temp/ExternalLink" $field="_canonical_uri" $value=<<myconcat>>/>
      Create
    </$button>
  </$reveal>
</$reveal>
</$set>
</$set>

****************

Ed

unread,
Apr 19, 2015, 7:50:33 PM4/19/15
to tiddl...@googlegroups.com
Hi Eric,

What do you think of the PDF Macro solution of Tobias Beer, Method 2 [1],
so not making the PDF into a binary, but showing an external PDF with
<<pdf "path2PDF">> in a tiddler?

If you include many PDF's that way the file remains lighter isn't it?

BTW, haven't "seen" Tobias around here for quite some time, or so it seems to me.
Hi Tobias, were are you? 8-)))
Salut! Ed.
[1]http://tobibeer.github.io/tb5/#Embedded%20External%20PDF


Op woensdag 8 april 2015 20:57:32 UTC+2 schreef Eric Shulman:

Patrick Detzner

unread,
Apr 28, 2015, 9:09:55 PM4/28/15
to tiddl...@googlegroups.com
Is there a way to import a large, multiple page PDF into tw and have it create a tiddler for each page? The goal is to store the book page by page in tw with one tiddler to display or link to each page.

PMario

unread,
Apr 29, 2015, 4:06:49 AM4/29/15
to tiddl...@googlegroups.com
Hi Tierney,

Just to be sure.

Have you seen the license of the book: http://creativecommons.org/licenses/by-nc-nd/3.0/ in the very first paragraph?

I hope you know what
 
"NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material"
 
means.

So you are good to go if you cite _little_ parts of the book in your wiki, if you want to expose it on the web. aka. Fair Use ..

have fun!
mario


manoflinux

unread,
Aug 14, 2015, 5:56:46 PM8/14/15
to TiddlyWiki
This will allow you to embed files into your tiddly wiki.

http://filetotid.tiddlyspot.com/
Reply all
Reply to author
Forward
0 new messages