Automatically install pygments style

This commit is contained in:
Peter Vlugter 2011-04-19 12:43:50 +12:00
parent 0b4fe353f8
commit 4cd2693340
5 changed files with 36 additions and 8 deletions

View file

@ -6,16 +6,19 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
EASYINSTALL = easy_install
PYGMENTSDIR = pygments
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html singlehtml latex pdf
.PHONY: help clean pygments html singlehtml latex pdf
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " pygments to locally install the custom pygments styles"
@echo " html to make standalone HTML files"
@echo " singlehtml to make a single large HTML file"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@ -24,7 +27,14 @@ help:
clean:
-rm -rf $(BUILDDIR)/*
html:
pygments:
$(EASYINSTALL) --user $(PYGMENTSDIR)
-rm -rf $(PYGMENTSDIR)/*.egg-info $(PYGMENTSDIR)/build $(PYGMENTSDIR)/temp
@echo
@echo "Custom pygments styles have been installed."
@echo
html: pygments
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
@ -41,9 +51,8 @@ latex:
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
pdf:
pdf: pygments
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

View file

@ -19,7 +19,7 @@ copyright = u'2009-2011, Scalable Solutions AB'
version = '1.1'
release = '1.1'
pygments_style = 'akka'
pygments_style = 'simple'
highlight_language = 'scala'
add_function_parentheses = False
show_authors = True

View file

@ -0,0 +1,19 @@
"""
Akka syntax styles for Pygments.
"""
from setuptools import setup
entry_points = """
[pygments.styles]
simple = styles.simple:SimpleStyle
"""
setup(
name = 'akkastyles',
version = '0.1',
description = __doc__,
author = "Akka",
packages = ['styles'],
entry_points = entry_points
)

View file

View file

@ -3,7 +3,7 @@
pygments.styles.akka
~~~~~~~~~~~~~~~~~~~~~~~~
Akka style for Scala highlighting.
Simple style for Scala highlighting.
"""
from pygments.style import Style
@ -11,9 +11,9 @@ from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace
class AkkaStyle(Style):
class SimpleStyle(Style):
"""
Akka style for Scala highlighting.
Simple style for Scala highlighting.
"""
background_color = "#f0f0f0"