Skip to content

Commit fa6d43d

Browse files
Add a contributing page based on CONTRIBUTING.md
1 parent f32f0ac commit fa6d43d

File tree

4 files changed

+84
-3
lines changed

4 files changed

+84
-3
lines changed

_includes/doc-list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ <h3 id="contributing">Contributing</h3>
3434
<h3 id="misc">Misc</h3>
3535

3636
<ul>
37+
<li><a href="/docs/contributing/"><strong>Contributing</strong></a></li>
3738
<li><a href="/docs/plugin-unit-tests/"><strong>Plugin unit tests</strong></a> - How to set up and run PHPUnit tests for a WordPress plugin.</li>
3839
</ul>
3940

command.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,44 @@ function generate_homepage() {
4444
}
4545
WP_CLI::add_command( 'website generate-homepage', '\WP_CLI_Org\generate_homepage' );
4646

47+
/**
48+
* Generate the contributing page from the repo's CONTRIBUTING.md
49+
*
50+
* @when before_wp_load
51+
*/
52+
function generate_contributing() {
53+
$ret = trim( shell_exec( 'which wp' ) );
54+
if ( empty( $ret ) ) {
55+
WP_CLI::error( 'Could not find path to wp executable.' );
56+
}
57+
if ( 'link' === filetype( $ret ) ) {
58+
$ret = readlink( $ret );
59+
}
60+
61+
$contributing_path = dirname( dirname( $ret ) ) . '/CONTRIBUTING.md';
62+
if ( ! is_file( $contributing_path ) ) {
63+
WP_CLI::error( 'Could not find CONTRIBUTING.md in wp executable PATH. Please make sure wp executable points to git clone.' );
64+
}
65+
66+
$contents = file_get_contents( $contributing_path );
67+
$search = <<<EOT
68+
Contributing
69+
============
70+
EOT;
71+
$replace = <<<EOT
72+
---
73+
layout: default
74+
title: Contributing
75+
category: Contributing
76+
description: An introduction to the contributing process.
77+
---
78+
EOT;
79+
$contents = str_replace( $search, $replace, $contents );
80+
file_put_contents( dirname( __FILE__ ) . '/docs/contributing/index.md', $contents );
81+
WP_CLI::success( 'Updated docs/contributing/index.md from project CONTRIBUTING.md.' );
82+
}
83+
WP_CLI::add_command( 'website generate-contributing', '\WP_CLI_Org\generate_contributing' );
84+
4785
/**
4886
* Dump the list of internal APIs, as JSON.
4987
*

docs/contributing/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
layout: default
3+
title: Contributing
4+
---
5+
6+
Welcome and thanks!
7+
8+
We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project.
9+
10+
**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.
11+
12+
Please take a moment to read these guidelines at depth. Following the guidelines helps to communicate that you respect the time of the other contributors to the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world.
13+
14+
### Reporting a bug
15+
16+
Think you’ve found a bug? We’d love for you to help us get it fixed.
17+
18+
Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version of WP-CLI. You should also check our [documentation on common issues and their fixes](https://wp-cli.org/docs/common-issues/).
19+
20+
Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [follow our guidelines for submitting a bug report](http://wp-cli.org/docs/bug-reports/) to make sure it gets addressed in a timely manner.
21+
22+
### Creating a pull request
23+
24+
Want to contribute a new feature? WP-CLI is a mature project, and already chock-full of useful functionality. Please first [open a new issue](https://github.com/wp-cli/wp-cli/issues/new) to discuss whether the feature is a good fit for WP-CLI core, or might be better suited as a [community package](https://wp-cli.org/package-index/).
25+
26+
Once you've decided to commit the time to seeing your pull request through, please [follow our guidelines for creating a pull request](https://wp-cli.org/docs/pull-requests/) to make sure it's a pleasant experience.
27+
28+
### Contributing in other ways
29+
30+
Feel free to [create an issue](https://github.com/wp-cli/wp-cli/issues/new) with your question, and we'll see if we can find an answer for it.
31+
32+
Alternatively, if you have a WordPress.org account, you may also consider joining the `#cli` channel on the [WordPress.org Slack organization](https://make.wordpress.org/chat/).

index.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,29 @@ WP-CLI's maintainers and project contributors do their best to respond to all ne
105105
- [Open or closed issues on Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue)
106106
- [WordPress StackExchange forums](http://wordpress.stackexchange.com/questions/tagged/wp-cli)
107107

108+
If you can't find your answer in one of those existing resources, feel free to [create an issue](https://github.com/wp-cli/wp-cli/issues/new) with your question.
109+
108110
If you have a WordPress.org account, you may also consider joining the `#cli` channel on the [WordPress.org Slack organization](https://make.wordpress.org/chat/).
109111

110112
## Extending
111113

112114
A **command** is an atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) is another.
113115

114-
WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) to learn more. Browse the [internal API docs](http://wp-cli.org/docs/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command.
116+
WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) to learn more. Browse the [internal API docs](https://wp-cli.org/docs/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command.
115117

116118
## Contributing
117119

118-
To get involved, please first read about [creating an issue](https://wp-cli.org/docs/bug-reports/) or [submitting a pull request](https://wp-cli.org/docs/pull-requests/).
120+
Welcome and thanks!
121+
122+
We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project.
123+
124+
**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.
125+
126+
Please take a moment to [read these guidelines at depth](https://wp-cli.org/docs/contributing/). Following them helps to communicate that you respect the time of the other contributors to the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world.
127+
128+
## Leadership
119129

120-
### Leadership
130+
WP-CLI is led by these individuals:
121131

122132
* [Daniel Bachhuber](https://github.com/danielbachhuber/) - current maintainer
123133
* [Cristi Burcă](https://github.com/scribu) - previous maintainer

0 commit comments

Comments
 (0)