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

ignore_first_line attribute #60

Closed GaryJones closed 1 year ago

GaryJones commented 8 years ago

Syntax highlighting for a PHP gist can be added, by adding the <?php at the start. However, this may encourage folks to also copy that delimiter into the middle of their theme or plugin file, and adding a code comment or note about not copying it gets tedious.

One tip I like to do is [gist id="..." lines="2-9999" lines_start=1] so that the snippet does not show the first line, but still shows the line numbers counting from 1.

Would it make sense to have a boolean attribute that handles this? i.e.

[gist id="..." ignore_first_line=1]

... or ...

[gist id="..." ignore_first_line]

... is the shorthand for ...

[gist id="..." lines="2-9999" lines_start=1]

... or after #59 ...

[gist id="..." lines="2-" lines_start=1]