Struct gutenberg::SectionFrontMatter [] [src]

pub struct SectionFrontMatter {
    pub title: Option<String>,
    pub description: Option<String>,
    pub sort_by: Option<SortBy>,
    pub template: Option<String>,
    pub paginate_by: Option<usize>,
    pub paginate_path: Option<String>,
    pub insert_anchor: Option<InsertAnchor>,
    pub render: Option<bool>,
    pub extra: Option<HashMap<String, Value>>,
}

The front matter of every section

Fields

of the page</p> </div><span id='structfield.description' class="structfield"> <span id='description.v' class='invisible'> <code>description: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/collections/string/struct.String.html" title="struct collections::string::String">String</a>></code> </span></span><div class='docblock'><p>Description in <meta> that appears when linked, e.g. on twitter</p> </div><span id='structfield.sort_by' class="structfield"> <span id='sort_by.v' class='invisible'> <code>sort_by: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../gutenberg/enum.SortBy.html" title="enum gutenberg::SortBy">SortBy</a>></code> </span></span><div class='docblock'><p>Whether to sort by "date", "order" or "none". Defaults to <code>none</code>.</p> </div><span id='structfield.template' class="structfield"> <span id='template.v' class='invisible'> <code>template: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/collections/string/struct.String.html" title="struct collections::string::String">String</a>></code> </span></span><div class='docblock'><p>Optional template, if we want to specify which template to render for that page</p> </div><span id='structfield.paginate_by' class="structfield"> <span id='paginate_by.v' class='invisible'> <code>paginate_by: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code> </span></span><div class='docblock'><p>How many pages to be displayed per paginated page. No pagination will happen if this isn't set</p> </div><span id='structfield.paginate_path' class="structfield"> <span id='paginate_path.v' class='invisible'> <code>paginate_path: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/collections/string/struct.String.html" title="struct collections::string::String">String</a>></code> </span></span><div class='docblock'><p>Path to be used by pagination: the page number will be appended after it. Defaults to <code>page</code>.</p> </div><span id='structfield.insert_anchor' class="structfield"> <span id='insert_anchor.v' class='invisible'> <code>insert_anchor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../gutenberg/enum.InsertAnchor.html" title="enum gutenberg::InsertAnchor">InsertAnchor</a>></code> </span></span><div class='docblock'><p>Whether to insert a link for each header like in Github READMEs. Defaults to false The default template can be overridden by creating a <code>anchor-link.html</code> template and CSS will need to be written if you turn that on.</p> </div><span id='structfield.render' class="structfield"> <span id='render.v' class='invisible'> <code>render: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code> </span></span><div class='docblock'><p>Whether to render that section or not. Defaults to <code>true</code>. Useful when the section is only there to organize things but is not meant to be used directly, like a posts section in a personal site</p> </div><span id='structfield.extra' class="structfield"> <span id='extra.v' class='invisible'> <code>extra: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/collections/string/struct.String.html" title="struct collections::string::String">String</a>, <a class="enum" href="https://docs.rs/serde_json/1.0.2/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>>></code> </span></span><div class='docblock'><p>Any extra parameter present in the front matter</p> </div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/gutenberg/front_matter/section.rs.html#52-94' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.parse' class="method"><span id='parse.v' class='invisible'><code>fn <a href='#method.parse' class='fnname'>parse</a>(toml: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="type" href="../gutenberg/errors/type.Result.html" title="type gutenberg::errors::Result">Result</a><<a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a>></code></span></h4> <h4 id='method.sort_by' class="method"><span id='sort_by.v-1' class='invisible'><code>fn <a href='#method.sort_by' class='fnname'>sort_by</a>(&self) -> <a class="enum" href="../gutenberg/enum.SortBy.html" title="enum gutenberg::SortBy">SortBy</a></code></span></h4> <div class='docblock'><p>Returns the current sorting method, defaults to <code>None</code> (== no sorting)</p> </div><h4 id='method.is_paginated' class="method"><span id='is_paginated.v' class='invisible'><code>fn <a href='#method.is_paginated' class='fnname'>is_paginated</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h4> <div class='docblock'><p>Only applies to section, whether it is paginated or not.</p> </div><h4 id='method.should_render' class="method"><span id='should_render.v' class='invisible'><code>fn <a href='#method.should_render' class='fnname'>should_render</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h4> </div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/gutenberg/front_matter/section.rs.html#21' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4> <div class='docblock'><p>Formats the value using the given formatter.</p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/gutenberg/front_matter/section.rs.html#21' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span></h4> <div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></span></h4> <div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/gutenberg/front_matter/section.rs.html#21' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h4> <div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p> </div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h4> <div class='docblock'><p>This method tests for <code>!=</code>.</p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/gutenberg/front_matter/section.rs.html#96-110' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../gutenberg/struct.SectionFrontMatter.html" title="struct gutenberg::SectionFrontMatter">SectionFrontMatter</a></code></span></h4> <div class='docblock'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p> </div></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>⇤</dt> <dd>Move up in search results</dd> <dt>⇥</dt> <dd>Move down in search results</dd> <dt>⏎</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "gutenberg"; </script> <script src="../../../main-20170531-1.19.0-dev-28a93c1f4.js"></script> <script defer src="../search-index.js"></script> </body> </html>