diff --git a/papis_extract/__init__.py b/papis_extract/__init__.py index e396962..b9b5451 100644 --- a/papis_extract/__init__.py +++ b/papis_extract/__init__.py @@ -8,7 +8,8 @@ import papis.strings from papis.document import Document from papis_extract import extractor, exporter -from papis_extract.annotation_data import AnnotatedDocument, Markdown +from papis_extract.annotation_data import AnnotatedDocument +from papis_extract.model.templating import Markdown logger = papis.logging.get_logger(__name__) diff --git a/papis_extract/annotation_data.py b/papis_extract/annotation_data.py index 486c397..6b641c4 100644 --- a/papis_extract/annotation_data.py +++ b/papis_extract/annotation_data.py @@ -85,16 +85,3 @@ class AnnotatedDocument: document: Document annotations: list[Annotation] - -@dataclass -class Templating(Protocol): - string: str - - -@dataclass -class Markdown: - string: str = ( - "{{#tag}}#{{tag}}\n{{/tag}}" - "{{#quote}}> {{quote}}{{/quote}} {{#page}}[p. {{page}}]{{/page}}\n" - "{{#note}} NOTE: {{note}}{{/note}}" - ) diff --git a/papis_extract/exporter.py b/papis_extract/exporter.py index 08bcfbb..2b0d4fd 100644 --- a/papis_extract/exporter.py +++ b/papis_extract/exporter.py @@ -7,7 +7,8 @@ import papis.git import papis.config import Levenshtein -from papis_extract.annotation_data import AnnotatedDocument, Annotation, Templating +from papis_extract.annotation_data import AnnotatedDocument +from papis_extract.model.templating import Templating logger = papis.logging.get_logger(__name__) diff --git a/papis_extract/model/templating.py b/papis_extract/model/templating.py new file mode 100644 index 0000000..f1ebb92 --- /dev/null +++ b/papis_extract/model/templating.py @@ -0,0 +1,16 @@ +from dataclasses import dataclass +from typing import Protocol + + +@dataclass +class Templating(Protocol): + string: str + + +@dataclass +class Markdown: + string: str = ( + "{{#tag}}#{{tag}}\n{{/tag}}" + "{{#quote}}> {{quote}}{{/quote}} {{#page}}[p. {{page}}]{{/page}}\n" + "{{#note}} NOTE: {{note}}{{/note}}" + )