Skip to content

Commit

Permalink
Add option nbsphinx_prompt_width
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jun 26, 2016
1 parent 64aeeef commit 843eae5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
# Controls when a cell will time out (defaults to 30; use -1 for no timeout):
#nbsphinx_timeout = 60

# Default Pygments lexer for syntax highlighting in code cells
# Default Pygments lexer for syntax highlighting in code cells:
#nbsphinx_codecell_lexer = 'ipython3'

# Width of input/output prompts used in CSS:
#nbsphinx_prompt_width = '8ex'

# -- The settings below this line are not specific to nbsphinx ------------

master_doc = 'index'
Expand Down
5 changes: 3 additions & 2 deletions nbsphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
div.nbinput > :first-child[class^=highlight],
div.nboutput > :first-child[class^=highlight],
div.nboutput > :first-child {
min-width: 11ex;
min-width: %(nbsphinx_prompt_width)s;
padding-top: 0.4em;
padding-right: 0.4em;
text-align: right;
Expand Down Expand Up @@ -1016,7 +1016,7 @@ def html_page_context(app, pagename, templatename, context, doctree):
"""Add CSS string to HTML pages that contain code cells."""
style = ''
if doctree and doctree.get('nbsphinx_include_css'):
style += CSS_STRING
style += CSS_STRING % app.config
if doctree and app.config.html_theme == 'sphinx_rtd_theme':
style += CSS_STRING_READTHEDOCS
if style:
Expand Down Expand Up @@ -1168,6 +1168,7 @@ def setup(app):
app.add_config_value('nbsphinx_allow_errors', False, rebuild='')
app.add_config_value('nbsphinx_timeout', 30, rebuild='')
app.add_config_value('nbsphinx_codecell_lexer', 'none', rebuild='env')
app.add_config_value('nbsphinx_prompt_width', '9ex', rebuild='html')

app.add_directive('nbinput', NbInput)
app.add_directive('nboutput', NbOutput)
Expand Down

0 comments on commit 843eae5

Please sign in to comment.