The script will by default use the Markdown-formatted templates found in the templates
directory for importing issues, pull requests, and comments. These are written in US English, and contain some fancy formatting including links to the GitHub profile and Gravatar images for the person who originally authored the issue or comment.
Here you can see examples of how those default templates are rendered when issues are imported:
- Example issue (with label) (original)
- Example pull request (original)
- Example issue with comments (original)
- Example issue with milestone (original)
Creating Custom Templates
If you would like, you can make changes to the existing templates, or create your own from scratch. Issues and comments posted to GitHub support Markdown and some HTML.
The following illustrates a very simple template for comments (look at the default templates included with the library for more advanced examples):
**Comment by [${user_name}](${user_url})** _${date}_
----
${body}
As you can see, a small set of "variables" can be used within your template, and can be retrieved like this: ${user_name}
. The following variables are available:
user_name
- Name of the author of the issue, pull request, or commentuser_url
- URL to the author's GitHub profileuser_avatar
- URL to an avatar image defined for the user (uses Gravatar, at least on GitHub's servers)date
- The date the issue, pull request, or comment was written. Will be formatted according to the format specified in the configs; see Configuration Options: Formatting Dates.url
- URL to the issue, pull request, or commentbody
- The main content written by the author
If you want other data, such as the URL to the code included with the pull request, some "manual" work is required: ${url}/commits
.
Using the Custom Templates
If you created new templates instead of editing the existing ones, you have to tell the script where these templates can be found; you can do this in two ways:
- In the configuration file - See Configuration Options: Custom Templates
- As an argument - See Command Line Arguments: Custom Templates
Contributing
If you have created a template that may benefit others, such as a translation into a different language or improved formatting, please share this change by opening an issue on GitHub, or by contacting me.