CONTRIBUTE Contribute to the Stencil Docs Create Your Fork It’s best to make changes to the Stencil docs on your local machine to check for consistent visual styling. Make sure you’ve created a fork of stencil on GitHub and cloned the repository locally on your machine. For more information, you can see GitHub’s documentation on “forking” or follow along with Stencil’s development contribution guide.You can then create a separate branch for your additions. Be sure to choose a descriptive branch name that best fits the type of content. The following is an example of a branch name you might use for adding a new function:git checkout -b jon-doe-function-addition Add New Content The Stencil docs make heavy use of Hugo’s archetypes feature. All content sections in Stencil documentation have an assigned archetype.Adding new content to the Stencil docs follows the same pattern, regardless of the content section:hugo new <DOCS-SECTION>/<new-content-lowercase>.md Add a New Function Once you have cloned the Stencil repository, you can create a new function via the following command. Keep the file name lowercase.hugo new functions/newfunction.md The archetype for functions according to the Stencil docs is as follows:archetypes/functions.md --- linktitle: "" description: "" publishdate: "" lastmod: "" categories: [functions] tags: [] ns: "" signature: [] workson: [] stencilversion: "" aliases: [] relatedfuncs: [] toc: false deprecated: false ---New Function Required Fields Here is a review of the front matter fields automatically generated for you using hugo new functions/*: titlethis will be auto-populated in all lowercase when you use hugo new generator.linktitlethe function’s actual casing (e.g., replaceRE rather than replacere).descriptiona brief description used to populate the Functions Quick Reference.categoriescurrently auto-populated with ‘functions` for future-proofing and portability reasons only; ignore this field.tagsonly if you think it will help end users find other related functionssignaturethis is a signature/syntax definition for calling the function (e.g., apply SEQUENCE FUNCTION [PARAM...]).worksonacceptable values include lists,taxonomies, terms, groups, and files.stencilversionthe version of Stencil that will ship with this new function.relatedfuncsother [templating functions][] you feel are related to your new function to help fellow Stencil users.{{.Content}}an extended description of the new function; examples are not only welcomed but encouraged.In the body of your function, expand the short description used in the front matter. Include as many examples as possible, and leverage the Stencil docs code shortcode. If you are unable to add examples but would like to solicit help from the Stencil community, add needsexample: true to your front matter.Add Code Blocks Code blocks are crucial for providing examples of Stencil’s new features to end users of the Stencil docs. Whenever possible, create examples that you think Stencil users will be able to implement in their own projects.Standard Syntax Across many pages on the Stencil docs, the typical triple-back-tick markdown syntax (```) is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored markdown. The Stencil docs use a version of highlight.js with a specific set of languages.Your options for languages are xml/html, go/golang, md/markdown/mkd, handlebars, apache, toml, yaml, json, css, asciidoc, ruby, powershell/ps, scss, sh/zsh/bash/git, http/https, and javascript/js.``` <h1>Hello world!</h1> ``` Code Block Shortcode The Stencil documentation comes with a very robust shortcode for adding interactive code blocks.code code is the Stencil docs shortcode you’ll use most often. code requires has only one named parameter: file. Here is the pattern:{{% code file="smart/file/name/with/path.html" download="download.html" copy="true" %}} A whole bunch of coding going on up in here! {{% /code %}} The following are the arguments passed into code: filethe only required argument. file is needed for styling but also plays an important role in helping users create a mental model around Stencil’s directory structure. Visually, this will be displayed as text in the top left of the code block.downloadif omitted, this will have no effect on the rendered shortcode. When a value is added to download, it’s used as the filename for a downloadable version of the code block.copya copy button is added automatically to all code shortcodes. If you want to keep the filename and styling of code but don’t want to encourage readers to copy the code (e.g., a “Do not do” snippet in a tutorial), use copy="false".Example code Input This example HTML code block tells Stencil users the following: This file could live in layouts/_default, as demonstrated by layouts/_default/single.html as the value for file.This snippet is complete enough to be downloaded and implemented in a Stencil project, as demonstrated by download="single.html".{{< code file="layouts/_default/single.html" download="single.html" >}} {{ define "main" }} <main> <article> <header> <h1>{{.Title}}</h1> {{with .Params.subtitle}} <span>{{.}}</span> </header> <div> {{.Content}} </div> <aside> {{.TableOfContents}} </aside> </article> </main> {{ end }} {{< /code >}} Blockquotes Blockquotes can be added to the Stencil documentation using typical Markdown blockquote syntax:> Without the threat of punishment, there is no joy in flight. The preceding blockquote will render as follows in the Stencil docs: Without the threat of punishment, there is no joy in flight.However, you can add a quick and easy <cite> element (added on the client via JavaScript) by separating your main blockquote and the citation with a hyphen with a single space on each side:> Without the threat of punishment, there is no joy in flight. - [Kobo Abe](https://en.wikipedia.org/wiki/Kobo_Abe) Which will render as follows in the Stencil docs: Without the threat of punishment, there is no joy in flight. - Kobo AbeAdmonitions Admonitions are common in technical documentation. The most popular is that seen in reStructuredText Directives. From the SourceForge documentation: Admonitions are specially marked “topics” that can appear anywhere an ordinary body element can. They contain arbitrary body elements. Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type. - SourceForgeThe Stencil docs contain three admonitions: note, tip, and warning.note Admonition Use the note shortcode when you want to draw attention to information subtly. note is intended to be less of an interruption in content than is warning.Example note Input note-with-heading.md {{% note %}} Here is a piece of information I would like to draw your **attention** to. {{% /note %}}Example note Output note-with-heading.html <aside class="admonition note"> <div class="note-icon"> </div> <div class="admonition-content"><p>Here is a piece of information I would like to draw your <strong>attention</strong> to.</p> </div> </aside> Example note Display tip Admonition Use the tip shortcode when you want to give the reader advice. tip, like note, is intended to be less of an interruption in content than is warning.Example tip Input using-tip.md {{% tip %}} Here's a bit of advice to improve your productivity with Stencil. {{% /tip %}}Example tip Output tip-output.html <aside class="admonition tip"> <div class="tip-icon"> </div> <div class="admonition-content"><p>Here’s a bit of advice to improve your productivity with Stencil.</p> </div> </aside> Example tip Display warning Admonition Use the warning shortcode when you want to draw the user’s attention to something important. A good usage example is for articulating breaking changes in Stencil versions, known bugs, or templating “gotchas.”Example warning Input warning-admonition-input.md {{% warning %}} This is a warning, which should be reserved for _important_ information like breaking changes. {{% /warning %}}Example warning Output warning-admonition-output.html <aside class="admonition warning"> <div class="admonition-icon"> </div> <div class="admonition-content"><p>This is a warning, which should be reserved for <em>important</em> information like breaking changes.</p> </div> </aside> Example warning Display </div> <div class="admonition-content"> This is a warning, which should be reserved for important information like breaking changes. About Stencil What is Stencil? License Getting Started Get Started Overview Install Stencil Quick Start Module Quick Start Native Extension Quick Start Reference Docs Reference Docs Overview Stencil Modules Overview Native Extensions Template Module Service Manifest Functions Functions Quick Reference file.Block file.Create file.Delete file.Path file.RemoveAll file.SetContents file.SetPath file.Skip file.Static stencil.AddToModuleHook stencil.ApplyTemplate stencil.Arg stencil.Args stencil.Exists stencil.GetGlobal stencil.GetModuleHook stencil.ReadBlocks stencil.ReadFile stencil.SetGlobal CLI Commands Quick Reference stencil stencil create stencil create module stencil describe stencil docs stencil docs generate stencil updater stencil updater get-channel stencil updater get-channels stencil updater list-releases stencil updater rollback stencil updater set-channel stencil updater status stencil updater use Contribute Contribute to Stencil Development Documentation Maintenance