Skip to content

Commit

Permalink
Move default notebook metadata filter to metadata_filter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Nov 9, 2019
1 parent c189035 commit e5fcc36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 1 addition & 9 deletions jupytext/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from nbformat.v4.nbbase import new_raw_cell
from .version import __version__
from .languages import _SCRIPT_EXTENSIONS, comment_lines
from .metadata_filter import filter_metadata
from .metadata_filter import filter_metadata, _DEFAULT_NOTEBOOK_METADATA
from .pep8 import pep8_lines_between_cells

SafeRepresenter.add_representer(nbformat.NotebookNode, SafeRepresenter.represent_dict)
Expand All @@ -19,14 +19,6 @@
_LEFTSPACE_RE = re.compile(r"^\s")
_UTF8_HEADER = ' -*- coding: utf-8 -*-'

_DEFAULT_NOTEBOOK_METADATA = ','.join([
# Preserve Jupytext section
'jupytext',
# Preserve kernel specs
'kernelspec',
# Kernel_info found in Nteract notebooks
'kernel_info'])

# Change this to False in tests
INSERT_AND_CHECK_VERSION_NUMBER = True

Expand Down
8 changes: 8 additions & 0 deletions jupytext/metadata_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

from .cell_metadata import _JUPYTEXT_CELL_METADATA

_DEFAULT_NOTEBOOK_METADATA = ','.join([
# Preserve Jupytext section
'jupytext',
# Preserve kernel specs
'kernelspec',
# Kernel_info found in Nteract notebooks
'kernel_info'])


def metadata_filter_as_dict(metadata_config):
"""Return the metadata filter represented as either None (no filter),
Expand Down

0 comments on commit e5fcc36

Please sign in to comment.