How to use the panflute.MetaString function in panflute

To help you get started, we’ve selected a few panflute examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chdemko / pandoc-numbering / pandoc_numbering.py View on Github external
defined:
    """
    if (
        "sectioning-levels" in definition
        and isinstance(definition["sectioning-levels"], MetaInlines)
        and len(definition["sectioning-levels"].content) == 1
    ):
        match = re.match(
            Numbered.header_regex, definition["sectioning-levels"].content[0].text
        )
        if match:
            # Compute the first and last levels section
            defined[category]["first-section-level"] = len(match.group("hidden")) // 2
            defined[category]["last-section-level"] = len(match.group("header")) // 2
    if "first-section-level" in definition:
        if isinstance(definition["first-section-level"], MetaString):
            value = definition["first-section-level"].text
        elif (
            isinstance(definition["first-section-level"], MetaInlines)
            and len(definition["first-section-level"].content) == 1
        ):
            value = definition["first-section-level"].content[0].text
        else:
            debug(
                "[WARNING] pandoc-numbering: first-section-level is not correct for category "
                + category
            )
            return

        # Get the level
        try:
            level = int(value) - 1
github chdemko / pandoc-latex-tip / tests / test_tip.py View on Github external
link=MetaString("http://www.google.fr"),
                        ),
                        MetaString("comments"),
                    ),
                    size=MetaString("36"),
                    position=MetaString("right"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("warning")),
                    icons=MetaString("comments"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("tip")), position=MetaString("left")
                ),
                MetaMap(
                    classes=MetaList(MetaString("v5.0")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("balance-scale"),
                            version=MetaString("5.x"),
                            variant=MetaString("solid"),
                            color=MetaString("orange"),
                        )
github chdemko / pandoc-latex-tip / tests / test_tip.py View on Github external
def metadata(cls):
        return {
            "pandoc-latex-tip": MetaList(
                MetaMap(
                    classes=MetaList(MetaString("tip"), MetaString("listing")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("file-text"),
                            color=MetaString("darksalmon"),
                            link=MetaString("http://www.google.fr"),
                        ),
                        MetaString("comments"),
                    ),
                    size=MetaString("36"),
                    position=MetaString("right"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("warning")),
                    icons=MetaString("comments"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("tip")), position=MetaString("left")
                ),
                MetaMap(
                    classes=MetaList(MetaString("v5.0")),
github chdemko / pandoc-latex-tip / tests / test_tip.py View on Github external
def metadata(cls):
        return {
            "pandoc-latex-tip": MetaList(
                MetaMap(
                    classes=MetaList(MetaString("tip"), MetaString("listing")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("file-text"),
                            color=MetaString("darksalmon"),
                            link=MetaString("http://www.google.fr"),
                        ),
                        MetaString("comments"),
                    ),
                    size=MetaString("36"),
                    position=MetaString("right"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("warning")),
                    icons=MetaString("comments"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("tip")), position=MetaString("left")
                ),
                MetaMap(
                    classes=MetaList(MetaString("v5.0")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("balance-scale"),
                            version=MetaString("5.x"),
                            variant=MetaString("solid"),
                            color=MetaString("orange"),
github chdemko / pandoc-latex-tip / tests / test_tip.py View on Github external
def metadata(cls):
        return {
            "pandoc-latex-tip": MetaList(
                MetaMap(
                    classes=MetaList(MetaString("tip"), MetaString("listing")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("file-text"),
                            color=MetaString("darksalmon"),
                            link=MetaString("http://www.google.fr"),
                        ),
                        MetaString("comments"),
                    ),
                    size=MetaString("36"),
                    position=MetaString("right"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("warning")),
                    icons=MetaString("comments"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("tip")), position=MetaString("left")
                ),
                MetaMap(
                    classes=MetaList(MetaString("v5.0")),
                    icons=MetaList(
github chdemko / pandoc-latex-tip / tests / test_tip.py View on Github external
MetaMap(
                    classes=MetaList(MetaString("tip"), MetaString("listing")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("file-text"),
                            color=MetaString("darksalmon"),
                            link=MetaString("http://www.google.fr"),
                        ),
                        MetaString("comments"),
                    ),
                    size=MetaString("36"),
                    position=MetaString("right"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("warning")),
                    icons=MetaString("comments"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("tip")), position=MetaString("left")
                ),
                MetaMap(
                    classes=MetaList(MetaString("v5.0")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("balance-scale"),
                            version=MetaString("5.x"),
                            variant=MetaString("solid"),
                            color=MetaString("orange"),
                        )
github chdemko / pandoc-latex-tip / tests / test_tip.py View on Github external
def metadata(cls):
        return {
            "pandoc-latex-tip": MetaList(
                MetaMap(
                    classes=MetaList(MetaString("tip"), MetaString("listing")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("file-text"),
                            color=MetaString("darksalmon"),
                            link=MetaString("http://www.google.fr"),
                        ),
                        MetaString("comments"),
                    ),
                    size=MetaString("36"),
                    position=MetaString("right"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("warning")),
                    icons=MetaString("comments"),
                ),
                MetaMap(
                    classes=MetaList(MetaString("tip")), position=MetaString("left")
                ),
                MetaMap(
                    classes=MetaList(MetaString("v5.0")),
                    icons=MetaList(
                        MetaMap(
                            name=MetaString("balance-scale"),