Coverage for pyeditorjs/__init__.py: 79%

1 from pathlib import Path

2

3 from .blocks import BLOCKS_MAP, EditorJsBlock, block

4 from .exceptions import EditorJsParseError

5 from .parser import EditorJsParser

6

7 __all__ = [

8 "EditorJsParser",

9 "EditorJsParseError",

10 "EditorJsBlock",

11 "block",

12 "BLOCKS_MAP",

13]

14

15

16# Overwrite __doc__ with README, so that pdoc can render it:

17 README_PATH = Path(__file__).parent.parent.absolute() / Path("README.md")

18 try:

19 with open(README_PATH, "r", encoding="UTF-8") as readme:

20 __readme__ = readme.read()

21 except Exception:

22 __readme__ = "Failed to read README.md!" # fallback message, for example when there's no README

23

24 __doc__ = __readme__

25

26

27 if __name__ == "__main__":

28 _ = [EditorJsParser]