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

docs: create generator template tutorial #978

Merged
merged 46 commits into from
Jul 24, 2023
Merged

docs: create generator template tutorial #978

merged 46 commits into from
Jul 24, 2023

Conversation

Florence-Njeri
Copy link
Collaborator

Description
Tutorial to create a user-defined template

Related issue(s)
Fixes #943

@Florence-Njeri
Copy link
Collaborator Author

@derberg @thulieblack I have put up a PR for the tutorial

@thulieblack
Copy link
Member

Awesome, thanks Florence

@derberg
Copy link
Member

derberg commented Jun 19, 2023

yo, is this ready for final review?

@derberg
Copy link
Member

derberg commented Jun 20, 2023

@pratik2315 can you have a look 🙏🏼 since it is based on my article I have a feeling better if you review first

@Florence-Njeri
Copy link
Collaborator Author

yo, is this ready for final review?

It is

@thulieblack
Copy link
Member

thulieblack commented Jun 26, 2023

Hey, @Florence-Njeri the PR looks great, I have additional things to add:

  1. while running the npm test there was an error that required rimraf package. I think we should add that to the tutorial as well.
  2. The Python loop is continual it doesn't stop running. so I suggest we add a counter to stop the while statement after certain intervals for instance
counter = 0
while counter < 10:
    randomId = randrange(min_value, max_value + 1)
    client.sendTemperatureDrop(randomId)
    print("Temperature drop detected " + str(randomId) + " sent to temperature/dropped")
    client.sendTemperatureRise(randomId)
    print("Temperature rise detected " + str(randomId) + " sent to temperature/risen")
    time.sleep(1)
    counter += 1

This loop stops after 10 intervals what do you think?

docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
docs/generator_template.md Outdated Show resolved Hide resolved
@derberg
Copy link
Member

derberg commented Jun 27, 2023

@Florence-Njeri I'll jump into review once you apply feedback from @thulieblack

2nd PR review

Co-authored-by: V Thulisile Sibanda <[email protected]>
Co-authored-by: Lukasz Gornicki <[email protected]>
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

@thulieblack

How about we simplify the title to Generator Template, since the first paragraph already explains that we are creating a simple generator template

you mean title of the doc? tutorials should have a title that says what it is about

Generator Template says it is about generator template
Creating a simple generator template says it is about creating a simple generator

We also should be consistent with other titles of the docs on the website.

@thulieblack
Copy link
Member

Mmmh I see, then I guess we can go with Creating a Generator Template

Copy link
Member

derberg commented Jul 13, 2023

sounds good to me, as also word simple is no good for titles

@Florence-Njeri ready for final round?

@Florence-Njeri
Copy link
Collaborator Author

yo @Florence-Njeri can you share the preview link here as well

Hey @thulieblack I was running it in localhost. How do I get a preview link 🤔

@Florence-Njeri
Copy link
Collaborator Author

sounds good to me, as also word simple is no good for titles

@Florence-Njeri ready for final round?

Yes it is

@derberg
Copy link
Member

derberg commented Jul 19, 2023

Hey @thulieblack I was running it in localhost. How do I get a preview link

there is no quick way unfortunately. The only one I know for now is that you use GitPod to get a virtual env for website:

  1. go here http://gitpod.io/#https://github.com/asyncapi/website
  2. manually put new markdown in a desired location
  3. stop server and run there again npm run dev
  4. in logs you see localhost link, click it, and it will get you to a separate website like https://3000-asyncapi-website-q3b1xuns0yu.ws-eu101.gitpod.io/docs/tools/generator/generator-template

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

just 2 small comments

and regarding navigation, maybe under Template your code section, all subsections should also have number, so in navigation it then makes more sense? something like:

Screenshot 2023-07-19 at 10 03 22

docs/generator_template.md Outdated Show resolved Hide resolved

## Where to go from here?

Great job completing this tutorial! You have learnt how to use an AsyncAPI file to create a Python MQTT template and used it with the Paho-MQTT library in Python to connect to an MQTT broker and publish messages.:]
Copy link
Member

Choose a reason for hiding this comment

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

:]

is this one intended? you can use real emoji if you want

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

LGTM

@thulieblack anything from your side?

Copy link
Member

@thulieblack thulieblack left a comment

Choose a reason for hiding this comment

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

Looks great from my side, well done @Florence-Njeri
BlondeHairCuteDanceGIF

@derberg
Copy link
Member

derberg commented Jul 19, 2023

We need @pratik2315 approval but he is completely unreachable, tried in the past slack - email - twitter

just sent invite to LinkedIn

if we will not respond I will:

  • merge as admin, ignoring his lack of approval
  • and we need to remove him as a maintainer

@sonarcloud
Copy link

sonarcloud bot commented Jul 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@derberg derberg merged commit e7343e9 into asyncapi:master Jul 24, 2023
14 checks passed
@derberg
Copy link
Member

derberg commented Jul 24, 2023

@Florence-Njeri congrats for the amazing work 👏🏼 https://www.asyncapi.com/docs/tools/generator/generator_template (we are just a bit inconsistent as filename is generator_template and all other have -) and now when I'm thinking, since it is generator docs, the document title could probably be just Creating a template 😄
@thulieblack thanks a lot for help with review, I guess you can share with @Florence-Njeri how to get the bounty

when you feel in the mood, please start an issue in website repo to discuss if there is a need for content buckets for tools long term, as we have this use case where we have lots of docs, but as flat list:

  • we have no way to visualize that something is a tutorial
  • but we have a use case that it is very tool specific/oriented tutorial and it cannot be in the main "tutorials" bucket

@thulieblack
Copy link
Member

Congratulations @Florence-Njeri, on successfully finishing the task🎉🎉. Please submit an expense on open collective to claim your bounty

@Florence-Njeri
Copy link
Collaborator Author

@Florence-Njeri congrats for the amazing work 👏🏼 https://www.asyncapi.com/docs/tools/generator/generator_template (we are just a bit inconsistent as filename is generator_template and all other have -) and now when I'm thinking, since it is generator docs, the document title could probably be just Creating a template 😄 @thulieblack thanks a lot for help with review, I guess you can share with @Florence-Njeri how to get the bounty

when you feel in the mood, please start an issue in website repo to discuss if there is a need for content buckets for tools long term, as we have this use case where we have lots of docs, but as flat list:

  • we have no way to visualize that something is a tutorial
  • but we have a use case that it is very tool specific/oriented tutorial and it cannot be in the main "tutorials" bucket

I'll create an issue and put up a follow up PR for this

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.10.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

@asyncapi-bot asyncapi-bot added the bounty AsyncAPI Bounty program related label label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty AsyncAPI Bounty program related label released
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Add tutorial that explains step by step how to create a simple Generator Template
4 participants