Skip to content

Commit

Permalink
chore: rebuilds docs with readme included
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Jul 2, 2015
1 parent 338e2a4 commit 24b2dc5
Show file tree
Hide file tree
Showing 8 changed files with 510 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ doc:
cp src/lib.rs code.bak
cat README.md | sed -e 's/^/\/\/! /g' > readme.bak
sed -i '/\/\/ DOCS/r readme.bak' src/lib.rs
sed -i '/```rust/```ignore/r readme.bak' src/lib.rs
sed -i '/```toml/```ignore/r readme.bak' src/lib.rs
sed -i '/```sh/```ignore/r readme.bak' src/lib.rs
sed -e "s/\`rust/\`ignore/g" src/lib.rs
sed -e "s/\`toml/\`ignore/g" src/lib.rs
sed -e "s/\`sh/\`ignore/g" src/lib.rs
rm -rf docs/*
(cargo doc --no-deps && make clean) || (make clean && false)

Expand Down
157 changes: 155 additions & 2 deletions docs/clog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,161 @@ <h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>clog</a></spa
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-0' class='srclink' href='../src/clog/lib.rs.html#6-25' title='goto source code'>[src]</a></span></h1>
<h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
</span><a id='src-0' class='srclink' href='../src/clog/lib.rs.html#7-186' title='goto source code'>[src]</a></span></h1>
<div class='docblock'>
<h1 id="clog" class='section-header'><a
href="#clog">clog</a></h1>
<p><a href="https://gitter.im/thoughtram/clog?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/thoughtram/clog"></a></p>

<p><a href="https://travis-ci.org/thoughtram/clog"><img src="https://travis-ci.org/thoughtram/clog.png?branch=master" alt="Build Status"></a></p>

<p>A <a href="https://github.com/ajoslin/conventional-changelog/blob/a5505865ff3dd710cf757f50530e73ef0ca641da/conventions/angular.md">conventional</a> changelog for the rest of us</p>

<h3 id="about" class='section-header'><a
href="#about">About</a></h3>
<p><code>clog</code> creates a changelog automatically from your local git metadata. See the <code>clog</code>s <a href="https://github.com/thoughtram/clog/blob/master/changelog.md">changelog.md</a> for an example.</p>

<p>The way this works, is every time you make a commit, you ensure your commit subject line follows the <a href="https://github.com/thoughtram/clog/blob/master/changelog.md">conventional</a> format. Then when you wish to update your changelog, you simply run <code>clog</code> inside your local repository with any options you&#39;d like to specify.</p>

<p><em>NOTE:</em> <code>clog</code> also supports empty components by making commit messages such as <code>alias: message</code> or <code>alias(): message</code> (i.e. without the component)</p>

<h3 id="usage" class='section-header'><a
href="#usage">Usage</a></h3>
<p>There are two ways to use <code>clog</code>, via the command line or a library in your applicaitons.</p>

<h4 id="command-line" class='section-header'><a
href="#command-line">Command Line</a></h4>
<pre><code class="language-sh">USAGE:
clog [FLAGS] [OPTIONS]

FLAGS:
-c, --config The Clog Configuration TOML file to use (Defaults to &#39;.clog.toml&#39;)**
-F, --from-latest-tag use latest tag as start (instead of --from)
-h, --help Prints help information
-M, --major Increment major version by one (Sets minor and patch to 0)
-m, --minor Increment minor version by one (Sets patch to 0)
-p, --patch Increment patch version by one
-V, --version Prints version information

OPTIONS:
-f, --from &lt;from&gt; e.g. 12a8546
-g, --git-dir &lt;gitdir&gt; Local .git directory (defaults to current dir + &#39;.git&#39;)*
-o, --outfile &lt;outfile&gt; Where to write the changelog (Defaults to &#39;changelog.md&#39;)
-r, --repository &lt;repo&gt; Repo used for link generation (without the .git, e.g. https://github.com/thoughtram/clog)
-l, --link-style &lt;style&gt; The style of repository link to generate (Defaults to github) [values: Github, Gitlab, Stash]
-s, --subtitle &lt;subtitle&gt; e.g. &quot;Crazy Release Title&quot;
-t, --to &lt;to&gt; e.g. 8057684 (Defaults to HEAD when omitted)
--setversion &lt;ver&gt; e.g. 1.0.1
-w, --work-tree &lt;workdir&gt; Local working tree of the git project (defaults to current dir)*

* If your .git directory is a child of your project directory (most common, such as
/myproject/.git) AND not in the current working directory (i.e you need to use --work-tree or
--git-dir) you only need to specify either the --work-tree (i.e. /myproject) OR --git-dir (i.e.
/myproject/.git), you don&#39;t need to use both.

** If using the --config to specify a clog configuration TOML file NOT in the current working
directory (meaning you need to use --work-tree or --git-dir) AND the TOML file is inside your
project directory (i.e. /myproject/.clog.toml) you do not need to use --work-tree or --git-dir.
</code></pre>

<h5 id="try-it!" class='section-header'><a
href="#try-it!">Try it!</a></h5>
<ol>
<li><p>Clone the repo <code>git clone https://github.com/thoughtram/clog &amp;&amp; cd clog</code></p></li>
<li><p>Build clog <code>cargo build --release</code></p></li>
<li><p>Delete the old changelog file <code>rm changelog.md</code></p></li>
<li><p>Run clog <code>./target/release/clog -r https://github.com/thoughtram/clog --setversion 0.1.0 --subtitle crazy-dog --from 6d8183f</code></p></li>
</ol>

<h4 id="as-a-library" class='section-header'><a
href="#as-a-library">As a Library</a></h4>
<p>See the documentation for information on using <code>clog</code> in your applications.</p>

<h5 id="try-it!-1" class='section-header'><a
href="#try-it!-1">Try it!</a></h5>
<ol>
<li><p>Clone the <code>clog</code> repo so that you have something to search through (Because <code>clog</code> uses
specially formatted commit messages)
<code>$ git clone https://github.com/thoughtram/clog ~/clog</code></p></li>
<li><p>Add <code>clog</code> as a dependency in your <code>Cargo.toml</code> </p></li>
</ol>

<pre><code class="language-toml">[dependencies]
clog = &quot;*&quot;
</code></pre>

<ol>
<li>Use the following in your <code>src/main.rs</code></li>
</ol>
<pre id='rust-example-rendered' class='rust '>
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>clog</span>;

<span class='kw'>use</span> <span class='ident'>clog</span>::<span class='ident'>Clog</span>;

<span class='kw'>fn</span> <span class='ident'>main</span>() {
<span class='comment'>// Create the struct</span>
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>clog</span> <span class='op'>=</span> <span class='ident'>Clog</span>::<span class='ident'>with_dir</span>(<span class='string'>&quot;~/clog&quot;</span>).<span class='ident'>unwrap_or_else</span>(<span class='op'>|</span><span class='ident'>e</span><span class='op'>|</span> {
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>,<span class='ident'>e</span>);
<span class='ident'>std</span>::<span class='ident'>process</span>::<span class='ident'>exit</span>(<span class='number'>1</span>);
});

<span class='comment'>// Set some options</span>
<span class='ident'>clog</span>.<span class='ident'>repository</span>(<span class='string'>&quot;https://github.com/thoughtram/clog&quot;</span>)
.<span class='ident'>subtitle</span>(<span class='string'>&quot;Crazy Dog&quot;</span>)
.<span class='ident'>from</span>(<span class='string'>&quot;6d8183f&quot;</span>)
.<span class='ident'>version</span>(<span class='string'>&quot;0.1.0&quot;</span>);

<span class='comment'>// Write the changelog to the current working directory</span>
<span class='comment'>//</span>
<span class='comment'>// Alternatively we could have used .write_changelog_to(&quot;/somedir/some_file.md&quot;)</span>
<span class='ident'>clog</span>.<span class='ident'>write_changelog</span>();
}
</pre>

<ol>
<li>Compile and run `$ cargo build --release &amp;&amp; ./target/release/bin_name</li>
<li>View the output in your favorite markdown viewer! <code>$ vim changelog.md</code></li>
</ol>

<h3 id="default-options" class='section-header'><a
href="#default-options">Default Options</a></h3>
<p><code>clog</code> can also be configured using a default configuration file so that you don&#39;t have to specify all the options each time you want to update your changelog. To do this add a <code>.clog.toml</code> file to your repository.</p>

<pre><code class="language-toml">[clog]
repository = &quot;https://github.com/thoughtram/clog&quot;
subtitle = &quot;my awesome title&quot;

# specify the style of commit links to generate, defaults to &quot;github&quot; if omitted
link-style = &quot;github&quot;

# sets the changelog output file, defaults to &quot;changelog.md&quot; if omitted
outfile = &quot;MyChangelog.md&quot;

# If you use tags, you can set the following if you wish to only pick
# up changes since your latest tag
from-latest-tag = true
</code></pre>

<p>Now you can update your <code>MyChangelog.md</code> with <code>clog --patch</code> (assuming you want to update from the latest tag version, and increment your patch version by 1).</p>

<p><em>Note:</em> Any options you specify at the command line will override options set in your <code>.clog.toml</code></p>

<h4 id="custom-sections" class='section-header'><a
href="#custom-sections">Custom Sections</a></h4>
<p>By default, <code>clog</code> will display two sections in your changelog, <code>Features</code> and <code>Bug Fixes</code>. You can add additional sections by using a <code>.clog.toml</code> file. To add more sections, simply add a <code>[sections]</code> table, along with the section name and aliases you&#39;d like to use in your commit messages:</p>

<pre><code class="language-toml">[sections]
MySection = [&quot;mysec&quot;, &quot;ms&quot;]
</code></pre>

<p>Now if you make a commit message such as <code>mysec(Component): some message</code> or <code>ms(Component): some message</code> there will be a new &quot;MySection&quot; section along side the &quot;Features&quot; and &quot;Bug Fixes&quot; areas.</p>

<p><em>NOTE:</em> Sections with spaces are suppported, such as <code>&quot;My Special Section&quot; = [&quot;ms&quot;, &quot;mysec&quot;]</code></p>

<h2 id="license" class='section-header'><a
href="#license">LICENSE</a></h2>
<p>clog is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.</p>
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
<tr class=' module-item'>
<td><a class='mod' href='git/index.html'
Expand Down
2 changes: 1 addition & 1 deletion docs/implementors/core/clone/trait.Clone.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/implementors/core/fmt/trait.Debug.js

Large diffs are not rendered by default.

Loading

0 comments on commit 24b2dc5

Please sign in to comment.