Skip to content

Commit

Permalink
feat: display correlationId to the rendered html
Browse files Browse the repository at this point in the history
Close #108
  • Loading branch information
Ludovic Dussart committed Feb 1, 2021
1 parent cd1ba1b commit 26b5021
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ npm install -g @asyncapi/generator
>**NOTE:** If you have to modify the [`dummy.yml`](https://github.com/asyncapi/generator/blob/master/test/docs/dummy.yml) file to develop your features, open a PR with the changes in the [asyncapi/generator](https://github.com/asyncapi/generator) repository.
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-rc.12/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",
"develop:install": " npm run develop -- --install",
"generate:assets": "echo 'No additional assets need to be generated at the moment'",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"
},
Expand Down
14 changes: 13 additions & 1 deletion partials/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
{% endif %}
</div>
<p class="text-grey-dark text-sm">{{msg.summary()}}</p>

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

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

</div>
{% if correlationId.hasDescription() %}
<div class="text-grey-dark 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

0 comments on commit 26b5021

Please sign in to comment.