Exemplo n.º 1
0
def pygments_css():
    return pygments_style_defs(), 200, {"Content-Type": "text/css"}
Exemplo n.º 2
0
def pygments_css():
    return pygments_style_defs(app.config.get('HIGHLIGHT_THEME')), 200, {'Content-Type': 'text/css'}
Exemplo n.º 3
0
def pygments_css():
    return pygments_style_defs(PYGMENTS_STYLE), 200, {
        'Content-Type': 'text/css'
    }
Exemplo n.º 4
0
app.config.from_object(__name__)
pages = FlatPages(app)
freezer = Freezer(app)
compressor = Compressor(app)

app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {"/": os.path.join(os.path.dirname(__file__), "static")})


#
# Web assets
#
css_bundle = CSSBundle(
    name="all.css",
    assets=[
        FileAsset("css/normalize.css"),
        Asset(pygments_style_defs()),
        FileAsset("css/styles.less", processors=["lesscss"]),
    ],
    processors=["cssmin"],
)
compressor.register_bundle(css_bundle)


#
# Filters
#
@app.template_filter()
def dateformat(value, format=u"%H:%M / %d-%m-%Y"):
    if not value:
        return u""
    return unicode(value.strftime(format).decode("utf8"))
Exemplo n.º 5
0
def pygments_css():
    u"""Return the stylesheet for the selected Pygments style."""
    style = app.config['PYGMENTS_STYLE']
    return pygments_style_defs(style), 200, {'Content-Type': 'text/css'}
Exemplo n.º 6
0
def pygments_css():
    '''View for syntax highlighting within blog posts'''
    return pygments_style_defs('tango'), 200, {'Content-Type': 'text/css'}
Exemplo n.º 7
0
def pygments_css():
    return pygments_style_defs("monokai"), 200, {"Content-Type": "text/css"}
Exemplo n.º 8
0
def pygments_css():
	return pygments_style_defs('tango'), 200, {'Content-Type': 'text/css'}
Exemplo n.º 9
0
def pygments_css():
    pygments_style = app.config.get('FLATPAGES_PYGMENTS_STYLE', 'default')
    return pygments_style_defs(pygments_style), 200, {
        'Content-Type': 'text/css'
    }
Exemplo n.º 10
0
def pygments_css():
    return (pygments_style_defs("solarizedlight"), 200, {
        "Content-Type": "text/css"
    })
Exemplo n.º 11
0
def pygments_css():
    '''View for syntax highlighting within blog posts'''
    return pygments_style_defs('tango'), 200, {'Content-Type': 'text/css'}
Exemplo n.º 12
0
def pygments_css() -> str:
    """
    return the pygments syntax-highlighting CSS
    """
    return pygments_style_defs('monokai'), 200, {'Content-Type': 'text/css'}
 def test_pygments_style_defs(self):
     styles = pygments_style_defs()
     self.assertTrue('.codehilite' in styles)
Exemplo n.º 14
0
def pygments_css():
    return pygments_style_defs('friendly'), 200, {'Content-Type': 'text/css'}
 def test_pygments_style_defs(self):
     styles = pygments_style_defs()
     self.assertTrue(styles.startswith('.codehilite'))
Exemplo n.º 16
0
 def test_pygments_style_defs(self):
     styles = pygments_style_defs()
     self.assertTrue(styles.startswith('.codehilite'))
Exemplo n.º 17
0
def pygments_css():
    return pygments_style_defs("friendly"), 200, {"Content-Type": "text/css"}
Exemplo n.º 18
0
def pygments_css():
    style = app.config['PYGMENTS_STYLE']
    return pygments_style_defs(style), 200, {'Content-Type': 'text/css'}
Exemplo n.º 19
0
def pygments():
    return pygments_style_defs(style='algol_nu'), 200, {
        'Content-Type': 'text/css'
    }
Exemplo n.º 20
0
def pygments_css():
    return pygments_style_defs(), 200, {'Content-Type': 'text/css'}
Exemplo n.º 21
0
def pygments_css():
    return pygments_style_defs(style='colorful'), 200, {
        'Content-Type': 'text/css'
    }