Skip to content

Commit 0ba2d76

Browse files
Merge pull request #168 from wp-cli/contributing
Add a contributing page based on CONTRIBUTING.md
2 parents 07f9db0 + 2361344 commit 0ba2d76

2 files changed

Lines changed: 51 additions & 3 deletions

File tree

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
*

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)