{
  "id": "01a024a8-0c00-78f9-8627-034cad93673c",
  "type": "post",
  "thread": [
    {
      "id": "01a024a8-0c00-78f9-8627-034cad93673c",
      "depth": 0,
      "author": "SEBASTIEN PORTRAIT",
      "url": "https://vutuv.de/sebastien_portrait/posts/01a024a8-0c00-78f9-8627-034cad93673c",
      "published_on": "2026-08-21",
      "in_reply_to_id": null,
      "author_username": "sebastien_portrait",
      "body_markdown": "Coelho - Structured rich text for Phoenix\n\nI've just published Coelho, a structured rich text library for Phoenix.\n\nThe idea is somewhat inspired by Rails' Action Text: provide a proper rich text layer between the editor in the browser and the application's data model.\n\nBut instead of storing HTML, Coelho stores the document as a structured JSON tree — the same kind of document model used by ProseMirror.\n\nThat gives the application a single source of truth for both the editor and the server:\n\n* define the document schema once in Elixir\n* export the schema to ProseMirror\n* validate documents before they reach the database\n* store the document directly in a `jsonb` column\n* render it to HTML or extract plain text\n* customise rendering without changing the stored document\n* use different, restricted schemas for different rich text fields\n* validate and cast rich text directly through Ecto\n* use it from Phoenix LiveView with an included editor\n* support attachments with URLs resolved at render time\n\nOne of the things I particularly wanted to avoid is treating HTML as the data model.\n\nWhen rich text is stored as HTML, the markup becomes part of the persisted data. With a structured document instead, the data remains queryable and migratable, while rendering stays an application-level decision.\n\nCoelho also deliberately keeps the core small: no file storage, image processing or collaborative editing. Those are integration points rather than responsibilities of the document layer.\n\nIt's early, but the core is already in place and tested.\n\nI'd particularly love feedback from people building Phoenix applications that need rich text, especially if you've used Action Text or another structured rich text solution before.\n\nHexDocs: https://coelho.hexdocs.pm/readme.html\n\nHex.pm: https://hex.pm/packages/coelho\n\nhttps://github.com/nseaSeb/coelho",
      "in_reply_to_author": null
    }
  ],
  "description": "Coelho - Structured rich text for Phoenix",
  "title": "SEBASTIEN PORTRAIT · 2026-08-21",
  "author": {
    "name": "SEBASTIEN PORTRAIT",
    "username": "sebastien_portrait",
    "url": "https://vutuv.de/sebastien_portrait"
  },
  "replies": [],
  "url": "https://vutuv.de/sebastien_portrait/posts/01a024a8-0c00-78f9-8627-034cad93673c",
  "formats": {
    "json": "https://vutuv.de/sebastien_portrait/posts/01a024a8-0c00-78f9-8627-034cad93673c.json",
    "text": "https://vutuv.de/sebastien_portrait/posts/01a024a8-0c00-78f9-8627-034cad93673c.txt",
    "markdown": "https://vutuv.de/sebastien_portrait/posts/01a024a8-0c00-78f9-8627-034cad93673c.md",
    "xml": "https://vutuv.de/sebastien_portrait/posts/01a024a8-0c00-78f9-8627-034cad93673c.xml"
  },
  "tags": [
    "Elixir",
    "rich-text",
    "phoenix",
    "library"
  ],
  "in_reply_to": null,
  "generated_at": "2026-08-31T07:18:24Z",
  "schema_version": 3,
  "like_count": 1,
  "published_on": "2026-08-21",
  "images": [],
  "license": null,
  "review": null,
  "fediverse_reaction_count": 0,
  "reply_count": 0,
  "fediverse_replies": [],
  "body_markdown": "Coelho - Structured rich text for Phoenix\n\nI've just published Coelho, a structured rich text library for Phoenix.\n\nThe idea is somewhat inspired by Rails' Action Text: provide a proper rich text layer between the editor in the browser and the application's data model.\n\nBut instead of storing HTML, Coelho stores the document as a structured JSON tree — the same kind of document model used by ProseMirror.\n\nThat gives the application a single source of truth for both the editor and the server:\n\n* define the document schema once in Elixir\n* export the schema to ProseMirror\n* validate documents before they reach the database\n* store the document directly in a `jsonb` column\n* render it to HTML or extract plain text\n* customise rendering without changing the stored document\n* use different, restricted schemas for different rich text fields\n* validate and cast rich text directly through Ecto\n* use it from Phoenix LiveView with an included editor\n* support attachments with URLs resolved at render time\n\nOne of the things I particularly wanted to avoid is treating HTML as the data model.\n\nWhen rich text is stored as HTML, the markup becomes part of the persisted data. With a structured document instead, the data remains queryable and migratable, while rendering stays an application-level decision.\n\nCoelho also deliberately keeps the core small: no file storage, image processing or collaborative editing. Those are integration points rather than responsibilities of the document layer.\n\nIt's early, but the core is already in place and tested.\n\nI'd particularly love feedback from people building Phoenix applications that need rich text, especially if you've used Action Text or another structured rich text solution before.\n\nHexDocs: https://coelho.hexdocs.pm/readme.html\n\nHex.pm: https://hex.pm/packages/coelho\n\nhttps://github.com/nseaSeb/coelho",
  "bookmark_count": 0,
  "fediverse_like_count": 0,
  "fediverse_reactions": [],
  "fediverse_reply_count": 0,
  "fediverse_repost_count": 0,
  "likers": [
    {
      "name": "Stefan Wintermeyer",
      "username": "wintermeyer",
      "url": "https://vutuv.de/wintermeyer"
    }
  ],
  "repost_count": 1,
  "thread_truncated": false,
  "verified_author_links": []
}
