Well...OK...here's one piece of the puzzle.
http://bernhardhaeussner.de/odd/json-escape/

The bl.ocks.org type thing would still be handy. ;) And perhaps making 
something like this and promoting it to (potential) CouchApp devs would also be 
wise.

Thanks for reading. ^_^

-----Original Message-----
From: Benjamin Young [mailto:[email protected]] 
Sent: Friday, November 13, 2015 9:18 AM
To: [email protected]
Subject: Simple Things

Hi all!

My head is full (after over half a decade) of doing CouchApp stuff, and I've 
got so much I want to share I keep putting it off until I've "got it all 
sorted." :-P But no more!! ;)

Here's one (of a countless host) of ideas / things / possible-actions for this 
little group of CouchApp-ers to consider hacking on, improving, etc, etc, etc.

CouchApp development is (still) like hiking with rocks in your shoes. The hike 
is still great! The vistas fabulous. The destination worth the trip. However! 
It's still more painful than it should be. :( Which, consequently, is why 
people don't often make it very far from the base camp...

One situation is hacking together a simple CouchApp from a browser-not 
something so advanced as what ddoc.me provides-but more like "copy/paste JS 
into some JSON for a show or update."

JSON (as you're all too well aware) doesn't support line breaks. Consequently, 
one of the major pain points when working with JS in JSON is escaping it to 
line breaks. Futon didn't do this. Fauxton still doesn't do this. Neither of 
them have editors for "updates" or "shows" or anything else CouchApp related. 
Ddoc.me (as mentioned) is fab for an "all in" environment, but I literally just 
want a copy/paste JS to "\n" escaped, JSON friendly field. :-P That's it. ;)

For instance. Here's a small Webhook supporting CouchApp I wrote 2 years ago 
(my how time flies...): http://github.com/bigbluehat/weblatch

Today, I wanted to install it into a Cloudant database. It's so tiny (smaller 
than this email...) that I didn't want to `git clone`, `couchapp push . 
http://...`<http://...%60> the thing. I just wanted to copy/paste the update 
function into the JSON editor...but of course, it doesn't do "\n" escaping, and 
waiting on that to be supported is...not worth the wait.

So...some options:

-          A small bl.ocks.org style service that takes GitHub and/or Gist URLs 
and turns them into CouchApp ready .json files-if they have a _id and/or 
.couchaprc maybe

-          A simple text field to paste JS into that outputs it as a "\n" 
escaped string (this one's easiest)

There are many more ideas beyond this (GitHub services, etc), but for now, I 
just want to paste some JS somewhere and get some JSON friendly text string on 
the other side. ;)

k. I'm done for now. I hope to make more time to catch up on the other threads, 
post more random thoughts from my fevered brain, and finally, finally, finally 
get CouchApps on their feet...sans rocks. ;)

Hug the family for me,
Benjamin
--
http://bigbluehat.com/

Reply via email to