Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /compare #11

Open
veganstraightedge opened this issue May 27, 2017 · 4 comments
Open

Add /compare #11

veganstraightedge opened this issue May 27, 2017 · 4 comments

Comments

@veganstraightedge
Copy link
Contributor

That shows the results of each of the parsers for a given URL.

Inspired by @willnorris' mf2 compare site.

https://willnorris.github.io/mf2compare

@sknebel
Copy link
Member

sknebel commented May 29, 2017

@Zegnat and I especially would like a version with a html-entry-box, not just a URL field. I'm not sure what would be the best way to implement it, but would try to help if I can. (I'd like to have this locally, but throwing all of it in a giant vagrant box afterwards should be doable. Being made for deployment on heroku at least keeps state away)

Since the parsers are running on subdomains (and different dynos I assume?), maybe adding an endpoint that returns pure JSON to each of them and fetch them from the browser would be a possible solution?

@Zegnat
Copy link
Member

Zegnat commented May 29, 2017

A good example of aggregating multiple parsers (IMHO) is MacFarlane’s Babelmark 2 for Markdown.

The way it communicates with different parsers is documented in its FAQ:

How can I add my markdown implementation to Babelmark 2?

Write a server app or CGI script that accepts accepts GET queries, takes the text out of the text parameter, and returns a javascript object with the following fields: name (the name of the markdown processor), version (the version being run), and html (the result of converting the text to HTML).

Example:

$ curl 'http://johnmacfarlane.net/cgi-bin/pandoc-dingus?text=hi'
{"name":"Pandoc","html":"<p>hi</p>","version":"1.9.4.2"}

The script can, if desired, return an error if the input text exceeds 1000 characters.

@veganstraightedge
Copy link
Contributor Author

@sknebel @Zegnat I'm open to pull requests.

@willnorris
Copy link

Come up with a protocol and I'll gladly update the Go parser.

Curious that Babelmark uses GET instead of POST... isn't the latter just as simple when doing XHR? Some other reason to use GET that I'm not thinking of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants