Interface to generate reactive documents using Tangle.

1,230 views
Skip to first unread message

Param Aggarwal

unread,
Jun 15, 2011, 6:58:26 AM6/15/11
to tangl...@googlegroups.com
Hi Bret,

I am working on an interface to paste a line of unreactive text and make it reactive. Unfortunately, I am young and don't know javascript very well. I have reached upto the point that the user marks the words that are inputs and the words that are outputs. I have also taken the ratio between them as input. But I am stuck how to generate the final code from this.

Please help.

(The files I have changed in the zip are the ones in the root folder. I use your wikipedia javascript to detect which word is clicked.)

Param
Tangle-0.1.0.zip

Frank Tisellano

unread,
Jun 15, 2011, 10:23:28 AM6/15/11
to Tangle Talk
Param,

Are you looking to make a generator (i.e., user creates document on
the site,
downloads a few files, and has a static reactive document) or are you
looking to make a sort of GUI reactive document editor (i.e., user
creates, edits, and uses the document right there on the site) or
both?

I think this could be really cool either way, but your answer will
determine what direction you'll need to go in with your JavaScript
implementation.

Frank
>  Tangle-0.1.0.zip
> 56KViewDownload

Param Aggarwal

unread,
Jun 15, 2011, 10:43:40 AM6/15/11
to tangl...@googlegroups.com
Hi Frank,

I am exploring a solution to Bret's idea here:
Explorable explanations won't catch on if they're difficult to author. Tools must be invented that enable and encourage authors to make their work explorable. Can it be almost as easy as writing static text?
The tool I'm trying to build would allow existing article authors on the web to copy-paste their existing static statements into the tool and paste back the corresponding javascript and HTML to their webpages. Thus making it easy to convert existing static articles on the web to be reactive. This is what I would like to accomplish. :)

Param

Frank Tisellano

unread,
Jun 15, 2011, 11:19:53 AM6/15/11
to tangl...@googlegroups.com
That sounds fantastic. If you'd be agreeable, I'd love to work with you on this and, in the end, create a Wordpress plugin that'd open creating reactive documents to a giant collection of folks publishing on the internet.

What do you think?

Param Aggarwal

unread,
Jun 15, 2011, 11:30:35 AM6/15/11
to tangl...@googlegroups.com
Oh boy! I was thinking small. A Wordpress plugin would be brilliant!!! I am totally in. This is gonna be great!

Frank Tisellano

unread,
Jun 15, 2011, 12:19:20 PM6/15/11
to Tangle Talk
Great! :) I think it'd be prudent to create a standalone version
first. I haven't had the time to really think through it, but I think
a couple of initial questions for a project like this would be:

1) What would this kind of interface look like?
Without having put much thought into it, I imagine a three-pane window
resembling the Apple Mail client. A sidebar (on the left, for this
example) could contain all of your tools, which you'd drag-and-drop
into the top pane on the right side, which could contain the "editing
environment," and the bottom pane on the right side could contain a
live, functional preview.

2) Who is our target audience?

3) How much flexibility does our target audience need? How can we best
strike a balance between ease-of-use and power that results in the
best experience for them?

Maybe we'll hop on Google Chat or IRC at some point soon to flesh this
out live. Very excited about this. :) I think the concepts that fuel
Tangle could be as important as the hyperlink in understanding and
creating relationships on the web. Let's talk more.

Bret Victor

unread,
Jun 15, 2011, 7:49:23 PM6/15/11
to tangl...@googlegroups.com
Param,

Great idea, and great start!

Instead of using my wikipedia-hover thing, I would just go with a normal text selection. See http://www.quirksmode.org/dom/range_intro.html for how to get the current selection. I would probably also go with buttons instead of hotkeys, at least for starters.

When user presses the button, get the selection, wrap it in a span, and add the attributes to the span as you are doing now. Then, you should be able to generate the final code simply by getting rootElement.innerHTML.

-Bret

> <Tangle-0.1.0.zip>

Param Aggarwal

