From 0e9502a4b8005d5e0706f8eff27f8b52e8292465 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 9 Mar 2020 15:54:36 +0000 Subject: [PATCH 1/2] Remove specific arguments from `Document.read` This is to make it more compatible with upstream changes --- myst_parser/block_tokens.py | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/myst_parser/block_tokens.py b/myst_parser/block_tokens.py index 8a266982..d138fdcc 100644 --- a/myst_parser/block_tokens.py +++ b/myst_parser/block_tokens.py @@ -13,30 +13,15 @@ class Document(block_tokens.Document): """Document token.""" + # TODO this class should eventually be removed + @classmethod - def read( - cls, - lines, - start_line: int = 0, - reset_definitions=True, - store_definitions=False, - front_matter=True, - propogate_pos: bool = True, - ): - """Read a document - - :param lines: Lines or string to parse - :param start_line: The initial line (used for nested parsing) - :param reset_definitions: remove any previously stored link_definitions - :param store_definitions: store LinkDefinitions or ignore them - :param front_matter: search for an initial YAML block front matter block - (note this is not strictly CommonMark compliant) - """ - doc = super().read( - lines, start_line, reset_definitions, store_definitions, front_matter - ) + def read(cls, *args, **kwargs): + # default to front matter is True + kwargs["front_matter"] = kwargs.get("front_matter", True) + doc = super().read(*args, **kwargs) - if propogate_pos: + if kwargs.get("propogate_pos", True): # TODO this is a placeholder for implementing span level range storage # (with start/end character attributes) for result in doc.walk(): From cbdfb4ed7199b277138c180c3d4a6ac9d64d2515 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 9 Mar 2020 15:55:45 +0000 Subject: [PATCH 2/2] bump version --- myst_parser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myst_parser/__init__.py b/myst_parser/__init__.py index 13a9f9f7..763b4f64 100644 --- a/myst_parser/__init__.py +++ b/myst_parser/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.5.0" +__version__ = "0.5.1" def text_to_tokens(text: str):