Skip to content

Commit ad8d77a

Browse files
pfefferlejeherveobenland
authored
Improve documentation (#1019)
* Improve documentation * add contributing * fix indents * update links * Fix links * fixed links * how to setup local env * copy and past from jetpack * fix * Update CONTRIBUTING.md Co-authored-by: Jeremy Herve <[email protected]> * Update CONTRIBUTING.md Co-authored-by: Konstantin Obenland <[email protected]> * Update CONTRIBUTING.md Co-authored-by: Konstantin Obenland <[email protected]> * Update docs/translations.md Co-authored-by: Konstantin Obenland <[email protected]> * Update docs/translations.md Co-authored-by: Konstantin Obenland <[email protected]> * remove jekyll code * fix links * Add docs for unit tests --------- Co-authored-by: Jeremy Herve <[email protected]> Co-authored-by: Konstantin Obenland <[email protected]>
1 parent 6d47cee commit ad8d77a

13 files changed

+178
-141
lines changed

.distignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ _site
1616
bin
1717
CHANGELOG.md
1818
CODE_OF_CONDUCT.md
19+
CONTRIBUTING.md
1920
composer.json
2021
composer.lock
2122
Dockerfile
@@ -40,4 +41,4 @@ readme.md
4041
SECURITY.md
4142
src
4243
tests
43-
vendor
44+
vendor

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
530530

531531
* Normalize attributes that can have mixed value types
532532

533-
## [1.3.0] 2023-12-05
533+
## [1.3.0] - 2023-12-05
534534

535535
### Added
536536

CODE_OF_CONDUCT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
https://developer.wordpress.com/contact/?g21-subject=Code%20of%20Conduct.
63+
<https://developer.wordpress.com/contact/?g21-subject=Code%20of%20Conduct>.
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the
@@ -116,13 +116,13 @@ the community.
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120120

121121
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).
123123

124124
[homepage]: https://www.contributor-covenant.org
125125

