-
-
Notifications
You must be signed in to change notification settings - Fork 26.6k
01. How to contribute
Ilkka Seppälä edited this page Oct 26, 2019
·
61 revisions
Pull request title
- Clearly and concisely describes what it does
- Refers to the issue that it solves, if available
Pull request description
- Describes the main changes that come with the pull request
- Any relevant additional information is provided
To work on a new pattern you need to do the following steps:
- If there is no issue for the new pattern yet, raise new issue. Comment on the issue that you are working on it so that others don't start work on the same thing. You are encouraged to present your implementation idea so others can participate in the design phase and help.
- Fork the repository.
- Create a new folder for the pattern. The rough structure of the new folder would be as follows:
-
etc
(every resource related to the pattern, like diagrams) -
src
(the source code of the pattern) -
README.md
(the description of the pattern) -
pom.xml
(the Maven project file)
-
- Implement the code changes in your fork. Remember to add sufficient comments documenting the implementation. Reference the issue id e.g. #52 in your commit messages.
- Format the code according to project Checkstyle configuration
- The build fails if the code is not properly formatted (see coding conventions)
- The build also fails if PMD static analysis finds violations
- Add description of the pattern in pattern-
README.md
. All internal links must be relative to the pattern subdirectory, otherwise the links don't link properly on the website. All code samples need to be annotated with correct language for the syntax highlighting to work e.g. ```java xxx ``` - Create a pull request.
- Now that the pattern example is ready you should consider writing a blog post about it (see instructions below)
- Please also consider creating a presentation about it (see instructions below)
Structure of the pattern-README.md
file
--- # this is so called 'Yaml Front Matter', read up on it here: http://jekyllrb.com/docs/frontmatter/
layout: pattern # layout must always be pattern
title: Best Pattern Ever # the properly formatted title
folder: best-pattern-ever # the folder name in which this pattern lies
permalink: /patterns/best-pattern-ever/ # the permalink to the pattern, to keep this uniform please stick to /patterns/FOLDER/
description: # short meta description that shows in Google search results
# both categories and tags are Yaml Lists
# you can either just pick one or write a list with '-'s
# usable categories and tags are listed here: https://github.com/iluwatar/java-design-patterns/blob/gh-pages/_config.yml
categories: creational # categories of the pattern
tags: # tags of the pattern
- best
- ever
- awesome
---
## Name / classification
...
## Also known as
...
## Intent
...
## Explanation
...
## Applicability
...
## Tutorials
...
## Presentations
...
## Known uses (real world examples)
...
## Consequences (the good and the bad, add criticism here)
...
## Related patterns
...
## Credits
...
To add a new category or tag you need to edit the _data/categories.yml
or _data/tags.yml
file of the gh-pages
branch.
In there you should find a yaml list that can be extended.
To work on one of the non-pattern issues you need to do the following steps:
- Check that the issue has
help wanted
badge - Comment on the issue that you are working on it
- Fork the repository.
- Implement the code changes in your fork. Remember to add sufficient comments documenting the implementation. Reference the issue id e.g. #52 in your commit messages.
- Create a pull request.
To create a new blog entry you should follow the following steps:
- Check that the topic you want to write about isnt allready covered by a previous blogpost
- Fork the repository.
- Create a markup file file in the /_posts/ folder of the gh-pages branch
- Name it in the following convention: YEAR-MONTH-DAY-title.MARKUP
Where YEAR is a four-digit number, MONTH and DAY are both two-digit numbers, and MARKUP is the file extension representing the format used in the file. (Examples are below) - Write your blogpost (Structure is explained below)
- Create a pull request.
Examples of valid post filenames:
2011-12-31-new-years-eve-is-awesome.md
2012-09-12-how-to-write-a-blog.textile
Structure of a blogpost:
--- # this is so called 'Yaml Front Matter', read up on it here: http://jekyllrb.com/docs/frontmatter/
layout: post # layout must allways be post
title: Best Pattern Ever # the properly formatted title
author: shortname # the authors shortname from the /_data/people.yml See older blogposts for reference
excerpt_separator: <!--more--> # optional, if you want to customize what is shown as an excerpt. Read up on it here: http://jekyllrb.com/docs/posts/#post-excerpts
---
Bla Bla Bla # the content of your blogpost
More info on writing a blogpost can be found on the official website
To create a new presentation you should follow the following steps:
- Read the remark.js instructions https://github.com/gnab/remark
- As told in the Getting Started section create the presentation template in the pattern's
etc
folder with namepresentation.html
- Read through the other presentations already existing in the project (see https://github.com/iluwatar/java-design-patterns/issues/197)
- Edit/test the presentation until you are happy with the result
- Create a pull request
For instructions how to setup IDE check here