Permalink
Browse files

New pygments styles.

See #38.
  • Loading branch information...
alexandrevicenzi committed Apr 23, 2016
1 parent e64eb37 commit b72e9e5536d7d3797bf13d07d993f0a40c692690
Showing with 1,684 additions and 5 deletions.
  1. +7 −0 CHANGELOG.md
  2. +14 −1 README.md
  3. +11 −1 gulpfile.js
  4. +17 −0 pygments/README.md
  5. +35 −0 pygments/generate.py
  6. +2 −0 pygments/requirements.txt
  7. +39 −0 static/pygments/algol.css
  8. +1 −0 static/pygments/algol.min.css
  9. +39 −0 static/pygments/algol_nu.css
  10. +1 −0 static/pygments/algol_nu.min.css
  11. +61 −0 static/pygments/autumn.css
  12. +1 −0 static/pygments/autumn.min.css
  13. +49 −0 static/pygments/borland.css
  14. +1 −0 static/pygments/borland.min.css
  15. +36 −0 static/pygments/bw.css
  16. +1 −0 static/pygments/bw.min.css
  17. +64 −0 static/pygments/colorful.css
  18. +1 −0 static/pygments/colorful.min.css
  19. +64 −0 static/pygments/default.css
  20. +1 −0 static/pygments/default.min.css
  21. +64 −0 static/pygments/emacs.css
  22. +1 −0 static/pygments/emacs.min.css
  23. +64 −0 static/pygments/friendly.css
  24. +1 −0 static/pygments/friendly.min.css
  25. +73 −0 static/pygments/fruity.css
  26. +1 −0 static/pygments/fruity.min.css
  27. +64 −0 static/pygments/github.css
  28. +1 −0 static/pygments/github.min.css
  29. +30 −0 static/pygments/igor.css
  30. +1 −0 static/pygments/igor.min.css
  31. +65 −0 static/pygments/lovelace.css
  32. +1 −0 static/pygments/lovelace.min.css
  33. +64 −0 static/pygments/manni.css
  34. +1 −0 static/pygments/manni.min.css
  35. +65 −0 static/pygments/monokai.css
  36. +1 −0 static/pygments/monokai.min.css
  37. +64 −0 static/pygments/murphy.css
  38. +1 −0 static/pygments/murphy.min.css
  39. +73 −0 static/pygments/native.css
  40. +1 −0 static/pygments/native.min.css
  41. +67 −0 static/pygments/paraiso-dark.css
  42. +1 −0 static/pygments/paraiso-dark.min.css
  43. +67 −0 static/pygments/paraiso-light.css
  44. +1 −0 static/pygments/paraiso-light.min.css
  45. +63 −0 static/pygments/pastie.css
  46. +1 −0 static/pygments/pastie.min.css
  47. +61 −0 static/pygments/perldoc.css
  48. +1 −0 static/pygments/perldoc.min.css
  49. +33 −0 static/pygments/rrt.css
  50. +1 −0 static/pygments/rrt.min.css
  51. +72 −0 static/pygments/tango.css
  52. +1 −0 static/pygments/tango.min.css
  53. +62 −0 static/pygments/trac.css
  54. +1 −0 static/pygments/trac.min.css
  55. +73 −0 static/pygments/vim.css
  56. +1 −0 static/pygments/vim.min.css
  57. +35 −0 static/pygments/vs.css
  58. +1 −0 static/pygments/vs.min.css
  59. +58 −0 static/pygments/xcode.css
  60. +1 −0 static/pygments/xcode.min.css
  61. +0 −2 static/stylesheet/pygments.min.css
  62. +2 −1 templates/base.html
