idan / gistio

A gist-backed pretty display for markdown.
https://gist.io
MIT License
485 stars 41 forks source link

syntax highlighting & client-side querying #27

Closed doda-zz closed 10 years ago

doda-zz commented 11 years ago

this pushes all the work of requesting the Gist's contents, rendering them, applying the correct syntax highlighting and sanitizing the HTML to the client.

general thoughts reg. this approach

Advantages:

Disadvantages:

In general I think it's a great improvement since it greatly simplifies everything that happens on the server and even though I prefer doing Python over JS, it's nicer to have everything in one place instead of having it split between python on the server and JS on the client and constantly making sure the 2 match up.

doda-zz commented 11 years ago

the <code> tags still have the huge regular font, although I don't feel qualified making design decisions on the BDesignFL's project :) it already has github style syntax highlighting courtesy of highlight.js. other than that it's probably best to mimic github's sideways scrolling instead of line breaking

idan commented 11 years ago

@doda Any reason why you chose to use use showdown + santizier vs something like chjj/marked?

idan commented 11 years ago

@doda (asking for curiosity, not rhetorically)

doda-zz commented 11 years ago

looks good! i didnt know about it. what do you think about pushing the work to the client? i think i've detailed why i personally think it's preferable but i'd be curious to know what your opinions are.

idan commented 11 years ago

Has upsides and downsides, you hit them all.

With clientside, I can't easily cache rendered gists, and it is difficult to do private gists (but not impossible).

My hacking time is quite limited right now due to newborn, but I'm slowly working out a solution and pushing it.

idan commented 10 years ago

Syntax highlighting is implemented in a034ca16c9d814f7d099ec5664fab02eba2e50b7

Some changes coming up that make clientside not viable. Closing for now!