mkdocs_bibtex/plugin.py
def to_markdown_pandoc(entry, csl_path):
    """
    Converts the PyBtex entry into formatted markdown citation text
    """
    bibtex_string = BibliographyData(entries={entry.key: entry}).to_string("bibtex")
    citation_text = """
---
nocite: '@*'
---
"""

    with tempfile.TemporaryDirectory() as tmpdir:
        bib_path = os.path.join(tmpdir, "temp.bib")
        with open(bib_path, "w") as bibfile:
            bibfile.write(bibtex_string)

        # Call Pandoc.
        markdown = pypandoc.convert_text(
            source=citation_text,
            to="markdown_strict-citations",
            format="md",
            extra_args=["--csl", csl_path, "--bibliography", bib_path],
            filters=["pandoc-citeproc"],
        )

    # TODO: Perform this extraction better
    markdown = markdown.split("\n")[0][2:]

    return str(markdown)

    Converts the PyBtex entry into formatted markdown citation text
    
Converts the PyBtex entry into formatted markdown citation text
Converts the PyBtex entry into formatted markdown citation text
def to_markdown_pandoc(entry, csl_path):
    bibtex_string = BibliographyData(entries={entry.key: entry}).to_string("bibtex")
    citation_text = """
---
nocite: '@*'
---
"""
    with tempfile.TemporaryDirectory() as tmpdir:
        bib_path = os.path.join(tmpdir, "temp.bib")
        with open(bib_path, "w") as bibfile:
            bibfile.write(bibtex_string)
        markdown = pypandoc.convert_text(
            source=citation_text,
            to="markdown_strict-citations",
            format="md",
            extra_args=["--csl", csl_path, "--bibliography", bib_path],
            filters=["pandoc-citeproc"],
        )
    markdown = markdown.split("\n")[0][2:]
    return str(markdown)
def to_markdown_pandoc ( entry , csl_path ) : bibtex_string = BibliographyData ( entries = { entry . key : entry } ) . to_string ( "bibtex" ) citation_text = """
---
nocite: '@*'
---
""" with tempfile . TemporaryDirectory ( ) as tmpdir : bib_path = os . path . join ( tmpdir , "temp.bib" ) with open ( bib_path , "w" ) as bibfile : bibfile . write ( bibtex_string ) markdown = pypandoc . convert_text ( source = citation_text , to = "markdown_strict-citations" , format = "md" , extra_args = [ "--csl" , csl_path , "--bibliography" , bib_path ] , filters = [ "pandoc-citeproc" ] , ) markdown = markdown . split ( "\n" ) [ 0 ] [ 2 : ] return str ( markdown )
Converts the PyBtex entry into formatted markdown citation text
Converts the PyBtex entry into formatted markdown citation text
"""
    Converts the PyBtex entry into formatted markdown citation text
    """ # Call Pandoc. # TODO: Perform this extraction better
entry
csl_path