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: code-examples #1349

Closed
wants to merge 30 commits into from
Closed

docs: code-examples #1349

wants to merge 30 commits into from

Conversation

sambhavgupta0705
Copy link
Member

Description

This PR adds documentation for how to add code examples.

Related issue(s)

Resolves #1245

@netlify
Copy link

netlify bot commented Feb 16, 2023

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b4e2c83
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/64949a77993741000862e48b
😎 Deploy Preview https://deploy-preview-1349--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sambhavgupta0705
Copy link
Member Author

PTAL @alequetzalli

@sambhavgupta0705 sambhavgupta0705 changed the title Docs docs :code-examples Feb 16, 2023
@sambhavgupta0705 sambhavgupta0705 changed the title docs :code-examples docs: code-examples Feb 16, 2023

Code examples which you add must be simple enough to understand and with good details to do something interesting and useful.

You need to add pratical code examples which adheres to industry standards as users will copy the sample code and run it in production.Be sure to include any warnings thriugh comments which might occur during code run.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You need to add pratical code examples which adheres to industry standards as users will copy the sample code and run it in production.Be sure to include any warnings thriugh comments which might occur during code run.
You need to add practical code examples which adhere to industry standards as users will copy the sample code and run it in production. Be sure to include any warnings through comments which might occur during the code run.

Copy link
Contributor

Choose a reason for hiding this comment

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

please run a complete Grammarly check here, there are spelling mistakes too

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

pages/docs/community/styleguide/code-examples.md Outdated Show resolved Hide resolved

Put the characters for the open-brace ("") on the same line as the sentence that opens the block.

In all code samples, the indentation should be two spaces per tab.]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In all code samples, the indentation should be two spaces per tab.]
In all code samples, the indentation should be two spaces per tab.

After adding comments ,start writing code from the next line.
## General

Make no assumptions about the readers' familiarity with any libraries, frameworks, preprocessors, or other non-native features.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Make no assumptions about the readers' familiarity with any libraries, frameworks, preprocessors, or other non-native features.
Make no assumptions about the reader's familiarity with any libraries, frameworks, preprocessors, or other non-native features.

Write your code to be as clean and understandable as possible

Add links of the library or documentation for better understanding.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Add proper spacing between code blocks

After adding comments ,start writing code from the next line.
## General
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## General
### General

be consistent with the headings. # for main, ## & ### for subheadings and should be mainly used.

Code examples which you add must be simple enough to understand and with good details to do something interesting and useful.

You need to add pratical code examples which adheres to industry standards as users will copy the sample code and run it in production.Be sure to include any warnings thriugh comments which might occur during code run.
Make it clear if it is a snippet and not a full example.Provide information about any packages or dependencies which would be required to run the sample code.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Make it clear if it is a snippet and not a full example.Provide information about any packages or dependencies which would be required to run the sample code.
Make it clear if it is a snippet and not a complete example. Provide information about any packages or dependencies required to run the sample code.

sambhavgupta0705 and others added 4 commits February 21, 2023 18:33
Co-authored-by: Karuna Tata <74637789+starlightknown@users.noreply.github.com>
Co-authored-by: Karuna Tata <74637789+starlightknown@users.noreply.github.com>
Co-authored-by: Karuna Tata <74637789+starlightknown@users.noreply.github.com>
Co-authored-by: Karuna Tata <74637789+starlightknown@users.noreply.github.com>
@sambhavgupta0705
Copy link
Member Author

@starlightknown can you please tell the correct file location where I need to place this.

sambhavgupta0705 and others added 2 commits February 21, 2023 19:53
Co-authored-by: Karuna Tata <74637789+starlightknown@users.noreply.github.com>
Co-authored-by: Karuna Tata <74637789+starlightknown@users.noreply.github.com>
@starlightknown
Copy link
Contributor

@starlightknown can you please tell the correct file location where I need to place this.

I'm not sure either as each contributor placed these files in different places, Alejandra might be able to help. I slacked but might be OOO. We should wait

@sambhavgupta0705
Copy link
Member Author

@starlightknown can you please tell the correct file location where I need to place this.

I'm not sure either as each contributor placed these files in different places, Alejandra might be able to help. I slacked but might be OOO. We should wait

Okay ,and can you tell me how to resolve this lighthouse error

@starlightknown
Copy link
Contributor

could you try changing the path? pages/community/styleguide/accessibility.md
I think this should fix the error

@github-actions
Copy link

github-actions bot commented Feb 23, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 43
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-1349--asyncapi-website.netlify.app/

@sambhavgupta0705 sambhavgupta0705 requested review from starlightknown and removed request for starlightknown February 23, 2023 13:48
@sambhavgupta0705
Copy link
Member Author

sambhavgupta0705 commented Feb 23, 2023

Hey @starlightknown made all the changes.Let me know if there are any more things to improve here.

@sambhavgupta0705
Copy link
Member Author

@alequetzalli PTAL :)

sambhavgupta0705 and others added 10 commits March 14, 2023 19:18
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
Co-authored-by: Alejandra Quetzalli  <alejandra.olvera.novack@gmail.com>
@quetzalliwrites quetzalliwrites added 📑 docs area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. labels Jun 7, 2023
---
title: Code examples
weight: 20
---
Copy link
Member

Choose a reason for hiding this comment

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

Please add a description to the meta data section. ✌🏽

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the description 👍🏻

Comment on lines 5 to 6


Copy link
Member

Choose a reason for hiding this comment

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

Please remove the extra spaces of lines 5-6, we don't want huge empty spots in our docs' formatting/spacing 😂✌🏽

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@quetzalliwrites
Copy link
Member

pingy pongo @sambhavgupta0705 😄

You still have some feedback left to address, please look carefully again ✨

@sambhavgupta0705 sambhavgupta0705 closed this by deleting the head repository Nov 7, 2023
@quetzalliwrites
Copy link
Member

Why did you close this PR @sambhavgupta0705? 😸

@sambhavgupta0705
Copy link
Member Author

Lol,deleted that fork because of merge conflicts.
Can't reopen it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. 📑 docs
Projects
Status: Community PR under Review 🧐
Development

Successfully merging this pull request may close these issues.

docs: new style guide - Code examples
3 participants