Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
feature #30 Move codeblock to sphinx php repository (WouterJ)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 1.0-dev branch (closes #30).

Discussion
----------

Move codeblock to sphinx php repository

Commits
-------

4e457ef Move codeblock to sphinx php repository
  • Loading branch information
fabpot committed Aug 19, 2015
2 parents 7467b42 + 4e457ef commit 1b7c4b7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sensio/sphinx/codeblock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
:copyright: (c) 2010-2015 Fabien Potencier
:license: MIT, see LICENSE for more details.
"""

from sphinx.directives.code import CodeBlock

"""
A wrapper around the built-in CodeBlock class to always
enable line numbers.
"""
class NumberedCodeBlock(CodeBlock):
def run(self):
self.options['linenos'] = 'table'
return super(NumberedCodeBlock, self).run();

def setup(app):
app.add_directive('code-block', NumberedCodeBlock)
app.add_directive('sourcecode', NumberedCodeBlock)

0 comments on commit 1b7c4b7

Please sign in to comment.