Skip to main content
Topic: Gist BBC (Read 5948 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Gist BBC

I think it would be cool to add a gist BBC here.

[gist https://gist.github.com/joshuaadickerson/fea8b2dd1a5ca756f6a0[/gist] would become <script src="https://gist.github.com/joshuaadickerson/fea8b2dd1a5ca756f6a0.js"></script> and would embed a gist in the page.

Add a hook on integrate_bbc_codes. Add a new file https://gist.github.com/joshuaadickerson/376d510c9d752e9b290a (a gist)

FYI: I wrote that function in the GH editor and didn't test it.
Last Edit: August 09, 2015, 08:35:01 am by Spuds
Come work with me at Promenade Group

Re: Gist BBC

Reply #1

Cool idea :D

Re: Gist BBC

Reply #2

There you go
[gist]https://gist.github.com/joshuaadickerson/376d510c9d752e9b290a[/gist]
Last Edit: August 09, 2015, 08:44:32 am by Spuds

Re: Gist BBC

Reply #3

I would validate the url starts with "https://gist.github.com", otherwise it would be a risk. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Gist BBC

Reply #4

Fair point ... removed it for now to be safe !

Code: [Select]
		'content' => '<script src="https://gist.github.com/$1.js"></script>',
and
Code: [Select]
			$data = parse_url($data, PHP_URL_PATH);
would probably do :/

Last Edit: August 09, 2015, 09:05:55 am by Spuds

Re: Gist BBC

Reply #5

What exactly is this ?

Re: Gist BBC

Reply #6

Guess so @Spuds !
Bugs creator.
Features destroyer.
Template killer.


Re: Gist BBC

Reply #8

Good catch @emanuele. Thanks @Spuds.

Now I think I'm much more likely to use Gist over code tags. Just a nicer way of presenting code and keeping track of the changes.

 

Re: Gist BBC

Reply #9

When I do
Code: [Select]
[gist]https://gist.github.com/joshuaadickerson/c528aae77d1cf0de029d[/gist]
I get
Code: [Select]
<script src="https://gist.github.com//joshuaadickerson/c528aae77d1cf0de029d.js"></script>


PS: how do you specify the language for code tags? Or is that not doable anymore?

Re: Gist BBC

Reply #10

Thats a big old gist ... looks like an extra / getting added.  I'll take a look tommorrow and see whats going on.

I can't remember on the code language, but pretty print is built in for the highlighting these days so it may have been depreciated.

Re: Gist BBC

Reply #11

Test:

[gist]https://gist.github.com/joshuaadickerson/c528aae77d1cf0de029d[/gist]

Re: Gist BBC

Reply #12

That's probably the longest message I have ever seen... #_#
~ SimplePortal Support Team ~

Re: Gist BBC

Reply #13

Yeah, I wonder if gist has a limit

Re: Gist BBC

Reply #14

I think it would worth adding it, at least for template sake ;D
~ SimplePortal Support Team ~