{"id":"6b0857af5a2625e44ecaad02","slug":"author-guide","title":"Author guide: writing in Art of Devs","summary":"A showcase article: every editor block – gallery, chart, diagram, timeline, quiz, tabbed code and embeds – told through a pierogi place in a hexagon.","servedLang":"en","availableLangs":["pl","en"],"topics":[],"techs":["general"],"tags":["author-guide","editor","tiptap"],"level":"beginner","kind":"tutorial","access":"members","status":"published","cover":"/api/files/6b0857ab5a2625e44ecaacea","author":{"id":"6b0857a15a2625e44ecaabec","name":"Anna Autorka","avatar":"/api/files/6b0857ec5a2625e44ecab0c6","handle":"anna-autorka","community":true},"readingMinutes":8,"stats":{"views":6,"likes":0,"bookmarks":1,"comments":0},"publishedAt":"2026-11-26T16:00:47.323Z","updatedAt":"2026-11-27T13:07:39.516Z","requestedLang":"en","theme":{"hero":"split","heroMedia":{"kind":"image","fileId":"6b0857ab5a2625e44ecaacea","url":"/api/files/6b0857ab5a2625e44ecaacea"},"accent":"ember","background":"dots","weaveResources":true,"toc":"right"},"seoDescription":"How to write eye-catching articles in Art of Devs: theme, section bands, columns, galleries, charts, Mermaid diagrams, timelines, quizzes, code in several languages and embeds.","wordCount":1467,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Art of Devs should "},{"type":"text","text":"show","marks":[{"type":"bold"}]},{"type":"text","text":" architecture, not just talk about it. This guide doubles as a showcase article: using Halina's pierogi place and "},{"type":"text","text":"hexagonal architecture","marks":[{"type":"link","attrs":{"href":"/en/topics/hexagonal-architecture"}}]},{"type":"text","text":" it walks through every editor block – from galleries and charts to a "},{"type":"text","text":"quiz","marks":[{"type":"italic"}]},{"type":"text","text":"."}]},{"type":"stats","attrs":{"items":[{"value":"8","label":"accent colours","hint":"set the theme in the Studio \"Appearance\" tab"},{"value":"5","label":"languages in one code group","hint":"C#, TypeScript, Java, Go, Python"},{"value":"30%","label":"of the text is visible to guests","hint":"the rest after signing in"}]}},{"type":"callout","attrs":{"variant":"tip","title":"Tip"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Every guest sees roughly the first 30% of the content. Put the problem and the intuition there – code and details can sit behind the sign-in wall."}]}]},{"type":"heading","attrs":{"level":2,"id":"the-problem-spaghetti-code"},"content":[{"type":"text","text":"The problem: spaghetti code"}]},{"type":"columns","attrs":{"layout":"1-1","valign":"center"},"content":[{"type":"column","content":[{"type":"paragraph","content":[{"type":"text","text":"An orders controller that writes to the database, sends text messages and calculates discounts works fine – until the first change. Every new integration means digging through business logic."}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"logic welded to the database and the SMS gateway,"}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"tests need real infrastructure,"}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"one change means risk in several places at once."}]}]}]}]},{"type":"column","content":[{"type":"image","attrs":{"src":"/api/files/6b0857ac5a2625e44ecaacec","alt":"Spaghetti code: OrdersController welded with noodles to SQL Server, an SMS gateway, a webhook and a business rule","caption":"Spaghetti code: everything connected to everything"}}]}]},{"type":"paragraph","content":[{"type":"text","text":"Add a chart (the "},{"type":"text","text":"chart","marks":[{"type":"code"}]},{"type":"text","text":" block) from the \"/\" menu and type the data into the block panel:"}]},{"type":"chart","attrs":{"type":"bar","title":"Cost of changing the SMS provider: spaghetti vs hexagon","caption":"Illustrative example – made-up story point values, not a measurement from a real project.","unit":"SP","data":{"labels":["1. new provider","2. backup provider","3. new message format","4. test fake"],"series":[{"name":"Spaghetti","values":[8,13,13,21]},{"name":"Hexagon","values":[3,2,2,1]}]}}},{"type":"heading","attrs":{"level":2,"id":"ports-and-adapters"},"content":[{"type":"text","text":"Ports and adapters"}]},{"type":"image","attrs":{"src":"/api/files/6b0857ad5a2625e44ecaacf0","alt":"A laptop with a USB-C socket as the ICustomerNotifier port and three plugs as adapters: SMS, console and a test fake","caption":"A port is the socket, an adapter is the plug","width":"normal","align":"right"}},{"type":"paragraph","content":[{"type":"text","text":"The core of the application – the \"kitchen\" – defines "},{"type":"text","text":"ports","marks":[{"type":"bold"}]},{"type":"text","text":": interfaces that describe what it needs, such as "},{"type":"text","text":"IOrderBook","marks":[{"type":"code"}]},{"type":"text","text":" or "},{"type":"text","text":"ICustomerNotifier","marks":[{"type":"code"}]},{"type":"text","text":". The outside world connects through "},{"type":"text","text":"adapters","marks":[{"type":"bold"}]},{"type":"text","text":": an HTTP controller, an EF Core repository, a Kafka producer or a fake in a test."}]},{"type":"paragraph","content":[{"type":"text","text":"Dependencies always point inward. A right-aligned image lets the text flow around it and stacks above the paragraph on phones. Diagrams (the "},{"type":"text","text":"diagram","marks":[{"type":"code"}]},{"type":"text","text":" block) are written in "},{"type":"text","text":"drawings","marks":[{"type":"strike"}]},{"type":"text","text":" Mermaid syntax:"}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  A[\"HTTP client\"] --> B[\"HTTP adapter: OrdersController\"]\n  B --> C{{\"Inbound port: IPlaceOrder\"}}\n  C --> D[\"Use case: PlaceOrderHandler\"]\n  D --> E([\"Domain: Order.Place()\"])\n  D --> F{{\"Outbound ports: IOrderBook, IOrderAnnouncer\"}}\n  F --> G[(\"Adapter: SQL Server (EF Core)\")]\n  F --> H[\"Adapter: Kafka\"]","caption":"The path of a request through the hexagon"}},{"type":"heading","attrs":{"level":2,"id":"code-in-five-languages"},"content":[{"type":"text","text":"Code in five languages"}]},{"type":"paragraph","content":[{"type":"text","text":"Insert the same example in several languages as a tabbed group. The reader picks a language once and the choice applies to every group on the page. File names end up in the \"Download code\" ZIP."}]},{"type":"codeGroup","attrs":{"title":"Strategy – shipping cost"},"content":[{"type":"codeBlock","attrs":{"language":"csharp","filename":"Shipping.cs"},"content":[{"type":"text","text":"public interface IShippingStrategy\n{\n    decimal Cost(decimal weightKg);\n}\n\npublic sealed class Courier : IShippingStrategy\n{\n    public decimal Cost(decimal weightKg) => 15m + 2m * weightKg;\n}\n\npublic sealed class Parcel : IShippingStrategy\n{\n    public decimal Cost(decimal weightKg) => 9.99m;\n}\n\npublic sealed class Checkout(IShippingStrategy shipping)\n{\n    public decimal Total(decimal items, decimal kg) => items + shipping.Cost(kg);\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"shipping.ts"},"content":[{"type":"text","text":"interface ShippingStrategy {\n  cost(weightKg: number): number;\n}\n\nconst courier: ShippingStrategy = { cost: (kg) => 15 + 2 * kg };\nconst parcel: ShippingStrategy = { cost: () => 9.99 };\n\nclass Checkout {\n  constructor(private readonly shipping: ShippingStrategy) {}\n\n  total(items: number, kg: number): number {\n    return items + this.shipping.cost(kg);\n  }\n}\n\nconsole.log(new Checkout(courier).total(120, 3)); // 141\nconsole.log(new Checkout(parcel).total(120, 3)); // 129.99"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"Checkout.java"},"content":[{"type":"text","text":"interface ShippingStrategy {\n    double cost(double weightKg);\n}\n\nrecord Courier() implements ShippingStrategy {\n    public double cost(double kg) { return 15 + 2 * kg; }\n}\n\nrecord Parcel() implements ShippingStrategy {\n    public double cost(double kg) { return 9.99; }\n}\n\npublic class Checkout {\n    private final ShippingStrategy shipping;\n    public Checkout(ShippingStrategy shipping) { this.shipping = shipping; }\n    public double total(double items, double kg) { return items + shipping.cost(kg); }\n}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"shipping.go"},"content":[{"type":"text","text":"package checkout\n\ntype ShippingStrategy interface {\n\tCost(weightKg float64) float64\n}\n\ntype Courier struct{}\n\nfunc (Courier) Cost(kg float64) float64 { return 15 + 2*kg }\n\ntype Parcel struct{}\n\nfunc (Parcel) Cost(float64) float64 { return 9.99 }\n\ntype Checkout struct{ Shipping ShippingStrategy }\n\nfunc (c Checkout) Total(items, kg float64) float64 {\n\treturn items + c.Shipping.Cost(kg)\n}"}]},{"type":"codeBlock","attrs":{"language":"python","filename":"shipping.py"},"content":[{"type":"text","text":"from typing import Protocol\n\n\nclass ShippingStrategy(Protocol):\n    def cost(self, weight_kg: float) -> float: ...\n\n\nclass Courier:\n    def cost(self, weight_kg: float) -> float:\n        return 15 + 2 * weight_kg\n\n\nclass Parcel:\n    def cost(self, weight_kg: float) -> float:\n        return 9.99\n\n\ndef total(items: float, kg: float, shipping: ShippingStrategy) -> float:\n    return items + shipping.cost(kg)"}]}]}]},"toc":[{"id":"the-problem-spaghetti-code","text":"The problem: spaghetti code","level":2,"locked":false},{"id":"ports-and-adapters","text":"Ports and adapters","level":2,"locked":false},{"id":"code-in-five-languages","text":"Code in five languages","level":2,"locked":false},{"id":"gallery-halina-s-pierogi-place","text":"Gallery: Halina's pierogi place","level":2,"locked":true},{"id":"where-it-came-from","text":"Where it came from","level":2,"locked":true},{"id":"see-it-in-motion","text":"See it in motion","level":2,"locked":true},{"id":"when-it-pays-off-and-when-it-does-not","text":"When it pays off and when it does not","level":2,"locked":true},{"id":"check-yourself","text":"Check yourself","level":2,"locked":true},{"id":"block-cheat-sheet","text":"Block cheat sheet","level":2,"locked":true},{"id":"around-the-topic","text":"Around the topic","level":2,"locked":true},{"id":"what-next","text":"What next","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":46,"visibleBlocks":15,"resources":[{"id":"6b0857a53c96f2d34d0b321a","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=v9ejT8FO-7I","embedUrl":"https://www.youtube-nocookie.com/embed/v9ejT8FO-7I","title":"Strategy Pattern – Design Patterns (ep 1)","description":"","author":"Christopher Okhravi","thumbnailUrl":"https://i.ytimg.com/vi/v9ejT8FO-7I/hqdefault.jpg","durationSec":null,"lang":"en","topics":["strategy"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:37.397Z","updatedAt":"2026-11-26T16:00:37.397Z"},{"id":"6b0857a63c96f2d34d0b3226","type":"podcast","provider":"spotify","url":"https://open.spotify.com/show/2OZlxAcBLYzDodHYVKFost","embedUrl":"https://open.spotify.com/embed/show/2OZlxAcBLYzDodHYVKFost","title":"Software Engineering Radio","description":"A podcast for professional software developers: tutorials on specific topics and interviews with people from the software engineering world.","author":"Software Engineering Radio","thumbnailUrl":"https://i.scdn.co/image/ab6765630000ba8a853ae313d73a99667972b3f6","durationSec":null,"lang":"en","topics":["microservices","clean-architecture"],"techs":["general"],"tags":[],"price":"free","featured":true,"featuredOrder":4,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:38.387Z","updatedAt":"2026-11-26T16:00:38.387Z"},{"id":"6b0857a63c96f2d34d0b322a","type":"article","provider":"medium","url":"https://medium.com/ssense-tech/hexagonal-architecture-there-are-always-two-sides-to-every-story-bc0780ed7d9c","embedUrl":null,"title":"Hexagonal Architecture: There Are Always Two Sides to Every Story","description":"","author":"SSENSE-TECH","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["hexagonal-architecture"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:38.831Z","updatedAt":"2026-11-26T16:00:38.831Z"},{"id":"6b0857a53c96f2d34d0b3218","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=th4AgBcrEHA","embedUrl":"https://www.youtube-nocookie.com/embed/th4AgBcrEHA","title":"Alistair in the \"Hexagone\" 1/3","description":"","author":"DDD FR","thumbnailUrl":"https://i.ytimg.com/vi/th4AgBcrEHA/hqdefault.jpg","durationSec":null,"lang":"en","topics":["hexagonal-architecture"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:37.229Z","updatedAt":"2026-11-26T16:00:37.229Z"},{"id":"6b0857a53c96f2d34d0b3219","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=2dKZ-dWaCiU","embedUrl":"https://www.youtube-nocookie.com/embed/2dKZ-dWaCiU","title":"Robert C. Martin (Uncle Bob), Clean Architecture and Design","description":"","author":"IT konekt","thumbnailUrl":"https://i.ytimg.com/vi/2dKZ-dWaCiU/hqdefault.jpg","durationSec":null,"lang":"en","topics":["clean-architecture","solid"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:37.312Z","updatedAt":"2026-11-26T16:00:37.312Z"}],"challenges":[],"attachments":[],"hasCode":true,"repoUrl":null,"series":[],"prev":null,"next":null,"featured":false,"authorCard":{"id":"6b0857a15a2625e44ecaabec","name":"Anna Autorka","avatar":"/api/files/6b0857ec5a2625e44ecab0c6","handle":"anna-autorka","headline":"Architektka .NET · DDD · Hexagonal","community":true,"reputation":{"points":50,"level":{"key":"newcomer","label":"Newcomer"}},"articles":1,"skills":[]}}