We're sunsetting PodQuest on 2025-07-28. Thank you for your support!
Export Podcast Subscriptions
cover of episode #426 Committing to Formatted Markdown

#426 Committing to Formatted Markdown

2025/3/31
logo of podcast Python Bytes

Python Bytes

AI Deep Dive AI Chapters Transcript
People
B
Brian
Python 开发者和播客主持人,专注于测试和软件开发教育。
M
Michael
帮助医生和高收入专业人士管理财务的金融教育者和播客主持人。
Topics
Brian: 我推荐使用mdformat来格式化Markdown文件,它是一个功能强大的工具,可以帮助我们保持Markdown文件的风格一致性。它是一个Python项目,可以用来格式化Markdown文件,它遵循一定的风格指南,并支持插件系统来格式化代码块。它可以将下划线标题转换为#,##等标题,并对项目符号列表和有序列表进行标准化处理。虽然它将有序列表的编号都转换为1,但这可以提高代码的可读性,并减少git diff的次数。此外,它还支持插件系统,可以格式化各种编程语言的代码块。 Matthias Schöttle: (没有直接引语,但建议使用mdformat)

Deep Dive

Chapters
This chapter introduces MDFormat, a Python-based Markdown formatter. It discusses its features, including handling headings, lists, and code blocks, and compares its functionality with other tools like Blacken-Docs. The installation and use of MDFormat via Pipx, including its 'inject' function, are explained.
  • MDFormat is an opinionated Markdown formatter.
  • It's written in Python and can be installed via pipx.
  • It offers a plugin system for code block formatting.
  • Pipx inject adds packages to MDFormat's virtual environment.

Shownotes Transcript

Topics covered in this episode:

- [**mdformat**](https://github.com/hukkin/mdformat?featured_on=pythonbytes))
  • pre-commit-uv)

  • PEP 758 and 781

  • Serie): rich git commit graph in your terminal, like magic books

  • Extras

  • Joke

Watch on YouTube)

About the show

Sponsored by Posit Connect Cloud: pythonbytes.fm/connect-cloud)

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live) to be part of the audience. Usually Monday at 10am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list), we'll never share it.

Brian #1: mdformat)

  • Suggested by Matthias Schöttle

  • Last episode )Michael covered blacken-docs, and I mentioned it’d be nice to have an autoformatter for text markdown.

  • Matthias delivered with suggesting mdformat

  • “Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files.”

  • A python project that can be run on the command line.

  • Uses a style guide) I mostly agree with.

  • I’m not a huge fan of numbered list items all being “1.”, but that can be turned off with --number, so I’m happy.

  • Converts underlined headings to #, ##, etc. headings.

  • Lots of other sane conventions.

  • The numbering thing is also sane, I just think it also makes the raw markdown hard to read.

  • Has a plugin system to format code blocks)

Michael #2: pre-commit-uv)

  • via Ben Falk

  • Use uv to create virtual environments and install packages for pre-commit.

Brian #3: PEP 758 and 781

Michael #4: Serie): rich git commit graph in your terminal, like magic books

  • While some users prefer to use Git via CLI, they often rely on a GUI or feature-rich TUI to view commit logs.

  • Others may find git log --graph sufficient.

  • Goals

  • Provide a rich git log --graph experience in the terminal.

  • Offer commit graph-centric browsing of Git repositories.

Extras

Michael:

Joke: Wishing for wishes)