Files
myhloli 1f038d16f3 docs: reorganize bilingual MkDocs guides by workflow
Add runnable CLI, document library, and HTTP examples. Document WebUI exports and Router deployment, and preserve existing page and section links.
2026-11-18 16:54:32 +08:00

3.3 KiB

Document library and agent reading

Use the library when you need to search, cite, or revisit the same documents. For a one-time conversion of a file or folder to Markdown or ZIP, use mineru-kit parse in the quick start.

Parse a file into the library

Start the local library service, then try the report.html from the quick start. The parsed result is kept in the library, and the command's JSON response is written to parsed.json. Native HTML is parsed in full using Flash.

mineru server start
mineru parse report.html --wait 600 --json > parsed.json

On completion, content contains the returned text and its content_ranges. Each range has a start and an end locator with the actual document ID, tier, and content position. To write a complete Markdown file, use -o. Parsing, exporting, and waiting

Search and read cached content

mineru search "MinerU" --json

Search results provide a document short_id, snippet, and available paths. To read a specific position from the file you just parsed, copy content.content_ranges[0].start from parsed.json and pass it as the first argument to mineru read. With Bash and jq, the following commands pass that locator directly to the CLI.

locator=$(jq -er '.content.content_ranges[0].start' parsed.json) &&
  mineru read "$locator" --json

This reads the start of the first returned range from the cache. If a read response includes a next_request, pass its locator to the next read and supply --after when after has a value. In text mode, the <!-- Next: ... --> marker gives the next command.

Read additional PDF pages

mineru parse document.pdf requests the first 10 pages by default. To read page 11, request that page before using the locator in the response. To export the entire PDF, request all pages explicitly.

mineru parse document.pdf --pages 11 --wait 600 --json
mineru parse document.pdf --pages all -o document.md --wait 600

PDF pages start at 1. 1-5,8,r1 selects the first five pages, page eight, and the last page. --pages sets the requested pages, --limit bounds one terminal response, and -o writes the complete requested range. After a wait timeout, repeat the same parse command to keep waiting. PDF page ranges

Services and configuration