mirror of
https://github.com/readthedocs/sphinx-autoapi
synced 2024-11-19 15:25:31 +00:00
Merge remote-tracking branch 'rtfd/go-templates' into go-parsed-example
This commit is contained in:
commit
1547210f49
11
autoapi/templates/go/base_member.rst
Normal file
11
autoapi/templates/go/base_member.rst
Normal file
@ -0,0 +1,11 @@
|
||||
.. go:{{ obj.ref_type }}:: {{ obj.name }}
|
||||
|
||||
{%- for param in obj.parameters %}
|
||||
:param {{ param.name }}: {{ param.desc }}
|
||||
{%- if param.type %}
|
||||
:type {{ param.name }}: {{ param.type }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- if obj.returns %}
|
||||
:rtype: {{ obj.returns.id }}
|
||||
{%- endif %}
|
1
autoapi/templates/go/const.rst
Normal file
1
autoapi/templates/go/const.rst
Normal file
@ -0,0 +1 @@
|
||||
{% extends "go/base_member.rst" %}
|
1
autoapi/templates/go/function.rst
Normal file
1
autoapi/templates/go/function.rst
Normal file
@ -0,0 +1 @@
|
||||
{% extends "go/base_member.rst" %}
|
1
autoapi/templates/go/method.rst
Normal file
1
autoapi/templates/go/method.rst
Normal file
@ -0,0 +1 @@
|
||||
{% extends "go/base_member.rst" %}
|
25
autoapi/templates/go/package.rst
Normal file
25
autoapi/templates/go/package.rst
Normal file
@ -0,0 +1,25 @@
|
||||
.. go:package:: {{ obj.name }}
|
||||
|
||||
{% block toc %}
|
||||
{%- if obj.children %}
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
{% for item in obj.children|sort %}
|
||||
/autoapi/{{ item.id.split('.')|join('/') }}/index
|
||||
{%- endfor %}
|
||||
|
||||
{%- endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% if obj.docstring %}
|
||||
{{ obj.docstring }}
|
||||
{% endif %}
|
||||
|
||||
{% block content %}
|
||||
{%- for obj_item in obj.item_map.get(item_type, []) %}
|
||||
{% macro render() %}{{ obj_item.render() }}{% endmacro %}
|
||||
{{ render()|indent(4) }}
|
||||
{%- endfor %}
|
||||
{% endblock %}
|
1
autoapi/templates/go/type.rst
Normal file
1
autoapi/templates/go/type.rst
Normal file
@ -0,0 +1 @@
|
||||
{% extends "go/base_member.rst" %}
|
1
autoapi/templates/go/var.rst
Normal file
1
autoapi/templates/go/var.rst
Normal file
@ -0,0 +1 @@
|
||||
{% extends "go/base_member.rst" %}
|
Loading…
Reference in New Issue
Block a user