Coder Social home page Coder Social logo

dot-github's Introduction

.github Directory Generator

Linux and OS X Windows Coverage
Travis Badge Appveyor Badge Coverage Badge

GitHub now supports issue and pull request template. This repository provides dot-github command to generate the template files automatically for your GitHub repositories. This also enables to manage template files in dotfiles for all of your machines.

screenshot

Getting Started

1. Installation

go get command

$ go get github.com/rhysd/dot-github

or released binaries

cd /path/to/Downloads  # Download binary for your platform
chmod +x dot-github_your_platform
mv dot-github_your_platform /usr/local/bin/dot-github

2. Write Your Template Files

$ mkdir -p ~/.github && cd ~/.github
$ $EDITOR ISSUE_AND_PULL_REQUEST_TEMPLATE.md
$ $EDITOR CONTRIBUTING.md

Please read below instruction detail about template file

Note: You can change the home directory for dot-github by $DOT_GITHUB_HOME environment variable.

3. Generate .github

$ cd your-repo
$ dot-github
$ git add .github

4. Tweak Generated Files

Tweak generated files in your-repo/.github/* for your project-specific information.

Writing Template File

You can see example directory in this repository for real world examples.

dot-github looks below template files

File Path Description
$DOT_GITHUB_HOME/.github/ISSUE_TEMPLATE.md Template for issues.
$DOT_GITHUB_HOME/.github/PULL_REQUEST_TEMPLATE.md Template for pull requests.
$DOT_GITHUB_HOME/.github/ISSUE_AND_PULL_REQUEST_TEMPLATE.md If above files are not found, this file is used for template of issues and pull requests.
$DOT_GITHUB_HOME/.github/CONTRIBUTING.md Template for contributing guideline.

Note that $DOT_GITHUB_HOME is an environment variable. You can specify your favorite directory to put template files. Default directory for it is ~.

Above template files are parsed as Golang's standard text template. Below variables are available in template. They are useful to write flexible and common template files for each repositories.

Variable Name Type Description
.IsIssue boolean True when used for issue template.
.IsPullRequest boolean True when used for pull request template.
.IsContributing boolean True when used for contributing template.
.RepoName string Repository name.
.RepoUser string Repository owner name.

Template Examples

Template files

  • ~/.github/ISSUE_AND_PULL_REQUEST_TEMPLATE.md
{{if .IsIssue}}
### Expected Behavior


### Actual Behavior


{{end}}
{{if .IsPullRequest}}
### Fix or Enhancement?


- [ ] All tests passed
{{end}}

### Environment
- OS: Write here
- Go version: Write here
  • ~/.github/CONTRIBUTING.md
Thank you for contributing {{.RepoName}}!
=========================================

Please follow issue/PR template.

Generated Files

  • /path/to/your-repo/.github/ISSUE_TEMPLATE.md
### Expected Behavior


### Actual Behavior


### Environment
- OS: Write here
- Go version: Write here
  • /path/to/your-repo/.github/PULL_REQUEST_TEMPLATE.md
### Fix or Enhancement?


- [ ] All tests passed

### Environment
- OS: Write here
- Go version: Write here
  • /path/to/your-repo/.github/CONTRIBUTING.md
Thank you for contributing my-project!
=========================================

Please follow issue/PR template.

Update dot-github command

To update dot-github command, -selfupdate flag is recommended.

References

License

This software is distributed under MIT license.

dot-github's People

Contributors

rhysd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.