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

Add block to allow customizing html output prompt #500

Merged
merged 3 commits into from
Dec 28, 2016

Conversation

eddiejessup
Copy link
Contributor

For generating HTML reports I usually want to completely hide cells' output, apart from a select few types such as HTML and images. I can almost accomplish this with a custom template inheriting from full.tpl, except that I can't hide the output prompt without hiding the cell output itself. I can if I add this block.

@takluyver
Copy link
Member

Thanks, I think this is a reasonable addition.

Can you add it to the template structure doc, which is rendered at:
http://nbconvert.readthedocs.io/en/stable/customizing.html#Template-structure

@mpacer
Copy link
Member

mpacer commented Dec 22, 2016

Should be good to go.

<div class="template_block">execute_result</div>
<div class="template_block">output_area_prompt
<div class="template_block">execute_result</div>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is quite right:

  1. The new block goes before the output content blocks (like execute_result), not wrapping them.
  2. The new block is only in the HTML template; there's a separate section below for extra blocks in the HTML template.

Added a block around the HTML template's version of the cell output
prompt.
@eddiejessup
Copy link
Contributor Author

Hey @michaelpacer, based on @takluyver's comments I dropped your commit, but thanks for helping out, I definitely wouldn't have noticed I needed to update the notebook otherwise!

@takluyver, I think the HTML structure is now correct. I wasn't sure how best to state the block inheritance, so I just went for an explicit {% super %}, hope this doesn't make the document show too much implementation guts. If you can think of a nicer way to express this, I'd be happy to change it.

@takluyver
Copy link
Member

Thanks! I think {% super %} is too much implementation guts. Can we say something like 'output type as above'? There's already an 'as above' in the Latex section below. Better wording welcome.

@eddiejessup
Copy link
Contributor Author

@takluyver thanks for the feedback! I think all done.

@takluyver takluyver added enhancement format:HTML pertains to exporting to the HTML format labels Dec 28, 2016
@takluyver takluyver added this to the 5.1 milestone Dec 28, 2016
@takluyver takluyver merged commit 4b2a3a2 into jupyter:master Dec 28, 2016
@takluyver
Copy link
Member

Thanks :-)

@mpacer
Copy link
Member

mpacer commented Dec 28, 2016

This may have broken rtd.

@eddiejessup
Copy link
Contributor Author

@michaelpracer hey, sorry what's rtd mean?

@eddiejessup
Copy link
Contributor Author

@michaelpacer

@mpacer
Copy link
Member

mpacer commented Dec 28, 2016 via email

@eddiejessup
Copy link
Contributor Author

Thanks for catching this. I'm not familiar with how readthedocs works, where can I see its build details? I can see that it looks like the ipython notebook with the template structure is shown there, but the PR changes aren't reflected, even in its 'latest' version.

@takluyver
Copy link
Member

I think Mike has got it working again, but for the record, you can see RTD build logs here: https://readthedocs.org/projects/nbconvert/builds/

@mpacer
Copy link
Member

mpacer commented Jan 6, 2017

I think it ended up being independent of this PR per se (it was just what triggered the most recent failure), so no worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement format:HTML pertains to exporting to the HTML format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants