Skip to Main Content
Learning Flask Framework
book

Learning Flask Framework

by Matt Copperwaite, Charles Leifer
November 2015
Beginner content levelBeginner
250 pages
5h 16m
English
Packt Publishing
Content preview from Learning Flask Framework

Syntax highlighting using Pygments

Often, as coders, we want to be able to display code in a web page, and while it is a skill to read that code without syntax highlighting, a few colors can make the reading experience much more pleasant.

As is always the way with Python, there is a module already available that is able to do that for you, and of course it can be installed easily by the following command:

pip install Pygments

Note

Pygments only works with the known sections of code. So, if you want to display code snippets, we can do that. If, however, you want to highlight inline sections of the code, we either follow the next section on Markdown, or we need to use some online Javascript such as highlight.js.

To create code snippets, we need to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Flask Framework Cookbook - Second Edition

Flask Framework Cookbook - Second Edition

Shalabh Aggarwal
Flask Framework Cookbook

Flask Framework Cookbook

Shalabh Aggarwal

Publisher Resources

ISBN: 9781783983360Supplemental Content