- From: Ben Werdmüller <ben@withknown.com>
- Date: Thu, 4 Dec 2014 12:21:13 +0000
- To: Dave Wilkinson <wilkie@xomb.org>
- Cc: Matthew Marum <vp-projects@opensocial.org>, James M Snell <jasnell@gmail.com>, "public-socialweb@w3.org" <public-socialweb@w3.org>
- Message-ID: <CABa5YQqtA8cut-ng0meenZs1H-H6ynWb=wDeQaUTQ_h2yWkakg@mail.gmail.com>
We've been considering various options for this in Known. I strongly disagree with using Markdown or similar syntax for human-readable content, because that creates a burden to support a wholly different notation in applications that are almost certainly web-based at some level. I do think HTML with embedded microformats / microdata is the most flexible option for this scenario. (It also doesn't tie applications into Twitter-style @-syntax - there's no need to let them dictate the convention.) Dave's approach for structured data also makes sense to me. You include the bare content, and then metadata that allows you to apply your own markup, rather than including some other microsyntax in bare text. That again gives application developers the most flexibility, although I would go so far as to change "username" to "@foo" in his example, to also allow different notations. It then becomes a simple search and replace, with a strong suggestion that usernames are prefixed with some notation to prevent accidents with greedy searches. On Wed, Dec 3, 2014 at 7:36 PM, Dave Wilkinson <wilkie@xomb.org> wrote: > How does this work when people put HTML as the content? Does this get > parsed before or after entities are parsed? What happens when agents that > see this as html don't parse them out? > > You'd have to really lock down how to parse the content field and what > is/isn't acceptable there and what to do to remove ambiguity when you > actually want some of that syntax to be untouched. > > I'd assume this isn't about routing. We have solutions for that. You just > tag the object with who is mentioned, who it is going to, what it is in > reply to, etc. > > This is just about marking up the content, which can currently be in any > form? Right now, you'd just have "@foo" in your content, and the object > would have an array of mentions which you would use to map the username to > a domain and you would just mark it up as you need to. The convention is to > look for an @ sign, although we don't (nobody does) specify the valid > characters for a handle. > > The only better way I can think of is not to enforce some new markup > language semantics within already arbitrary markup, but rather to just > simply place in that mentions array the position and length of the > substring in the content that represents the handle. Then I'd just replace > that substring with my markup, whatever that is for my purpose, or if I > don't care, I just display the content with whatever the publisher cared to > use ("<a></a>" tag, @foo, +foo, etc) and it would already be presentable. > Sooooo simple. > > My basic thesis: it's not content, it's metadata. while the html > microformat folks can get away with it, it seems very out of place here. > > (I admit I am not able to write AS2 just from memory) > > { > "content": "Hello @foo", > "mentions": [{ > "type": "person", > "url": "http://example.com/foo > "displayName": "Foo Bar" > "username": "foo", > "mentionedAt": [6, 4] > }] > } > > I can then turn that into "Hello <a href='http://example.com/foo'>Foo > Bar</a>" or "Hello @<a href='http://example.com/foo'>foo</a>" or "Hello > +<a href='http://example.com/foo'>foo</a>" or whatever. Conversely, if it > is html in the content, the substring would be the entire anchor tag, > maybe. It would be very obvious that it would always indicate the position > in the content before any processing is done. > > On Wed, Dec 3, 2014 at 2:14 PM, Matthew Marum <vp-projects@opensocial.org> > wrote: > >> The use of @[id|label]. >> >> Matt >> >> On 12/3/14, 12:48 PM, "James M Snell" <jasnell@gmail.com> wrote: >> >> >On Wed, Dec 3, 2014 at 9:25 AM, Matthew Marum >> ><vp-projects@opensocial.org> wrote: >> >[snip] >> >> >> >> "@[Users:seed_paul_id:Paul] can you please help with this opportunity?" >> >> >> >> >> >> The first two parts form a unique identifier within a Sugar instance >> and >> >> the final part is the display label. Frankly, I’m not sure why we >> >> wouldn’t use the precedent that Twitter API has established here in >> >>terms >> >> of syntax. I’ll leave any potential legal concerns to the lawyers. >> >> >> > >> >Which syntax specifically from the Twitter API? >> > >> >- James >> >> >> >> > -- *Ben Werdmuller* CEO & co-founder, Known withknown.com | werd.io <http://goog_1933028737> +1 (312) 488-9373 Known, Inc | 421 Bryant St | San Francisco, CA 94107
Received on Thursday, 4 December 2014 12:21:46 UTC