DEV Community

Cover image for GitHub Project Setup: Markdown Tips
Márcio Corrêa
Márcio Corrêa

Posted on

1 1 1

GitHub Project Setup: Markdown Tips

Setting up a GitHub project with well-structured Markdown files can greatly improve collaboration and project clarity. Here are some essential tips for creating and organizing Markdown files in your repository, including how to use Mermaid for diagrams:

Pull Request (PR) Templates

Using PR templates ensures contributors provide consistent and sufficient information for code reviews.

How to Create a PR Template:

  • Create a folder called .github.
  • Inside it, create another folder named PULL_REQUEST_TEMPLATE.
  • Add a template file, e.g., pull_request_template.md.

Example PR Template:

### Description
Describe the purpose of this PR. What does it fix or improve?

### Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Code improvement
- [ ] Documentation
- [ ] Other (please specify)

### Checklist
- [ ] My code follows the project's style guidelines.
- [ ] I tested my changes locally.
- [ ] I added tests to cover my changes.
- [ ] Documentation has been updated, if necessary.

### Related Issues
Resolves # (insert the related issue number, if applicable)

### Screenshots (if applicable)
Add screenshots to illustrate visual changes, if any.

### Additional Notes
Add any additional information relevant to the review.
Enter fullscreen mode Exit fullscreen mode

Issue Templates

Issue templates standardize how tasks and bugs are reported, making it easier to track and resolve them.

How to Create an Issue Template:

  • Inside the .github folder, create a folder named ISSUE_TEMPLATE.
  • Add template files for different types of issues, such as bug_report.md and feature_request.md.

Example Bug Report Template:

### Bug Description
Describe the bug clearly and concisely.

### Steps to Reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See the error

### Expected Behavior
Describe what you expected to happen.

### Actual Behavior
Describe what actually happened.

### Screenshots
Add screenshots to help explain the issue.

### Additional Information
- Operating System:
- Browser (if applicable):
- Software Version:
Enter fullscreen mode Exit fullscreen mode

README and Documentation

A good README.md is essential for explaining your project, how to set it up, and how to contribute.
Suggested README Structure:

# Project Name

## Description
A brief description of the project.

## Setup
Steps to set up the project locally.

## Contributing
Instructions for contributing to the project.

## License
Information about the project's license.
Enter fullscreen mode Exit fullscreen mode

Contributing Guidelines

Create a CONTRIBUTING.md file to guide new contributors.

Example:

# How to Contribute

1. Fork the repository.
2. Create a branch for your feature (`git checkout -b feature/new-feature`).
3. Commit your changes (`git commit -m 'Add new feature'`).
4. Push your branch (`git push origin feature/new-feature`).
5. Open a Pull Request.
Enter fullscreen mode Exit fullscreen mode

Mermaid for Diagrams

GitHub supports Mermaid, a powerful tool for creating diagrams directly in Markdown files. This is especially useful for documenting workflows, architectures, or processes.

How to Use Mermaid:

Wrap your Mermaid code in a code block with the mermaid language specifier.
Basic Flowchart Example:

'''mermaid
graph TD;
    A[Start] --> B{Decision?};
    B -->|Yes| C[Do something];
    B -->|No| D[Do something else];
    C --> E[End];
    D --> E;
'''
Enter fullscreen mode Exit fullscreen mode

ps.: I needed to replace the character (`) for (') because of the dev.to code block.

By following these tips, you can ensure your GitHub project is well-documented, easy to navigate, and visually engaging with Mermaid diagrams. If you have any questions or need further examples, feel free to ask! 😊

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay