Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: list all messages in sidebar #31

Merged
merged 3 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions partials/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
{% if asyncapi.hasChannels() %}
{% include "./operations.html" %}
{% endif %}
{% include "./messages.html" %}
Copy link
Contributor Author

@WaleedAshraf WaleedAshraf Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have .hasMessages() check here. But it doesn't exist yet.
We can add that in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create an issue in parser to add it so we don't forget

15 changes: 15 additions & 0 deletions partials/messages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% from "./message.html" import message %}

<a name="messages"></a>
<h2 class="ml-8 mt-4">Messages</h2>

<div class="responsive-container">
<div class="center-block p-8">
<div class="pb-8">
{% for key, value in asyncapi.allMessages() %}
<a name="message-{{key}}"></a>
{{ message(value, showIndex=true, index=loop.index, open=false) }}
{% endfor %}
</div>
</div>
</div>
11 changes: 11 additions & 0 deletions partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ <h2 class="text-xs uppercase text-grey mt-10 mb-4 font-thin">Operations</h2>
{% endfor %}
</ul>
{% endif %}
<h2 class="text-xs uppercase text-grey mt-10 mb-4 font-thin">Messages</h2>
<ul class="text-sm list-reset mt-2">
{% for key, value in asyncapi.allMessages() %}
<a class="js-menu-item flex break-words no-underline text-grey-darkest mt-8 sm:mt-8 md:mt-3"
href="#message-{{ key }}">
<div style="display:inline-block;">
{{ slicedString(key, 'padding-top: 2px;') }}
</div>
</a>
{% endfor %}
</ul>
{% endif %}
</div>
</div>