Commit Graph

37 Commits

Author SHA1 Message Date
Brandon Mathis
96f80ccfc2 Fixed typo in regex for pygments code 2013-04-09 12:11:50 -05:00
Brandon Mathis
269bc27acb Allow any non-whitespace character in language types for pygments code highlighting. Addresses #1166 2013-04-09 09:20:45 -05:00
Parker Moore
d52bf53cc7 Pygments error messages are now printed alongside ours. 2013-03-10 21:47:07 +01:00
Brandon Mathis
bfeeecea71 Improved error formatting and valid syntax directions. 2013-03-10 00:03:30 -06:00
Parker Moore
b456865c8c #highlight_failed now accepts tag name, and proper syntax 2013-03-10 02:06:02 +01:00
Parker Moore
66e7fb0bfb #highlight_failed in PygmentsCode 2013-03-10 01:44:32 +01:00
Parker Moore
8f7106c39b Colorizing fail message in Pygments code highlighting. 2013-03-10 00:24:52 +01:00
Parker Moore
1306ad83b9 Fail loudly when a pygments highlight fails. #990. 2013-03-10 00:17:43 +01:00
Jon Frisby
ffa9118e9c Grand whitespace cleanup. 2013-02-21 21:53:04 -08:00
Brandon Mathis
9994770225 Made it easy to optionally use RubyPython for pygments, closes #923 2013-01-13 23:03:55 -06:00
Brandon Mathis
a25787a204 Fixes for Redcarpet
- Removed unnecessary content filtering for escaping markdown
- Escaping codeblocks defaults to false and can be enabled by passing escape:true
- Backtick codeblocks are automatically escaped when using Textile
- Scoped styling of .highlight divs to figure elements
2013-01-03 11:36:51 -06:00
Keith Smiley
fb27cae6be fix nil path when not using gist cache 2013-01-03 08:45:59 -05:00
Brandon Mathis
5b99bbb004 updated gems and removed albino support for code plugins since the latest Jekyll uses pygments.rb 2012-12-29 01:52:38 -06:00
Brandon Mathis
8eac9cf471 Further simplified code plugins
- The highlight function now accepts only to variables: code, options.
- Extracting part of a code snippet is now a method of pygments_code.rb.
- Options assignment has been simplified for all code plugins.
2012-12-24 15:59:48 -06:00
Brandon Mathis
66a883f2af Improved highlighted code caching and performance
- Pygments caching is broken into a couple utility functions for greater flexibility.
- Now Gist cache files are hashed against their gist id and parameters.
- Raw gists are no longer cached, only processed gists.
- Gist caches are still stored in .gist-cache/ for more atomic cleanup.

Note: For the docs, caching speeds up generation by about 1800 milliseconds on my machine.
2012-12-24 13:51:05 -06:00
Brandon Mathis
ed186b18a2 More code snippet refactoring
- Each code snippet's html is now cached (before only pygments output was cached and html was being processed each time)
- Caching MD5 is based on code snippets as well as options.
- Fixed an issue where gist tags weren't specifying a default start line

Note: The caching change shaved 800 milliseconds off of the render time for the docs. For code heavy sites this should be a nice change.
2012-12-24 00:23:48 -06:00
Brandon Mathis
0fcbc225e4 Code plugin refactoring
- Unified handling of key, value options
- Added url, link_text, and title options
- Gists can now accept start, end, range, title, url, link_text, linenos and marks options
- Code accessibility improvements (hiding line numbers) #864
2012-12-23 00:38:52 -06:00
Brandon Mathis
977be3adea Fixed issue with stripping whitespace on code captions. Sleepy code. 2012-12-20 23:50:42 -06:00
Brandon Mathis
1a4119a039 Code blocks are now more accessible to screen readers. Fixes #864 2012-12-20 23:38:03 -06:00
Brandon Mathis
fad262d3c1 Merge pull request #880 from lucisferre/adds-cs-filetype-to-pygments-processing
Adds 'cs' filetype to pygments
2012-12-20 10:06:55 -08:00
Chris Nicola
72accb4e5d Fixes gist processing of 'cs' files 2012-12-20 09:11:51 -08:00
Brandon Mathis
6a964fec8f Improved code snippet support
- Static Gist embeds show titles and link to the Gist
- Stylesheets refactored to remove !important and references to Gist classes
- Renamed links for include code
- Removed sometimes incorrect title attribute on code snippet links
2012-12-20 00:37:27 -06:00
Brandon Mathis
1a96b235fc Now code blocks automatically escape liquid {{ and {% characters fixes #745 2012-09-06 11:10:32 -05:00
Brandon Mathis
28e99b3c38 Added plugins/config.rb for reading and writing _config.yml. Added option to use Albino and default Python Pygments by setting pygments:true in _config.yml 2012-06-15 12:50:44 -05:00
Brandon Mathis
0ce6655e02 Added escape for liquid tags {{ and {% so that Liquid doesn't barf when a language uses these characters. Closes #466 2012-06-11 01:08:12 -05:00
Brandon Mathis
cf0d5b80cf Improvements to code plugins
- Range options are now properly stripped out of code plugin markup
- Markers now add start and end class names for more style control
- code_block plugin properly passes markings in highlight options
- Deprecated title before file name syntax for include_code
2012-06-03 00:19:06 -05:00
Brandon Mathis
b867b0877d Refactored code plugins so that shared regexes are mixed in methods
Added option to mark one line or groups of lines in a code block

Relates to issue #584
2012-05-28 04:29:18 -05:00
Brandon Mathis
e16844af29 Improvements to Code embedding features
1. Removed lots of duplication
2. Added warnings and fixed some dim regex
3. New: set a start line number for any code snippet
4. New: set a start, end, or range for include_code
5. New: added option to disable line numbers linenos:false

Fixes #478 #484
2012-05-27 02:30:17 -05:00
Brandon Mathis
4de8189651 Fixed collision with render on pygments_code.rb 2012-05-24 10:18:44 -05:00
Brandon Mathis
33073156bc removed some duplication in the pygments highlight method. Ensured the backtick codeblock would match newline characters in regex 2012-05-22 00:00:15 -05:00
Frederic Hemberger
2043c543d2 Add utf-8 encoding option to Pygments highlighter, fixes #232 2011-10-21 09:23:56 +02:00
Frederic Hemberger
347e855ddc Fixes HTML validation issues with code highlighting 2011-09-18 13:55:35 +02:00
Frederic Hemberger
f6bf894387 Aligns naming of .pygments-cache, .gist-cache and .sass-cache 2011-09-18 13:45:25 +02:00
Brandon Mathis
358d02a4a7 centralized pygments aliases into pygments_code.rb. Added alias for .ru (ruby), which sort of fixes #108 2011-08-20 18:39:47 -04:00
Brandon Mathis
ef4a42f977 Codeblock regex improved to better detect extensions fixes #96, added support for tableizing non highlighted code blocks from liquid codeblock tag and backtick code blocks 2011-08-16 02:41:28 -04:00
Brandon Mathis
cb6442e624 fixed empty line stripping from codeblocks 2011-07-30 09:06:56 -04:00
Brandon Mathis
7b81aab5ac added support for pygments.rb removing dependency on pygments, added support for caching highlighted code from pygments.rb and added default line numbering. Javascript auto line numbering now only occurs for embedded gists 2011-07-26 23:36:42 -04:00