Writing on Infusion /patterns/writing/ Recent content in Writing on Infusion Hugo -- gohugo.io en-us Library structure /patterns/writing/library-structure/ Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/library-structure/ Before you can set about documenting patterns, you need to know where everything goes. The simplest folder structure looks like this: └── content ├── _index.md └── patterns ├── name-of-my-pattern.md └── name-of-my-other-pattern.md /content - This is where all of your content lives. You won’t need to visit any other folders very frequently. _index.md — This is the content for your home page. /patterns — This is the folder where individual pattern files are kept. Markdown & metadata /patterns/writing/markdown-and-metadata/ Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/markdown-and-metadata/ In Infusion, design patterns are documented using markdown. To create a new pattern file, just add a file with the .md extension to the /patterns folder. It’s recommended you use “kebab case” to name the file ( words separated by hyphens). For example, a pattern with the title “Menu button” should probably have the filename menu-button. Then you get a nice clean URL: your-company.com/patterns/menu-button. If you’re not familiar with writing markdown, there are a number of tutorials available. Including images /patterns/writing/including-images/ Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/including-images/ From time to time, you’ll be wanting to include images illustrating the documented pattern in hand. Images live in the static folder, which is a sibling of the /content folder you’ll be mostly working in. ├── content └── static └── images ├── logo.png └── menu-button.gif When you first make a copy of Infusion, Infusion’s own logo will be included. You should replace this with your own company or project logo. Notes & warnings /patterns/writing/notes-and-warnings/ Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/notes-and-warnings/ Infusion acknowledges that simple markdown is limiting when it comes to writing compelling documentation, so it provides a number of “shortcodes”. Shortcodes offer a simple syntax for including rich content. For example, Infusion provides shortcodes for including notes and warnings. Notes You may wish to pick out some content in your pattern’s documentation as a note — an aside to the main thrust of the pattern’s description. This is possible using the following syntax: References /patterns/writing/references/ Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/references/ Cross-references Infusion provides an easy mechanism to cross-reference patterns, by name, using the pattern shortcode. For example, I can reference the pattern here. Here’s what the markdown looks like, including the shortcode: I can reference the {{% pattern "Notes and warnings" %}} pattern here. This saves you having to worry about pathing and decorates the generated link with a bookmark icon, identifying the link as a pattern reference visually.