diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-01-12 18:37:49 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-01-31 14:31:07 +0100 |
commit | be9c3799aad4c5712f85948e0e4c29321bdcb9a4 (patch) | |
tree | 4e9d78f0e50d6c1af0ff478d08ba47d0d53c6f1e /doc-tool/resources | |
parent | 3e16bfd9c32d965820121abc0083e8db94537821 (diff) | |
download | dotty-be9c3799aad4c5712f85948e0e4c29321bdcb9a4.tar.gz dotty-be9c3799aad4c5712f85948e0e4c29321bdcb9a4.tar.bz2 dotty-be9c3799aad4c5712f85948e0e4c29321bdcb9a4.zip |
Add basic API generation from templates
Diffstat (limited to 'doc-tool/resources')
-rw-r--r-- | doc-tool/resources/_layouts/api-page.html | 70 | ||||
-rw-r--r-- | doc-tool/resources/_layouts/doc.html | 6 | ||||
-rw-r--r-- | doc-tool/resources/css/api-page.css | 61 | ||||
-rw-r--r-- | doc-tool/resources/css/dottydoc.css | 6 |
4 files changed, 138 insertions, 5 deletions
diff --git a/doc-tool/resources/_layouts/api-page.html b/doc-tool/resources/_layouts/api-page.html new file mode 100644 index 000000000..41daf6c47 --- /dev/null +++ b/doc-tool/resources/_layouts/api-page.html @@ -0,0 +1,70 @@ +--- +layout: doc +extraCSS: + - css/api-page.css +--- + +<div id="entity-container"> + <div id="entity-title"> + <span id="entity-modifiers"> + {{ entity.modifiers | join: " " }} + </span> + <span id="entity-kind"> + {{ entity.kind }} + </span> + <span id="entity-name"> + {{ entity.name }} + </span> + </div> + + {% if entity.comment.body %} + <div id="entity-body" class="entity-section"> + {{ entity.comment.body }} + </div> + {% endif %} + + <h1 class="section">Members</h1> + + <div id="entity-members" class="entity-section"> + {% for member in entity.members %} + <div class="member"> + <div class="member-title"> + <span class="member-modifiers"> + {{ member.modifiers | join: " " }} + </span> + <span class="member-kind"> + {{ member.kind }} + </span> + <span class="member-name"> + {{ member.name }} + </span> + + {% if member.kind == "def" and member.paramLists.size > 0 %} + {% for plist in member.paramLists %} + <span class="no-left">(</span> + {% if plist.isImplicit %} + <span class="no-left keyword">implicit</span> + {% endif %} + {% for ref in plist.list %} + {% if forloop.last %} + <span class="no-left">{{ ref.title }}</span> + {% else %} + <span class="no-left">{{ ref.title }}, </span> + {% endif %} + {% endfor %} + <span class="no-left">)</span> + {% endfor %} + {% endif %} + + {% if member.returnValue %} + <span class="no-left">: {{ member.returnValue.title }}</span> + {% endif %} + </div><!-- end member-title --> + + <div class="member-body"> + {{ member.comment.short }} + </div> + </div><!-- end member --> + {% endfor %} + </div> +</div><!-- end entity-container --> diff --git a/doc-tool/resources/_layouts/doc.html b/doc-tool/resources/_layouts/doc.html index 78fc2b116..4fd615d23 100644 --- a/doc-tool/resources/_layouts/doc.html +++ b/doc-tool/resources/_layouts/doc.html @@ -8,17 +8,17 @@ layout: main <ul class="index-entities"> {% if docs.size > 0 %} <li class="index-title"> - <a href="{{ site.baseurl }}/api/index.html">API</a> + <span>API</span> </li> {% endif %} {% for pkg in docs %} <li class="index-entity entity-package"> - <a href="#">{{ pkg.name }}</a> + <a href="{{ site.baseurl }}/api/{{ pkg.path | join: "/" }}/index.html">{{ pkg.name }}</a> </li> {% for member in pkg.members %} {% if member.kind != "package" %} <li class="index-entity"> - <a href="#">{{ member.kind }} {{ member.name }}</a> + <a href="{{ site.baseurl }}/api/{{ member.path | join: "/" }}.html">{{ member.kind }} {{ member.name }}</a> </li> {% endif %} {% endfor %} diff --git a/doc-tool/resources/css/api-page.css b/doc-tool/resources/css/api-page.css new file mode 100644 index 000000000..47f88ed6c --- /dev/null +++ b/doc-tool/resources/css/api-page.css @@ -0,0 +1,61 @@ +/** Fonts */ +@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700,600); + +div#entity-container { + margin-top: 10px; + padding: 0 20px 20px; +} + +div#entity-title { + color: #34495e; + font-family: "Helvetica","Arial",sans-serif; + font-weight: 400; + margin-bottom: 30px; + font-size: 2.5rem; +} + +div#entity-title > span#entity-modifiers, +div#entity-title > span#entity-kind { + font-weight: 100; +} + +div.entity-section { + background-color: #fff; + border-radius: 4px; + margin: 0; + padding: 30px; +} + +div.entity-section *:last-child { + margin-bottom: 0px; +} + +h1.section { + margin: 30px 0; +} + +div#entity-members > div.member { + margin-bottom: 30px; +} + +div#entity-members > div.member:last-child { + margin-bottom: 0px; +} + +div#entity-members > div.member > div.member-title { + font-family: "Source Code Pro", sans-serif; +} + +div#entity-members > div.member > div.member-title > span.member-name { + color: #458; + font-weight: 600; +} + +div#entity-members > div.member > div.member-title span.keyword { + font-weight: 600; + margin-right: 11px; +} + +div#entity-members > div.member > div.member-title span.no-left { + margin-left: -11px; +} diff --git a/doc-tool/resources/css/dottydoc.css b/doc-tool/resources/css/dottydoc.css index a40ee6a4d..754d3b3f7 100644 --- a/doc-tool/resources/css/dottydoc.css +++ b/doc-tool/resources/css/dottydoc.css @@ -59,6 +59,7 @@ ul.toc { ul.toc > li.toc-title > a { font-size: 16px; font-weight: bold; + margin-top: 1rem; } ul.toc > li > a#home-button, @@ -101,10 +102,11 @@ ul.toc > li > ul.hide { display: none; } -ul.index-entities > li.index-title > a { +ul.index-entities > li.index-title > span { font-size: 16px; font-weight: bold; - color: rgba(0,0,0,.87) + color: rgba(0,0,0,.87); + padding: 0 24px; } li.index-entity > a:focus { |