Google Drive
Markmeld supports using Google Docs directly as content sources. This allows collaborative authoring in Google Docs while building documents with markmeld.
- Create a Google Cloud service account
- Download the credentials JSON
- Set the environment variable:
export MM_GOOGLE_DRIVE_CREDENTIALS="/path/to/credentials.json"- Share your Google Docs with the service account email
Configuration
Section titled “Configuration”Set type: google-doc in your target:
targets: manuscript: type: google-doc jinja_template: template.jinja output_file: manuscript.pdf data: google_docs: doc_id: "YOUR_GOOGLE_DOC_ID" folder_id: "YOUR_FOLDER_ID" # Optional: for figuresGet the doc ID from the URL: docs.google.com/document/d/YOUR_DOC_ID/edit
Building
Section titled “Building”mm manuscript # Normal build (uses cache)mm manuscript --force-refresh # Bypass cachemm manuscript --clear-cache # Clear cache firstFigure handling
Section titled “Figure handling”When you specify a folder_id (or let it auto-detect the doc’s parent folder), markmeld:
- Converts SVG files to PDF
- Downloads CSV and data files
- Updates figure paths in the document
- Caches converted files
Cache location
Section titled “Cache location”.cache/└── {doc_id}/ ├── docs/ # Cached markdown ├── converted/ # SVG→PDF conversions └── csv/ # Downloaded data filesPython API
Section titled “Python API”from markmeld.google_drive import GoogleDriveProcessor
processor = GoogleDriveProcessor()doc = processor.download_doc('doc-id')print(doc.content)