unread,
Jun 15, 2011, 11:52:48 PM6/15/11
to tangl...@googlegroups.com
Frank,

1) Interface:
How about markup, the way Markdown works. The user will just mark-up
the relation between the text and then it can be parsed through to get
the code.

The user types:
3 {friends}(1:10) went out for a meal together. Their bill came to 25
{dollars}(1:100). Each person's share was $(=dollars/friends).

This is way more easier than interacting with a full-blown interface
for the user. And can be integrated into various blogging platforms
without another interface. Comments on this?

2) Target audience:
I think we can be safe to assume online blog writers for now.

3) Flexibility:
Yes, this is an important point. Lets limit ourselves to basic
mathematical relations, and toggle switches for now. Let's get the
basics implemented and look towards integration with platforms to get
the implementations out in the world.

Yes, your point about the concept behind Tangle being as important as
hyperlink is very true. This is big.

Param

Param Aggarwal

unread,
Jun 15, 2011, 11:56:19 PM6/15/11
to tangl...@googlegroups.com
Bret,

Thank you. Yes, you are right about selections and using a mouse. Just
select the word, click a button and it will become a tag-like thing.
Then when specifying the relation between these, as you type the
equation, the tag(variable) is recognized and substituted in the
equation.

Param

Bret Victor

unread,
Jun 16, 2011, 3:11:24 PM6/16/11
to tangl...@googlegroups.com
I think that extending Markdown itself to support Tangle relations is an interesting exercise and a good first step. I would suggest co-opting Markdown's link syntax, since Tangle variables kind of look like links, and the syntax is already well-known.

Markdown has two syntaxes for links -- inline and referenced:

This is a [link](http://somewhere.com).

This is a [link][id].
[id]: http://somewhere.com

With Tangle variables, it might look something like (inline):

[3](people 1-100) friends went out for a meal together.
Their bill came to [25](cost 0-25) dollars.
Each person paid [cost/people] dollars.

or (referenced):

[3][people] friends went out for a meal together.
Their bill came to [25][cost] dollars. my
Each person paid [costPerPerson] dollars.
[people]: 1-100
[cost]: 1-300
[costPerPerson]: cost/people

These aren't perfect, but the idea is that they would have the same flavor as Markdown links, with a minimum of additional syntax, but be able to co-exist with them.

Frank Tisellano

unread,
Jun 17, 2011, 1:22:42 PM6/17/11
to Tangle Talk
Anyone know of a good Markdown parser we could fork to add this
functionality?

Bret Victor

unread,
Jun 17, 2011, 1:35:10 PM6/17/11
to tangl...@googlegroups.com
I've hacked around with the original (Perl) Markdown before, and found it pretty easy: http://daringfireball.net/projects/markdown/

There's also the PHP implementation which is plugged into Wordpress: http://michelf.com/projects/php-markdown

But this JS version with live preview looks nice, and might be the best bet for prototyping a live editor: http://softwaremaniacs.org/playground/showdown-highlight

Eric Gonzalez

unread,
Jun 7, 2012, 8:02:46 PM6/7/12
to tangl...@googlegroups.com
I'm interested in your progress with regard to this project.  It sounds intriguing!

mdbar...@gmail.com

unread,
Jan 28, 2014, 4:33:13 PM1/28/14
to tangl...@googlegroups.com
I'm also interested and could maybe lend a hand (though I'm not a strong programmer). So...what's the progress? 

Benny Lichtner

unread,
Dec 20, 2014, 10:40:40 AM12/20/14
to tangl...@googlegroups.com, mdbar...@gmail.com
http://activemarkdown.org/ is related to this.

avidr...@gmail.com

unread,
Mar 12, 2019, 8:59:55 PM3/12/19
to Tangle Talk
Hi Param, did you take this further?

Rex

unread,
Jan 10, 2022, 12:56:08 PM1/10/22
to Tangle Talk
A little late to the party here, but I'm trying to do something like this now...

It's a little different, but maybe fits someone's needs.
Reply all
Reply to author
Forward
0 new messages