Skip to content

Commit

Permalink
Enable disabling pilcrows (official way)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfultz committed Jan 15, 2019
1 parent e0dd44c commit a652748
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ In the notebook metadata, you can set mail headers by adding a `nb2mail` block:

You can specify multiple recipients by seperating them with commas.

## Disabling Pilcrows

Since CSS doesn't render the same in email, you may want to disable the pilcrows after each section.

c.MailExporter.anchor_link_text = '' # disable pilcrow, requires nbconvert >= 5.2

## Refences

* PyPI - https://pypi.python.org/pypi/nb2mail
Expand Down
7 changes: 4 additions & 3 deletions nb2mail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Mail Exporter class"""

# Copyright (c) Jupyter Development Team.
# Copyright (c) Neal Fultz 2016
# Copyright (c) Neal Fultz 2016, 2019
# Distributed under the terms of the Modified BSD License.

import os
Expand All @@ -14,7 +14,7 @@
from traitlets import default, Unicode, Int
from traitlets.config import Config

from nbconvert.exporters.templateexporter import TemplateExporter
from nbconvert.exporters.html import HTMLExporter
from nbconvert.postprocessors.base import PostProcessorBase

from email import encoders
Expand All @@ -41,7 +41,7 @@ def data_attach(data,meta):
meta['attach_data'][id] = b64decode(data)
return id

class MailExporter(TemplateExporter):
class MailExporter(HTMLExporter):
"""
Exports to a mail document (.mail)
"""
Expand Down Expand Up @@ -82,6 +82,7 @@ def template_path(self):


def from_notebook_node(self, nb, resources=None, **kw):

output, resources = super(MailExporter, self).from_notebook_node(nb, resources=resources, **kw)


Expand Down

0 comments on commit a652748

Please sign in to comment.