View
@@ -1,3 +1,10 @@
## 1.2.0-dev
- [Update font-awesome](https://github.com/alexandrevicenzi/Flex/issues/31)
- [Added browser color configuration](https://github.com/alexandrevicenzi/Flex/pull/34)
- [Related posts](https://github.com/alexandrevicenzi/Flex/pull/27)
- [More Pygments Styles](https://github.com/alexandrevicenzi/Flex/issues/38)
## 1.1.1 ## 1.1.1
- [Bug in CSS with placement of "Newer Posts" button](https://github.com/alexandrevicenzi/Flex/issues/21) - [Bug in CSS with placement of "Newer Posts" button](https://github.com/alexandrevicenzi/Flex/issues/21)
View
@@ -1,4 +1,4 @@
# Flex [![Build Status](https://travis-ci.org/alexandrevicenzi/Flex.svg?branch=master)](https://travis-ci.org/alexandrevicenzi/Flex) # Flex [![Build Status](https://travis-ci.org/alexandrevicenzi/Flex.svg?branch=master)](https://travis-ci.org/alexandrevicenzi/Flex) [![Dependency Status](https://david-dm.org/alexandrevicenzi/Flex.svg)](https://david-dm.org/alexandrevicenzi/Flex)
A minimalist [Pelican](http://blog.getpelican.com/) theme. A minimalist [Pelican](http://blog.getpelican.com/) theme.
@@ -10,6 +10,7 @@ A minimalist [Pelican](http://blog.getpelican.com/) theme.
- SEO Best Practices - SEO Best Practices
- Open Graph - Open Graph
- Rich Snippets (JSON-LD) - Rich Snippets (JSON-LD)
- [Multiple Code Highlight Styles](https://github.com/alexandrevicenzi/Flex/wiki/Code-Highlight)
## Integrations ## Integrations
@@ -21,10 +22,22 @@ A minimalist [Pelican](http://blog.getpelican.com/) theme.
- [Piwik](http://piwik.org/) - [Piwik](http://piwik.org/)
- [StatusCake](https://www.statuscake.com/) - [StatusCake](https://www.statuscake.com/)
## Install
The recommend way to install is over [pelican-themes](https://github.com/getpelican/pelican-themes).
The `master` branch is the development branch. If you're happy with fresh new things and maybe sometimes (~most of time~) broken things you can clone the `master`, but I would recommend to you to clone a tag branch.
## Docs ## Docs
[Go to Wiki](https://github.com/alexandrevicenzi/Flex/wiki) [Go to Wiki](https://github.com/alexandrevicenzi/Flex/wiki)
## Contributing
Always open an issue before sending a PR. Talk about the problem/feature that you want to fix. If it's really a good thing you can submit your PR. If you send an PR without talking about before what it is, you may work for nothing.
As always, if you want something that only make sense to you, just fork Flex and start a new theme.
## Live example ## Live example
You can see how things looks like [here](https://blog.alexandrevicenzi.com/flex-pelican-theme.html). You can see how things looks like [here](https://blog.alexandrevicenzi.com/flex-pelican-theme.html).
View
@@ -18,4 +18,14 @@ gulp.task('cp', function () {
.pipe(gulp.dest('./static/font-awesome')); .pipe(gulp.dest('./static/font-awesome'));
}); });
gulp.task('default', ['less', 'cp']); gulp.task('pygments', function () {
return gulp.src(['./static/pygments/*.css', '!./static/pygments/*min.css'])
.pipe(minify())
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('./static/pygments'));
});
gulp.task('default', ['less', 'cp', 'pygments']);
View
@@ -0,0 +1,17 @@
# Pygments CSS generator
This is the correct way to generate all pygments CSS files.
## How to generate CSSs files
Before run `generate.py` remember to install all requirements.
This can done with `pip install -r requirements.txt`.
After this you can run `./generate.py`. Remember to run inside this folder.
Because it uses relative path to place inside `static/pygments` folder.
After that, go back to the Flex path and run `gulp pygments` to generate all `min.css` files.
## How to add new styles?
[See wiki](https://github.com/alexandrevicenzi/Flex/wiki/Code-Highlight#how-to-add-new-styles).
View
@@ -0,0 +1,35 @@
#!/usr/bin/env python
import os
from pygments.styles import get_all_styles
from pygments.formatters.html import HtmlFormatter
PYGMENTS_PATH = './../static/pygments'
def export():
if not os.path.exists(PYGMENTS_PATH):
os.makedirs(PYGMENTS_PATH)
styles = list(get_all_styles())
for style in styles:
print('Generating CSS for %s' % style)
opts = {
'style': style,
}
path = os.path.join(PYGMENTS_PATH, '%s.css' % style)
formatter = HtmlFormatter(**opts)
css_content = formatter.get_style_defs()
# little fix because pelican doesn't append background color.
css_content = css_content.replace('.hll', '.highlight')
with open(path, 'w') as f:
f.write(css_content)
if __name__ == '__main__':
export()
@@ -0,0 +1,2 @@
Pygments==2.1.3
pygments-style-github==0.4
View
@@ -0,0 +1,39 @@
.highlight { background-color: #ffffcc }
.c { color: #888888; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { font-weight: bold; text-decoration: underline } /* Keyword */
.ch { color: #888888; font-style: italic } /* Comment.Hashbang */
.cm { color: #888888; font-style: italic } /* Comment.Multiline */
.cp { color: #888888; font-weight: bold } /* Comment.Preproc */
.cpf { color: #888888; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #888888; font-style: italic } /* Comment.Single */
.cs { color: #888888; font-weight: bold } /* Comment.Special */
.kc { font-weight: bold; text-decoration: underline } /* Keyword.Constant */
.kd { font-weight: bold; font-style: italic; text-decoration: underline } /* Keyword.Declaration */
.kn { font-weight: bold; text-decoration: underline } /* Keyword.Namespace */
.kp { font-weight: bold; text-decoration: underline } /* Keyword.Pseudo */
.kr { font-weight: bold; text-decoration: underline } /* Keyword.Reserved */
.kt { font-weight: bold; text-decoration: underline } /* Keyword.Type */
.s { color: #666666; font-style: italic } /* Literal.String */
.nb { font-weight: bold; font-style: italic } /* Name.Builtin */
.nc { color: #666666; font-weight: bold; font-style: italic } /* Name.Class */
.no { color: #666666; font-weight: bold; font-style: italic } /* Name.Constant */
.nf { color: #666666; font-weight: bold; font-style: italic } /* Name.Function */
.nn { color: #666666; font-weight: bold; font-style: italic } /* Name.Namespace */
.nv { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable */
.ow { font-weight: bold } /* Operator.Word */
.sb { color: #666666; font-style: italic } /* Literal.String.Backtick */
.sc { color: #666666; font-style: italic } /* Literal.String.Char */
.sd { color: #666666; font-style: italic } /* Literal.String.Doc */
.s2 { color: #666666; font-style: italic } /* Literal.String.Double */
.se { color: #666666; font-style: italic } /* Literal.String.Escape */
.sh { color: #666666; font-style: italic } /* Literal.String.Heredoc */
.si { color: #666666; font-style: italic } /* Literal.String.Interpol */
.sx { color: #666666; font-style: italic } /* Literal.String.Other */
.sr { color: #666666; font-style: italic } /* Literal.String.Regex */
.s1 { color: #666666; font-style: italic } /* Literal.String.Single */
.ss { color: #666666; font-style: italic } /* Literal.String.Symbol */
.bp { font-weight: bold; font-style: italic } /* Name.Builtin.Pseudo */
.vc { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable.Class */
.vg { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable.Global */
.vi { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable.Instance */

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,39 @@
.highlight { background-color: #ffffcc }
.c { color: #888888; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { font-weight: bold } /* Keyword */
.ch { color: #888888; font-style: italic } /* Comment.Hashbang */
.cm { color: #888888; font-style: italic } /* Comment.Multiline */
.cp { color: #888888; font-weight: bold } /* Comment.Preproc */
.cpf { color: #888888; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #888888; font-style: italic } /* Comment.Single */
.cs { color: #888888; font-weight: bold } /* Comment.Special */
.kc { font-weight: bold } /* Keyword.Constant */
.kd { font-weight: bold; font-style: italic } /* Keyword.Declaration */
.kn { font-weight: bold } /* Keyword.Namespace */
.kp { font-weight: bold } /* Keyword.Pseudo */
.kr { font-weight: bold } /* Keyword.Reserved */
.kt { font-weight: bold } /* Keyword.Type */
.s { color: #666666; font-style: italic } /* Literal.String */
.nb { font-weight: bold; font-style: italic } /* Name.Builtin */
.nc { color: #666666; font-weight: bold; font-style: italic } /* Name.Class */
.no { color: #666666; font-weight: bold; font-style: italic } /* Name.Constant */
.nf { color: #666666; font-weight: bold; font-style: italic } /* Name.Function */
.nn { color: #666666; font-weight: bold; font-style: italic } /* Name.Namespace */
.nv { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable */
.ow { font-weight: bold } /* Operator.Word */
.sb { color: #666666; font-style: italic } /* Literal.String.Backtick */
.sc { color: #666666; font-style: italic } /* Literal.String.Char */
.sd { color: #666666; font-style: italic } /* Literal.String.Doc */
.s2 { color: #666666; font-style: italic } /* Literal.String.Double */
.se { color: #666666; font-style: italic } /* Literal.String.Escape */
.sh { color: #666666; font-style: italic } /* Literal.String.Heredoc */
.si { color: #666666; font-style: italic } /* Literal.String.Interpol */
.sx { color: #666666; font-style: italic } /* Literal.String.Other */
.sr { color: #666666; font-style: italic } /* Literal.String.Regex */
.s1 { color: #666666; font-style: italic } /* Literal.String.Single */
.ss { color: #666666; font-style: italic } /* Literal.String.Symbol */
.bp { font-weight: bold; font-style: italic } /* Name.Builtin.Pseudo */
.vc { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable.Class */
.vg { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable.Global */
.vi { color: #666666; font-weight: bold; font-style: italic } /* Name.Variable.Instance */

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,61 @@
.highlight { background-color: #ffffcc }
.c { color: #aaaaaa; font-style: italic } /* Comment */
.err { color: #FF0000; background-color: #FFAAAA } /* Error */
.k { color: #0000aa } /* Keyword */
.ch { color: #aaaaaa; font-style: italic } /* Comment.Hashbang */
.cm { color: #aaaaaa; font-style: italic } /* Comment.Multiline */
.cp { color: #4c8317 } /* Comment.Preproc */
.cpf { color: #aaaaaa; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #aaaaaa; font-style: italic } /* Comment.Single */
.cs { color: #0000aa; font-style: italic } /* Comment.Special */
.gd { color: #aa0000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #aa0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00aa00 } /* Generic.Inserted */
.go { color: #888888 } /* Generic.Output */
.gp { color: #555555 } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #aa0000 } /* Generic.Traceback */
.kc { color: #0000aa } /* Keyword.Constant */
.kd { color: #0000aa } /* Keyword.Declaration */
.kn { color: #0000aa } /* Keyword.Namespace */
.kp { color: #0000aa } /* Keyword.Pseudo */
.kr { color: #0000aa } /* Keyword.Reserved */
.kt { color: #00aaaa } /* Keyword.Type */
.m { color: #009999 } /* Literal.Number */
.s { color: #aa5500 } /* Literal.String */
.na { color: #1e90ff } /* Name.Attribute */
.nb { color: #00aaaa } /* Name.Builtin */
.nc { color: #00aa00; text-decoration: underline } /* Name.Class */
.no { color: #aa0000 } /* Name.Constant */
.nd { color: #888888 } /* Name.Decorator */
.ni { color: #880000; font-weight: bold } /* Name.Entity */
.nf { color: #00aa00 } /* Name.Function */
.nn { color: #00aaaa; text-decoration: underline } /* Name.Namespace */
.nt { color: #1e90ff; font-weight: bold } /* Name.Tag */
.nv { color: #aa0000 } /* Name.Variable */
.ow { color: #0000aa } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mb { color: #009999 } /* Literal.Number.Bin */
.mf { color: #009999 } /* Literal.Number.Float */
.mh { color: #009999 } /* Literal.Number.Hex */
.mi { color: #009999 } /* Literal.Number.Integer */
.mo { color: #009999 } /* Literal.Number.Oct */
.sb { color: #aa5500 } /* Literal.String.Backtick */
.sc { color: #aa5500 } /* Literal.String.Char */
.sd { color: #aa5500 } /* Literal.String.Doc */
.s2 { color: #aa5500 } /* Literal.String.Double */
.se { color: #aa5500 } /* Literal.String.Escape */
.sh { color: #aa5500 } /* Literal.String.Heredoc */
.si { color: #aa5500 } /* Literal.String.Interpol */
.sx { color: #aa5500 } /* Literal.String.Other */
.sr { color: #009999 } /* Literal.String.Regex */
.s1 { color: #aa5500 } /* Literal.String.Single */
.ss { color: #0000aa } /* Literal.String.Symbol */
.bp { color: #00aaaa } /* Name.Builtin.Pseudo */
.vc { color: #aa0000 } /* Name.Variable.Class */
.vg { color: #aa0000 } /* Name.Variable.Global */
.vi { color: #aa0000 } /* Name.Variable.Instance */
.il { color: #009999 } /* Literal.Number.Integer.Long */

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,49 @@
.highlight { background-color: #ffffcc }
.c { color: #008800; font-style: italic } /* Comment */
.err { color: #a61717; background-color: #e3d2d2 } /* Error */
.k { color: #000080; font-weight: bold } /* Keyword */
.ch { color: #008800; font-style: italic } /* Comment.Hashbang */
.cm { color: #008800; font-style: italic } /* Comment.Multiline */
.cp { color: #008080 } /* Comment.Preproc */
.cpf { color: #008800; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #008800; font-style: italic } /* Comment.Single */
.cs { color: #008800; font-weight: bold } /* Comment.Special */
.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #aa0000 } /* Generic.Error */
.gh { color: #999999 } /* Generic.Heading */
.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.go { color: #888888 } /* Generic.Output */
.gp { color: #555555 } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #aaaaaa } /* Generic.Subheading */
.gt { color: #aa0000 } /* Generic.Traceback */
.kc { color: #000080; font-weight: bold } /* Keyword.Constant */
.kd { color: #000080; font-weight: bold } /* Keyword.Declaration */
.kn { color: #000080; font-weight: bold } /* Keyword.Namespace */
.kp { color: #000080; font-weight: bold } /* Keyword.Pseudo */
.kr { color: #000080; font-weight: bold } /* Keyword.Reserved */
.kt { color: #000080; font-weight: bold } /* Keyword.Type */
.m { color: #0000FF } /* Literal.Number */
.s { color: #0000FF } /* Literal.String */
.na { color: #FF0000 } /* Name.Attribute */
.nt { color: #000080; font-weight: bold } /* Name.Tag */
.ow { font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mb { color: #0000FF } /* Literal.Number.Bin */
.mf { color: #0000FF } /* Literal.Number.Float */
.mh { color: #0000FF } /* Literal.Number.Hex */
.mi { color: #0000FF } /* Literal.Number.Integer */
.mo { color: #0000FF } /* Literal.Number.Oct */
.sb { color: #0000FF } /* Literal.String.Backtick */
.sc { color: #800080 } /* Literal.String.Char */
.sd { color: #0000FF } /* Literal.String.Doc */
.s2 { color: #0000FF } /* Literal.String.Double */
.se { color: #0000FF } /* Literal.String.Escape */
.sh { color: #0000FF } /* Literal.String.Heredoc */
.si { color: #0000FF } /* Literal.String.Interpol */
.sx { color: #0000FF } /* Literal.String.Other */
.sr { color: #0000FF } /* Literal.String.Regex */
.s1 { color: #0000FF } /* Literal.String.Single */
.ss { color: #0000FF } /* Literal.String.Symbol */
.il { color: #0000FF } /* Literal.Number.Integer.Long */

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit b72e9e5

Please sign in to comment.