126126
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
127+
<https://www.contributor-covenant.org/faq>. Translations are available at
128+
<https://www.contributor-covenant.org/translations>.

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing to ActivityPub for WordPress
2+
3+
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
4+
5+
Developers of all levels can help — whether you can barely recognize a filter (or don’t know what that means) or you’ve already authored your own plugins, there are ways for you to pitch in.
6+
7+
## Create Bug Reports
8+
9+
If you find a bug, please [file a GitHub issue](https://github.com/Automattic/wordpress-activitypub/issues/). If you have write access, add the appropriate labels.
10+
11+
If you’re filing a bug, specific steps to reproduce are helpful. Please include the URL of the page that has the bug, along with what you expected to see and what happened instead.
12+
13+
## Write and submit a patch
14+
15+
If you'd like to fix a bug or make an enhancement, you can submit a Pull Request. Before you get started, you'll want to **[set up your development environment.](docs/development-environment.md)**
16+
17+
Once your development environment is ready, you can get started and [create your first Pull Request!](docs/pull-request.md)
18+
19+
### Get started
20+
21+
If you'd like to contribute but don't know where to get started, you can take a look at existing issues:
22+
23+
- ["Good First Issues"](https://github.com/Automattic/wordpress-activitypub/labels/%5BType%5D%20Good%20First%20Issue) are a good entry point to get familiar with ActivityPub plugin's code base.
24+
- All issues labeled with [the "Good For Community" label](https://github.com/Automattic/wordpress-activitypub/issues?q=is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+For+Community%22) are fair game. That's a great way to contribute new features and fix small issues within the ActivityPub plugin.
25+
26+
### We’re Here To Help
27+
28+
We encourage you to ask for help at any point. We want your first experience with the ActivityPub plugin to be a good one, so don’t be shy. If you’re wondering why something is the way it is, or how a decision was made, please create an issue and prefix it with “Question:”.
29+
30+
## Translate the plugin
31+
32+
If you speak a foreign language, you can help translate the ActivityPub plugin into your own language. [here is how.](docs/translations)
33+
34+
## License
35+
36+
The ActivityPub plugin is licensed under the [MIT](https://github.com/Automattic/wordpress-activitypub/blob/trunk/LICENSE) license.
37+
38+
All materials contributed should be compatible with the MIT and GPLv2 license. This means that if you own the material, you agree to license it under the MIT license. If you are contributing code that is not your own, such as adding a component from another Open Source project, or adding an `npm` package, you need to make sure you follow these steps:
39+
40+
1. Check that the code has a license. If you can't find one, you can try to contact the original author and get permission to use, or ask them to release under a compatible Open Source license.
41+
2. Check the license is compatible with MIT and [GPLv2](http://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses), note that the Apache 2.0 license is *not* compatible.

FEDERATION.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ In order to authenticate activities, Mastodon relies on HTTP Signatures, signing
3131

3232
Mastodon requires all `POST` requests to be signed, and MAY require `GET` requests to be signed, depending on the configuration of the Mastodon server.
3333

34-
More information on HTTP Signatures, as well as examples, can be found here: https://docs.joinmastodon.org/spec/security/#http
34+
More information on HTTP Signatures, as well as examples, can be found here: <https://docs.joinmastodon.org/spec/security/#http>
3535

3636
## Additional documentation
3737

38-
- Plugin Description: https://github.com/Automattic/wordpress-activitypub?tab=readme-ov-file#description
39-
- Frequently Asked Questions: https://github.com/Automattic/wordpress-activitypub?tab=readme-ov-file#frequently-asked-questions
40-
- Installation Instructions: https://github.com/Automattic/wordpress-activitypub?tab=readme-ov-file#installation
41-
- Upgrade Notice: https://github.com/Automattic/wordpress-activitypub?tab=readme-ov-file#upgrade-notice
42-
- Changelog: https://github.com/Automattic/wordpress-activitypub/blob/trunk/CHANGELOG.md
38+
- Plugin Documentation: [docs/readme.md](docs/readme.md)
39+
- Changelog: <https://github.com/Automattic/wordpress-activitypub/blob/trunk/CHANGELOG.md>

docs/Gemfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/Gemfile.lock

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/_config.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/development-environment.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Setting up your environment
2+
3+
## Overview
4+
5+
In order to start developing the ActivityPub plugin you want to have access to a WordPress installation where you can install the plugin and work on it.
6+
7+
To do that you need to set up a WordPress site and give it the ability to run your local build of the ActivityPub plugin code repository.
8+
9+
There are several ways to achieve this, listed in the next section.
10+
11+
## Get started with development
12+
13+
### Clone the repository
14+
15+
Before you get started, we recommend that you set up a public SSH key setup with GitHub, which is more secure than saving your GitHub credentials in your keychain. There are more details about [setting up a public key on GitHub.com](https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account).
16+
17+
Fork this repository to your own GitHub account and clone it to your local machine.
18+
19+
### Local development
20+
21+
To run the ActivityPub plugin in a local WordPress environment, you can use `wp-env` or Docker.
22+
23+
### wp-env
24+
25+
`wp-env` lets you easily set up a local WordPress environment for building and testing plugins and themes. It’s simple to install and requires no configuration.
26+
27+
To get started, install `wp-env` by running the following command in the root of the ActivityPub plugin directory:
28+
29+
```bash
30+
npm install
31+
```
32+
33+
Then, start the local environment by running:
34+
35+
```bash
36+
npm run env-start
37+
```
38+
39+
This will start a local WordPress environment with the ActivityPub plugin installed and activated. You can open the WordPress site in your browser by visiting `http://localhost`.
40+
41+
To stop the environment, run:
42+
43+
```bash
44+
npm run env-stop
45+
```
46+
47+
### Docker
48+
49+
If you prefer to use Docker, you can use the `docker-compose.yml` file in the root of the ActivityPub plugin directory.
50+
51+
To start the environment, run:
52+
53+
```bash
54+
docker-compose up -d
55+
```
56+
57+
This will start a local WordPress environment with the ActivityPub plugin installed and activated.
58+
59+
You can open the WordPress site in your browser by visiting `http://localhost:8076`.
60+
61+
## Running Tests
62+
63+
You can now run the test suite using either npm or composer:
64+
65+
```bash
66+
# Using npm
67+
npm run env-start
68+
npm run env-test
69+
70+
# Using composer
71+
wp-env start
72+
composer run test:wp-env
73+
```
74+
75+
### PHPUnit Arguments
76+
77+
Both commands support additional PHPUnit arguments. Add them after `--`:
78+
79+
```bash
80+
# Run a specific test
81+
npm run env-test -- --filter=test_migrate_to_4_1_0
82+
83+
# Run tests in a specific file
84+
npm run env-test -- tests/includes/class-test-migration.php
85+
86+
# Run tests with a specific group
87+
npm run env-test -- --group=migration
88+
89+
# Run tests with verbose output
90+
npm run env-test -- --verbose
91+
92+
# The same works with composer
93+
composer run test:wp-env -- --filter=test_migrate_to_4_1_0
94+
```
95+
96+
Common PHPUnit arguments:
97+
- `--filter`: Run tests matching a pattern
98+
- `--group`: Run tests with a specific @group annotation
99+
- `--exclude-group`: Exclude tests with a specific @group annotation
100+
- `--verbose`: Output more verbose information
101+
- `--debug`: Display debugging information

docs/index.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)