Feat: Import all old stuff

This commit is contained in:
2019-07-18 12:43:36 +02:00
parent 7f4dc86d88
commit 76a4e19baf
300 changed files with 15589 additions and 0 deletions

17
theme/pygments/README.md Normal file
View File

@@ -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).

35
theme/pygments/generate.py Executable file
View File

@@ -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,
'noclasses': False,
'nobackground': False,
}
path = os.path.join(PYGMENTS_PATH, '%s.css' % style)
formatter = HtmlFormatter(**opts)
css_content = formatter.get_style_defs('.highlight')
with open(path, 'w') as f:
f.write(css_content)
if __name__ == '__main__':
export()

View File

@@ -0,0 +1,2 @@
Pygments==2.2.0
pygments-style-github==0.4