RFC: expose conversion diagnostics without changing Markdown output

オープン
#2,724 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@macjayz がすでに取り組んでいます。

2026年10月24日 から。

  • #2751 @macjayz による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

Read the DocumentConverterResult definition and the conversion entry point that produces it, then trace how converters select formats and charsets. The issue leaves the public API shape and diagnostic fields open for maintainer discussion; first agree on those choices, then define tests for opt-in behavior and unchanged default Markdown output.

索引モデルが issue の本文から書いたものです。

説明

Problem

MarkItDown is increasingly used in ingestion pipelines where a Markdown string alone is not enough to operate safely. Callers often need to know which converter handled an input, which charset was selected, whether a fallback was used, and whether optional/cloud processing was involved. Today they must infer this from filenames, logs, or by reimplementing internal detection.

This makes it difficult to:

  • audit or reproduce a conversion;
  • detect low-confidence charset or format decisions;
  • measure converter coverage in a heterogeneous corpus; and
  • decide when a result should be reviewed instead of indexed automatically.

Proposal

Add opt-in diagnostics to DocumentConverterResult, for example:

result = md.convert(path, include_diagnostics=True)
result.diagnostics.converter  # PlainTextConverter
result.diagnostics.charset  # utf-8 or cp1252
result.diagnostics.charset_confidence  # optional numeric/confidence bucket
result.diagnostics.warnings  # list[str]

The default result would remain unchanged, and diagnostics should avoid exposing input contents or credentials. A CLI representation such as --diagnostics json could make the same information available to ingestion tools.

Questions for maintainers and users

  1. Should diagnostics be part of DocumentConverterResult, a separate callback, or a tracing/logging hook?
  2. Which fields are stable enough to expose as public API (converter identity, MIME type, charset, fallback reason, dependency/cloud usage)?
  3. Should low-confidence decisions be warnings only, or should callers be able to configure a failure threshold?
  4. Would a machine-readable CLI mode be useful, and if so should it write diagnostics to stderr or a sidecar file?

I would be happy to help prototype this if the maintainers agree on the API shape.

主要言語
Python
スター
198k
フォーク
15k
平均マージ
2時間 16分
マージ済み PR(30日)
9

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/markitdown のほかの issue

microsoft/markitdown の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。