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: display correlationId to the rendered html #135

Merged
merged 1 commit into from
Feb 1, 2021
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ npm install -g @asyncapi/generator

1. Adjust styling and generate `tailwind.min.css` with `npm run generate:assets`
1. Generate output with watcher enabled: `npm run develop`.

>**NOTE:** If your changes are not visible, this is maybe because the `ag` use the already installed `html-template` so you should use the `--install` option
> * run `npm run develop:install`
> * if command failed, delete the cached `html-template` module in your system and re-rerun the command

1. Open HTML in your browser: `open ./test/output/index.html`.

## Contributors ✨
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"lint": "echo \"No linter specified yet\"",
"test": "ava",
"release": "semantic-release",
"develop": "ag https://raw.githubusercontent.com/asyncapi/generator/v1.0.0/test/docs/dummy.yml ./ -o test/output --force-write --watch-template",
"develop": "ag https://raw.githubusercontent.com/asyncapi/generator/v1.1.5/test/docs/dummy.yml ./ -o test/output --force-write --watch-template",
"//develop:install": "Force ag to install your local html-template source code",
derberg marked this conversation as resolved.
Show resolved Hide resolved
"develop:install": " npm run develop -- --install",
"generate:assets": "cross-env NODE_ENV=production postcss template/css/main.css -o template/css/tailwind.min.css",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"
},
Expand Down
12 changes: 12 additions & 0 deletions partials/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@

{{ tags(msg.tags()) }}

{% set correlationId = msg.correlationId() %}
{% if correlationId %}
<div class="border border-gray-400 bg-gray-200 rounded p-4 mt-2">
<div class="text-sm text-gray-700 mb-2">Correlation ID<span class="border text-orange-600 rounded text-xs ml-3 py-0 px-2">{{correlationId.location()}}</span>

</div>
{% if correlationId.hasDescription() %}
<div class="text-gray-600 text-sm">{{correlationId.description() | markdown2html | safe }}</div>
{% endif %}
</div>
{% endif %}

<div class="mt-4 mb-4 markdown">{{ msg.description() | markdown2html | safe }}</div>
{% if msg.payload() %}
{{ schema(msg.payload(), 'Payload', open=open) }}
Expand Down