Verified Commit f7e6d557 authored by Jakob Moser's avatar Jakob Moser
Browse files

Rename DocumentType.OTHER to STANDARD, introduce MEETING_RESOLUTIONS

parent e6e40feb
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@ from pandoc.types import Header, Pandoc, Str

class DocumentType(StrEnum):
    MEETING_MINUTES = auto()
    OTHER = auto()
    MEETING_RESOLUTIONS = auto()
    STANDARD = auto()

    @classmethod
    def guess(cls, content: Pandoc) -> Self:
@@ -17,16 +18,16 @@ class DocumentType(StrEnum):

        if not headers:
            # No headers means we can't really guess anything
            return cls.OTHER
            return cls.STANDARD

        # Take first header
        level, attrs, content = headers[0]

        if not content:
            # No content in the header still leaves us quite at a loss
            return cls.OTHER
            return cls.STANDARD

        if content[0] == Str("Protokoll"):
            return cls.MEETING_MINUTES

        return cls.OTHER
        return cls.STANDARD