Implement source linker and add URL to source code in generated docs.

Long overdue.
This commit is contained in:
KtorZ
2024-08-22 16:37:48 +02:00
parent 44e42d608d
commit b479a289cf
7 changed files with 140 additions and 27 deletions

View File

@@ -56,11 +56,7 @@
</a>
</h2>
{% if !type_info.source_url.is_empty() %}
<!-- TODO: support source linking
<a class="member-source" alt="View Source" title="View Source" href="{{ type_info.source_url|safe }}">
&lt;/&gt;
</a>
-->
<a class="member-source" alt="view source" title="view source" target="_blank" href="{{ type_info.source_url|safe }}"></a>
{% endif %}
</div>
<div class="custom-type-constructors">
@@ -106,11 +102,7 @@
<div class="member-name">
<h2 id="{{ constant.name }}"><pre class="hljs language-aiken">{{ constant.definition }}</pre></h2>
{% if !constant.source_url.is_empty() %}
<!-- TODO: support source linking
<a class="member-source" alt="View Source" title="View Source" href="{{ constant.source_url|safe }}">
&lt;/&gt;
</a>
-->
<a class="member-source" alt="view source" title="view source" target="_blank" href="{{ constant.source_url|safe }}"></a>
{% endif %}
</div>
<div class="rendered-markdown">{{ constant.documentation|safe }}</div>
@@ -131,11 +123,7 @@
<div class="member-name">
<h2 id="{{ function.name }}"><pre class="hljs language-aiken">{{ function.signature }}</pre></h2>
{% if !function.source_url.is_empty() %}
<!-- TODO: support source linking
<a class="member-source" alt="View Source" title="View Source" href="{{ function.source_url|safe }}">
&lt;/&gt;
</a>
-->
<a class="member-source" alt="view source" title="view source" target="_blank" href="{{ function.source_url|safe }}"></a>
{% endif %}
</div>
<div class="rendered-markdown">{{ function.documentation|safe }}</div>