bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Improve appearance of gists in feeds #50

Closed GaryJones closed 1 year ago

GaryJones commented 10 years ago

Since we've usually cached the gist content, we should look how we can output this in a way that makes sense in feeds. This should be for feeds used pulled in and shown with RSS clients, but also in RSS-to-email services too.

bradyvercher commented 10 years ago

I've thought about this a bit in the past and I'm not sure it'll work with the data we have currently. Everything we're working with has already been processed for display and kinda relies on the style sheet to look decent. The one way it could possibly work is if we removed the line numbers when rendering in a feed, but I haven't tried this yet.

Otherwise, we'd need to fetch the raw code using the API, which would require oAuth for private Gists, then take care of all the custom file and line processing we're doing on the existing data.

GaryJones commented 10 years ago

I've not looked into it, but I was envisaging removing the line numbers, and then stripping all but line-breaking-related tags. I'm certainly not expecting syntax highlighting, which is what most of the markup would be for. Ideally to leave something like still readable:

<pre>
<code>
Some &lt;em&gt;escaped&lt;/em&gt; code here<br />
...
</code>
</pre>

=>

Some <em>escaped</em> code here
...
bradyvercher commented 10 years ago

Hmm, I didn't think about stripping the HTML. That seems like a much more viable approach if the white space can be preserved.