<commit_before>{{ PkgFullIntro | safe }}

{# START: Index #}
{% if IsHasExports %}
<h2 class="ui header" id="_index">
	Index
</h2>
<ul class="unstyled">
	{% if IsHasConst %}
	<li>
		<a href="#_constants">Constants</a>
	</li>
	{% endif %}

	{% if IsHasVar %}
	<li>
		<a href="#_variables">Variables</a>
	</li>
	{% endif %}

	{% for fn in Funcs %}
	<li>
		<a href="#{{fn.Name}}">{{fn.Decl}}</a>
	</li>
	{% endfor %}

	{% for tp in Types %}
	<li>
		<a href="#{{tp.Name}}">type {{tp.Name}}</a>
	</li>
	<ul>
		{% for fn in tp.Funcs %}
		<li>
			<a href="#{{fn.Name}}">{{fn.Decl}}</a>
		</li>
		{% endfor %}

		{% for fn in tp.Methods %}
		<li>
			<a href="#{{tp.Name}}_{{fn.Name}}">{{fn.Decl}}</a>
		</li>
		{% endfor %}
	</ul>
	{% endfor %}
</ul>
{% endif %}

{% macro example_detail(ex) %}
<div class="ui collapse example">
	<div>
		<h3>
			<a class="show example" id="_ex_btn_{{ex.Name}}" href="#_ex_{{ex.Name}}">Example({{ex.Name}})</a>
		</h3>
	</div>
	<div id="_ex_{{ex.Name}}">
		<p>Code:</p>
		<pre>{{ex.Code | safe}}</pre>
		{% if ex.Output %}
		<p>Output:</p>
		<pre>{{ex.Output}}</pre>
		{% endif %}
	</div>
</div>
{% endmacro %}

{% if IsHasExample %}
<h2 class="ui header" id="_exams">Examples</h2>
<ul class="unstyled">
	{% for ex in Examples %}
		{% if ex.IsUsed %}
		<li>
			<a class="ex-link" href="#_ex_btn_{{ex.Name}}" data-name="#_ex_{{ex.Name}}">{{ex.Name}}</a>
		</li>
		{% else %}
			{{example_detail(ex)}}
		{% endif %}
	{% endfor %}
</ul>
{% endif %}
<b></b>
{# END: Index #}

{# START: Constants #}
{% if IsHasConst %}
<h2 class="ui header" id="_constants">Constants</h2>
	{% for c in Consts %}
		<pre>{{c.FmtDecl | safe}}</pre>
		{{c.Doc | safe}}
	{% endfor %}
{% endif %}
{# END: Constants #}

{# START: Variables #}
{% if IsHasVar %}
<h2 class="ui header" id="_variables">Variables</h2>
	{% for v in Vars %}
		<pre>{{v.FmtDecl | safe}}</pre>
		{{v.Doc | safe}}
	{% endfor %}
{% endif %}
<b></b>
{# END: Variables #}

{% macro sg_link(name) %}
	{% if HasPrefix(ProjectPath, "github.com") == True %}
	<a class="ui button sg" target="_blank" href="https://sourcegraph.com/{{ProjectPath}}/.GoPackage/{% if IsGoRepo %}{{ImportPath}}{% else %}{{ProjectPath}}{% endif %}/.def/{{name}}">
  	<i class="icon asterisk"></i>
	</a>
	{% endif %}
{% endmacro %}

{# START: Functions #}
{% for fn in Funcs %}<commit_msg>Fix sourcegraph.com Go symbol URLs<commit_after>{{ PkgFullIntro | safe }}

{# START: Index #}
{% if IsHasExports %}
<h2 class="ui header" id="_index">
	Index
</h2>
<ul class="unstyled">
	{% if IsHasConst %}
	<li>
		<a href="#_constants">Constants</a>
	</li>
	{% endif %}

	{% if IsHasVar %}
	<li>
		<a href="#_variables">Variables</a>
	</li>
	{% endif %}

	{% for fn in Funcs %}
	<li>
		<a href="#{{fn.Name}}">{{fn.Decl}}</a>
	</li>
	{% endfor %}

	{% for tp in Types %}
	<li>
		<a href="#{{tp.Name}}">type {{tp.Name}}</a>
	</li>
	<ul>
		{% for fn in tp.Funcs %}
		<li>
			<a href="#{{fn.Name}}">{{fn.Decl}}</a>
		</li>
		{% endfor %}

		{% for fn in tp.Methods %}
		<li>
			<a href="#{{tp.Name}}_{{fn.Name}}">{{fn.Decl}}</a>
		</li>
		{% endfor %}
	</ul>
	{% endfor %}
</ul>
{% endif %}

{% macro example_detail(ex) %}
<div class="ui collapse example">
	<div>
		<h3>
			<a class="show example" id="_ex_btn_{{ex.Name}}" href="#_ex_{{ex.Name}}">Example({{ex.Name}})</a>
		</h3>
	</div>
	<div id="_ex_{{ex.Name}}">
		<p>Code:</p>
		<pre>{{ex.Code | safe}}</pre>
		{% if ex.Output %}
		<p>Output:</p>
		<pre>{{ex.Output}}</pre>
		{% endif %}
	</div>
</div>
{% endmacro %}

{% if IsHasExample %}
<h2 class="ui header" id="_exams">Examples</h2>
<ul class="unstyled">
	{% for ex in Examples %}
		{% if ex.IsUsed %}
		<li>
			<a class="ex-link" href="#_ex_btn_{{ex.Name}}" data-name="#_ex_{{ex.Name}}">{{ex.Name}}</a>
		</li>
		{% else %}
			{{example_detail(ex)}}
		{% endif %}
	{% endfor %}
</ul>
{% endif %}
<b></b>
{# END: Index #}

{# START: Constants #}
{% if IsHasConst %}
<h2 class="ui header" id="_constants">Constants</h2>
	{% for c in Consts %}
		<pre>{{c.FmtDecl | safe}}</pre>
		{{c.Doc | safe}}
	{% endfor %}
{% endif %}
{# END: Constants #}

{# START: Variables #}
{% if IsHasVar %}
<h2 class="ui header" id="_variables">Variables</h2>
	{% for v in Vars %}
		<pre>{{v.FmtDecl | safe}}</pre>
		{{v.Doc | safe}}
	{% endfor %}
{% endif %}
<b></b>
{# END: Variables #}

{% macro sg_link(name) %}
	{% if HasPrefix(ProjectPath, "github.com") == True %}
	<a class="ui button sg" target="_blank" href="https://sourcegraph.com/go/{{ProjectPath}}/-/{{name}}">
  	<i class="icon asterisk"></i>
	</a>
	{% endif %}
{% endmacro %}

{# START: Functions #}
{% for fn in Funcs %}
{'fraction_non_alphanumeric': 0.27816441931274466, 'fraction_numerical': 0.004349717268377556, 'mean_word_length': 3.697650663942799, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 147, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1272667', 'n_tokens_mistral': 2233, 'n_tokens_neox': 1921, 'n_words': 395}