A data type for plain text with links. As hypertext is to rich text, hyperstrings are to strings.
You can implement it in any language. Here's an example in Haskell:
newtype Hyperstring link = [Element]
data Element
= ElementString String
| ElementLink String
Almost certainly not, please point me to prior art if you know of it.
I don't like plain text very much, but billions of lines of plain text with implicit links already exist in the form of source code.
As the "don't stucture code as text" movement heats up I wanted a name for plain text with explicit links. It offers an interesting level of disruption/payoff compared to fully structured code, but I don't think it's getting enough consideration.
ElementString
must not be an empty string. The
Hyperstring
list must not contain two
ElementString
s in a row.
Encodes as a JSON Array.
Encodes as a JSON Object with a single key/value pair,
string
for strings and
link
for links.
A plain text document.
Unadorned plain text for strings, double-bracket links for links.
A plain text document:
(define (increment n) (+ n 1))
One way to represent this as hypertext (using the Haskell type from earlier):
[ ElementString "(define (increment n) ("
, ElementLink "+"
, ElementString " n 1))"
]
The equivalent Wikilinks representation:
(define (increment n) ([[+]] n 1))
The equivalent JSON:
[ {"string": "(define (increment n) ("}
, {"link": "+"}
, {"string": " n 1))"}
]