MCPcopy Index your code
hub / github.com/L3-N0X/obsidian-marker

github.com/L3-N0X/obsidian-marker @1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.5.0 ↗ · + Follow
107 symbols 184 edges 15 files 8 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

title-banner

Maintenance GitHub issues GitHub Release GitHub License

🌟 Introduction

Welcome to this Obsidian PDF to Markdown Converter! This plugin brings the power of advanced PDF conversion directly into your Obsidian vault. By leveraging the capabilities of Marker through a self-hosted API, the hosted solution on datalab.to, or the powerful MistralAI OCR capabilities, this plugin offers a seamless way to transform your PDFs into rich, formatted Markdown files, with support for tables, formulas and more!

[!IMPORTANT] This plugin requires a Marker API endpoint, a paid account for datalab, the python api of marker, or a free MistralAI API key to work. Without an endpoint, the application can't convert anything.

You can find the related repositories and services here:

🚀 Features

  • OCR Capabilities: Convert scanned PDFs to rich markdown
  • Formula Detection: Accurately captures and converts mathematical formulas
  • Table Extraction: Preserves table structures in your Markdown output
  • Image Handling: Extracts and saves images from your PDFs and includes them in the markdown
  • Batch Processing: Convert multiple PDFs at once by selecting files with Alt + Click (Note: Processing multiple files may take considerable time depending on their size and complexity)
  • Mobile Compatibility: Works on both desktop and mobile Obsidian apps
  • Flexible Output: Choose between full content extraction or specific elements (text/images)
  • Smart Folder Integration: If a folder with the PDF's name already exists, the plugin will ask if you want to integrate the new files into the existing folder

🛠 Why This Plugin?

  1. Superior Extraction: Utilizes the Marker project's advanced AI model or MistralAI's powerful OCR for high-quality conversions
  2. Mobile Accessibility: Unlike many converters, this works seamlessly on mobile devices (when the API is accessible)
  3. Customizable: Tailor the conversion process to your specific needs
  4. Obsidian Integration: Converts PDFs directly within your Obsidian environment

♥️ Support the Project

If you enjoy this plugin, feel free to star the repository and share it with others! When you want to support the development, consider buying me a coffee:

📋 Requirements

To use this plugin, you'll need:

  1. A working Obsidian installation
  2. Access to a Marker API endpoint (self-hosted, paid service, or Python API server) OR a free MistralAI API key

🔧 Setup

  1. Install the plugin in your Obsidian vault
  2. Choose your conversion method:
  3. MistralAI: Get a free API key from console.mistral.ai/api-keys
  4. Datalab.to: Sign up for a paid account
  5. Self-hosted Marker API: Set up Docker on a machine with a solid GPU/CPU
  6. Python Local API: Run the Python server on the same local machine where Obsidian is running. It passes the absolute local file path to the API.
  7. Python Cloud API: Run the Python server on a remote server, a separate machine, or in WSL. It uploads the file contents using multipart form data, which is necessary since the API server cannot access the local files directly.
  8. Configure your chosen endpoint/API key in the plugin settings

Which solution should I use?

Solution Pros Cons
MistralAI (recommended) Completely free, excellent results in testing, easy setup with just an API key Uploads your files to Mistral's servers (stored for at least 24h)
Hosted on datalab.to No setup required, fast and reliable, supports the developer and is easily accessible from anywhere Costs a few dollars
Self-Hosted via Docker Full control over the conversion process, no costs for the API Requires a powerful machine, Setup can be complex for beginners
Self-Hosted via Python (Local) Easy to set up, no Docker required, runs locally on the same host Not all features available; requires API server to run on the same machine as Obsidian to access file paths
Self-Hosted via Python (Remote/WSL) Easy to set up, no Docker required, works with WSL or remote servers by uploading file content Not all features available; requires uploading files over network or host-WSL boundary

[!NOTE] MistralAI Privacy Consideration: When using the MistralAI endpoint, your PDFs will be uploaded to Mistral's servers for processing. These files are stored for at least 24 hours. If you have sensitive documents, consider using a self-hosted solution instead.

🧾 Usage

You can convert PDFs to Markdown in multiple ways:

  1. Single PDF file: Right-click on a PDF file in the file explorer and select "Convert to MD" from the context menu
  2. Multiple PDF files: Select multiple PDF files with Alt + Click and right-click to convert them all at once
  3. PDF file in editor: After opening a PDF file in the editor, click on the three dots in the top right corner and select "Convert to MD"
  4. Use the command palette: Open the command palette and search for "Convert PDF to MD" (only works if a PDF file is open)

