Verified Commit 6c2307bd authored by Jakob Moser's avatar Jakob Moser
Browse files

Draft removing irrelevant sections

parent d026e458
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@ from coliverter.documents.DocumentType import DocumentType
from coliverter.documents.transform.insert_table_of_contents import (
    insert_table_of_contents,
)
from coliverter.documents.transform.remove_irrelevant_sections import (
    remove_irrelevant_sections,
)
from coliverter.resources.pandoc.get_filter import get_filter

ACTIVE_MARKDOWN_EXTENSIONS = ("autolink_bare_uris", "emoji", "task_lists")
@@ -44,7 +47,10 @@ class Document:
        document_type = maybe_type or DocumentType.guess(content)

        # Apply the transformations we want to do
        transformations = (insert_table_of_contents,)
        transformations = (
            remove_irrelevant_sections,
            insert_table_of_contents,
        )
        for transform in transformations:
            content = transform(content, document_type)

+12 −0
Original line number Diff line number Diff line
from pandoc.types import Pandoc


from coliverter.documents.DocumentType import DocumentType


def remove_irrelevant_sections(content: Pandoc, document_type: DocumentType) -> Pandoc:
    if document_type == DocumentType.MEETING_RESOLUTIONS:
        # TODO Remove everything that is not a resolution
        return content

    return content