oerforge.convert Content Conversion Utilities for OERForge Overview provides functions for converting Jupyter notebooks () and Markdown files to various formats, managing associated images, and updating a SQLite database with conversion status. It supports batch and single-file conversion, image extraction and copying, and database logging. Functions setup_logging Configure logging for conversion actions. Logs to and the console. query_images_for_content Query the database for all images associated with a content file. Parameters (dict): Content record dictionary. : SQLite connection object. Returns : List of image records. copy_images_to_build Copy images to the build images directory. Returns a list of new build paths. Parameters (list[dict]): List of image records. (str): Destination directory for images. : SQLite connection object (optional). Returns : List of copied image paths. update_markdown_image_links Update image links in a Markdown file to point to copied images in the build directory. Parameters (str): Path to the Markdown file. (list[dict]): List of image records. (str): Images directory. handle_images_for_markdown Orchestrate image handling for a Markdown file: query, copy, and update links. Parameters (dict): Content record dictionary. : SQLite connection object. convert_md_to_docx Convert a Markdown file to DOCX using Pandoc. Updates DB conversion status if and are provided. Parameters (str): Source Markdown file path. (str): Output DOCX file path. (int, optional): Content record ID. : SQLite connection object (optional). convert_md_to_pdf Convert a Markdown file to PDF using Pandoc. Updates DB conversion status if and are provided. Parameters (str): Source Markdown file path. (str): Output PDF file path. (int, optional): Content record ID. : SQLite connection object (optional). convert_md_to_tex Convert a Markdown file to LaTeX using Pandoc. Updates DB conversion status if and are provided. Parameters (str): Source Markdown file path. (str): Output LaTeX file path. (int, optional): Content record ID. : SQLite connection object (optional). convert_md_to_txt Convert a Markdown file to plain TXT (extracts readable text). Updates DB conversion status if and are provided. Parameters (str): Source Markdown file path. (str): Output TXT file path. (int, optional): Content record ID. : SQLite connection object (optional). batch_convert_all_content Batch process all files in the content table. For each file, checks conversion flags and calls appropriate conversion functions. Organizes output to mirror TOC hierarchy. Parameters (str, optional): Path to config file. CLI Usage Requirements Python 3.7+ Pandoc (for docx, pdf, tex conversions) nbconvert markdown-it-py SQLite3 See Also Pandoc Documentation nbconvert Documentation License See in the project root.