Folder Integration: If a folder with the same name as your PDF already exists, the plugin will ask if you want to integrate the new files into this existing folder. This allows you to update or add to already converted documents.

⚙️ Settings

Setting Default Description
API Endpoint 'selfhosted' Select the API endpoint to use: 'Datalab', 'Selfhosted', 'Python Local API', 'Python Cloud API', or 'MistralAI'
Marker API Endpoint 'localhost:8000' The endpoint to use for the Marker API. Only shown when 'Selfhosted' is selected as the API endpoint.
Python API Endpoint 'localhost:8001' The endpoint to use for the Python API. Only shown when 'Python Local API' or 'Python Cloud API' is selected as the API endpoint.
Datalab API Key - Enter your Datalab API key. Only shown when 'Datalab' is selected as the API endpoint.
MistralAI API Key - Enter your MistralAI API key. Only shown when 'MistralAI' is selected as the API endpoint.
Languages 'en' The languages to use if OCR is needed, separated by commas. Only shown when 'Datalab' is selected as the API endpoint.
Force OCR false Force OCR (Activate this when auto-detect often fails, make sure to set the correct languages). Only shown when 'Datalab' is selected as the API endpoint.
Paginate false Add horizontal rules between each page. Available for both Datalab and MistralAI endpoints.
Image Limit 0 Maximum number of images to extract (0 for no limit). Only shown when 'MistralAI' is selected.
Image Minimum Size 0 Minimum height and width of images to extract (0 for no minimum). Only shown when 'MistralAI' is selected.
Move PDF to Folder false Move the PDF to the folder after conversion.
Create Asset Subfolder true Create an asset subfolder for images.
Extract Content 'all' Select the content to extract from the PDF. Options: 'Extract everything', 'Text Only', 'Images Only'.
Write Metadata false Write metadata as frontmatter in the Markdown file.
Delete Original PDF false Delete the original PDF after conversion.

🙏 Acknowledgements

This plugin wouldn't be possible without the incredible work of:

  • Marker Project: The AI model powering the conversions
  • Marker API: The API that enables self-hosting of the conversion service
  • MistralAI: For providing the free OCR capabilities

A huge thank you to these projects for their contributions to the community!

🐛 Troubleshooting

If you encounter issues related to the plugin itself, please open an issue in this repository. For problems with the conversion process or API, please refer to the Marker and Marker API repositories.

[!NOTE] When converting multiple files at once, be patient as the process can take a significant amount of time depending on the size and complexity of your PDFs. For very large batches, consider processing them in smaller groups.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


Happy converting! 📚➡️📝


Star History Chart

Extension points exported contracts — how you extend this code

Converter (Interface)
(no doc) [5 implementers]
src/converter.ts
MarkerSettings (Interface)
(no doc)
src/settings.ts
FormField (Interface)
(no doc)
src/utils/multipartUtils.ts
PythonApiSuccessResponse (Interface)
(no doc)
src/converters/markerLocalPythonApi.ts
ConversionResult (Interface)
(no doc)
src/converter.ts
MultipartRequestBody (Interface)
(no doc)
src/utils/multipartUtils.ts
PythonApiErrorDetail (Interface)
(no doc)
src/converters/markerLocalPythonApi.ts
ConverterSettingDefinition (Interface)
(no doc)
src/utils/converterSettingsUtils.ts

Core symbols most depended-on inside this repo

saveSettings
called by 7
src/main.ts
deleteOriginalFile
called by 4
src/utils/fileUtils.ts
isValidFile
called by 3
src/main.ts
convertFile
called by 3
src/main.ts
checkForExistingFiles
called by 3
src/utils/fileUtils.ts
testConnection
called by 2
src/converter.ts
setConverter
called by 2
src/main.ts
build
called by 2
src/utils/multipartUtils.ts

Shape

Method 53
Class 21
Interface 19
Function 14

Languages

TypeScript100%

Modules by API surface

src/converters/markerApiDocker.ts14 symbols
src/main.ts13 symbols
src/converters/datalabConverter.ts11 symbols
src/modals.ts10 symbols
src/utils/fileUtils.ts9 symbols
src/converters/markerCloudPythonApi.ts9 symbols
src/utils/multipartUtils.ts8 symbols
src/converters/markerLocalPythonApi.ts8 symbols
src/converter.ts8 symbols
src/settings.ts7 symbols
src/converters/mistralaiConverter.ts6 symbols
src/utils/converterSettingsUtils.ts3 symbols

For agents

$ claude mcp add obsidian-marker \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page