Skip to content

Document Creator 0.2.0: Document templates and PDFs through Google Docs

Document Creator 0.2.0 is the first Hex release of the PhoenixKit module for document templates. Templates and documents are Google Docs in the site’s connected Google Drive: admins edit them in Google Docs, create documents from templates with filled-in variables, and download them as PDF.

Templates and documents

The module adds Document Creator to the admin menu, with Documents and Templates pages. Each lists the files of its Google Drive folder as cards with a thumbnail, or as a list, with the time each was last modified. Edit opens the file in Google Docs in a new tab, and PDF downloads it as a PDF exported by Google Drive. A PDF over 5 MB is not sent through the page; the admin is asked to export it from Google Docs instead.

Creating a document

Create New Document opens a dialog: “Start blank or choose a template.” Blank Document makes an empty Google Doc. Choosing a template copies it, and the dialog asks for the values of its variables under Fill Template Variables. Variables are written in the template as {{ client_name }} or {{ date }}; the module finds them in the text and replaces them through the Google Docs API.

Connecting Google

Admin > Settings > Document Creator holds the Google connection. Enter the Client ID and Client Secret of an OAuth client from the Google Cloud Console, with the Google Docs API and Google Drive API turned on, then connect a Google account. The page has step-by-step Setup Instructions, shows the Redirect URI to register, and can disconnect the account again. Two folders, templates and documents, are used in the connected Drive; existing ones are reused.

Upgrading

Add the dependency, run mix deps.get, and run mix ecto.migrate so PhoenixKit’s V86 and V88 migrations are applied; V88 adds the google_doc_id columns. Turn the module on in Admin > Modules. No local PDF tools such as Chrome are needed: PDF export happens in Google Drive.

Full release notes: Document Creator 0.2.0

0.2.0 · 29 March 2026

Changed

  • Replace local editor architecture (GrapesJS, TipTap, pdfme) with Google Docs API
  • Replace ChromicPDF/Gotenberg PDF generation with Google Drive API export
  • Rewrite Documents context for Google Drive operations (list, create, copy, variable substitution)
  • Simplify admin tabs from 13 to 3 (parent + documents + templates)
  • Simplify Paths module to 4 helpers (index, templates, documents, settings)
  • Rewrite CreateDocumentModal for Google Docs workflow

Added

  • Add GoogleDocsClient — OAuth 2.0, Google Docs API, Google Drive API
  • Add GoogleOAuthSettingsLive — admin settings page for connecting Google account
  • Add google_doc_id column to templates, documents, and headers/footers (PhoenixKit V88 migration)
  • Add unit tests for GoogleDocsClient

Removed

  • Remove GrapesJS editor and all JS hooks (editor_hooks.js, ~1500 lines)
  • Remove TemplateEditorLive, DocumentEditorLive, HeaderFooterEditorLive LiveViews
  • Remove HeaderFooterLive listing page
  • Remove EditorPanel and EditorScripts components
  • Remove EditorPdfHelpers (ChromicPDF/Gotenberg PDF generation)
  • Remove DocumentFormat module (legacy JSON interchange format)
  • Remove TestingLive, EditorPdfmeTestLive, EditorTiptapTestLive (editor comparison pages)
  • Remove chromic_pdf and solid dependencies

Document Creator 0.2.0. Install or update: {:phoenix_kit_document_creator, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.