{
  "attributes": {
    "id": "tools",
    "linkText": "Fountainhead Tools",
    "title": "Fountainhead Documentation Tools and Features"
  },
  "body": "<p>Fountainhead isn't just about writing <em>beautiful</em> documentation. Fountainhead\ncomes with a set of tools for writing interactive documentation.</p>\n{{#fountainhead-header tagName=\"h2\" elementId=\"runtime-template-compilation\"}}Runtime Template Compilation{{/fountainhead-header}}\n<p>All DocBlock descriptions and guides are compiled to template partials during\nruntime. This lets you use any component available in your app into your descriptions.\nThis means that you're not limited to a predefined set of documentation components\npre-bundled with some library. Want to make a custom drawer component for rendering\nexamples of property values? With Fountainhead all you have to do is add the\ncomponent to your application and use it in a DocBlock.</p>\n{{#fountainhead-header tagName=\"h2\" elementId=\"crosslink-component\"}}CrossLink Component{{/fountainhead-header}}\n<p>Use the {{c-l class='CrossLink'}} component to reference modules, classes, methods\nand properties elsewhere in your documentation:</p>\n<pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\" spellcheck=\"true\">/**\n * DocBlock for some class, with a direct link to the \\{{c-l 'init'}} method.\n * @property active\n * @type {boolean}\n */</span>\n</code></pre>\n<p>{{#c-l class='CrossLink'}}See the CrossLink Component for examples.{{/c-l}}</p>\n{{#fountainhead-header tagName=\"h2\" elementId=\"state-in-docblock-descriptions\"}}State in DocBlock Descriptions{{/fountainhead-header}}\n<p>Your documentation descriptions are wrapped in an instance of\n<a href=\"https://healthsparq.github.io/ember-radical/docs/classes/Component.RadState\">Ember Radical's <code>rad-state</code></a>\nfor a convenient and sandboxed state property and state actions. This is\nconvenient for including examples in your documentation that require simple\nstate management.</p>\n<p>Use <code>state</code> to access the sandboxed state and any of <code>stateActions.open</code>,\n<code>stateActions.close</code> and <code>stateActions.toggleState</code> to mutate the state.</p>\n{{#fountainhead-header tagName=\"h2\" elementId=\"glimmer-code-blocks\"}}Glimmer Code Blocks{{/fountainhead-header}}\n<p>Use the identifier <code>glimmer</code> with a fenced code block to highlight the code block\ncontents and render an unescaped example of the code block immediately after\nthe code block.</p>\n<p>Eg, the following code block:</p>\n<pre class=\"language-markdown\"><code class=\"language-markdown\"><span class=\"token template-string\"><span class=\"token string\">``</span></span><span class=\"token template-string\"><span class=\"token string\">`glimmer\n  \\{{some-component example=true}}\n`</span></span><span class=\"token template-string\"><span class=\"token string\">``</span></span>\n</code></pre>\n<p>Will actually be parsed as:</p>\n<pre class=\"language-markdown\"><code class=\"language-markdown\"><span class=\"token template-string\"><span class=\"token string\">``</span></span><span class=\"token template-string\"><span class=\"token string\">`glimmer\n  \\{{some-component example=true}}\n`</span></span><span class=\"token template-string\"><span class=\"token string\">``</span></span>\n<span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span>some<span class=\"token operator\">-</span>component example<span class=\"token operator\">=</span><span class=\"token boolean\">true</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n</code></pre>\n<p>You can also add data when rendering you components, this is super useful for showing\nvariations of a theme or components in different states.</p>\n<p>At the top of your <code>glimmer</code> add data using a JSON string\ne.g. <code>data={'things': ['primary', 'secondary', 'success']}</code>.  This will make every top level key available\nto your example and will be stripped from the displayed code.</p>\n<p>You can then use the properties in the template.</p>\n<pre class=\"language-handlebars\"><code class=\"language-handlebars\"><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span>#each colors <span class=\"token keyword\">as</span> <span class=\"token operator\">|</span>color<span class=\"token operator\">|</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span>#fountainhead<span class=\"token operator\">-</span>button brand<span class=\"token operator\">=</span>color<span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span>color<span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span><span class=\"token operator\">/</span>fountainhead<span class=\"token operator\">-</span>button<span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span><span class=\"token operator\">/</span>each<span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n</code></pre>\n<p>data={\"colors\": [\"primary\", \"secondary\", \"success\"]}\n{{#each colors as |color|}}\n{{#fountainhead-button brand=color}}{{color}}{{/fountainhead-button}}\n{{/each}}</p>\n{{#fountainhead-header tagName=\"h2\" elementId=\"markdown-in-docblock-descriptions-and-guides\"}}Markdown in DocBlock Descriptions and Guides{{/fountainhead-header}}\n<p>Fountainhead has full support for markdown in documentation blocks and guides.\nIf you're not familiar with markdown, you can start with a tutorial at\n<a href=\"http://www.markdowntutorial.com/\">Markdown Tutorial</a></p>\n<p><em><small>(Markdown is parsed using <a href=\"https://markdown-it.github.io/markdown-it/\">markdown-it</a>)</small></em></p>\n",
  "frontmatter": "id: tools\nlinkText: Fountainhead Tools\ntitle: Fountainhead Documentation Tools and Features",
  "id": "tools",
  "type": "guides"
}