Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude input/output prompt #126

Closed
adrn opened this issue Sep 28, 2017 · 5 comments
Closed

Exclude input/output prompt #126

adrn opened this issue Sep 28, 2017 · 5 comments

Comments

@adrn
Copy link
Contributor

adrn commented Sep 28, 2017

Right now, as far as I can tell, there is no way to exclude the input or output prompt (the In[...]: and Out[...]:) from the rendered notebook pages. It looks like this is because they are added manually (instead of deferring to nbconvert; see this line) so there is no way I can figure out to disable them (via the TemplateExporter.exclude_input_prompt and TemplateExporter.exclude_output_prompt configuration options in nbconvert). Am I misunderstanding what's really happening? If it is not possible, it would be nice to have this as an option.

@mgeier
Copy link
Member

mgeier commented Sep 28, 2017 via email

@adrn
Copy link
Contributor Author

adrn commented Oct 8, 2017

Setting nbsphinx_prompt_width = 0 does seem to work - thanks!

@adrn
Copy link
Contributor Author

adrn commented Oct 8, 2017

(closing this because it seems like #131 addresses the broader idea of supporting TemplateExporter options)

@adrn adrn closed this as completed Oct 8, 2017
@ferrine
Copy link

ferrine commented Apr 30, 2023

I used this formatting trick instead

nbsphinx_input_prompt = "%.0s"
nbsphinx_output_prompt = "%.0s"

@mgeier
Copy link
Member

mgeier commented Apr 30, 2023

Currently (nbsphinx version 0.9.1), the recommended way to remove the prompts in HTML output is via CSS:

.nbinput .prompt,
.nboutput .prompt {
    display: none;
}

See https://nbsphinx.readthedocs.io/en/0.9.1/custom-css.html#For-a-Single-Notebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants