Coverage for pyeditorjs/__init__.py: 79%
14 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 13:29 +0100
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 13:29 +0100
1from pathlib import Path
3from .blocks import BLOCKS_MAP, EditorJsBlock, block
4from .exceptions import EditorJsParseError
5from .parser import EditorJsParser
7__all__ = [
8 "EditorJsParser",
9 "EditorJsParseError",
10 "EditorJsBlock",
11 "block",
12 "BLOCKS_MAP",
13]
16# Overwrite __doc__ with README, so that pdoc can render it:
17README_PATH = Path(__file__).parent.parent.absolute() / Path("README.md")
18try:
19 with open(README_PATH, "r", encoding="UTF-8") as readme:
20 __readme__ = readme.read()
21except Exception:
22 __readme__ = "Failed to read README.md!" # fallback message, for example when there's no README
24__doc__ = __readme__
27if __name__ == "__main__":
28 _ = [EditorJsParser]