Contribution Guide
Authors(s): SpagoAsparago, PlatinumMaster
Creating a Fork
- If you don't have one already, you first need to create a GitHub account
- Go to the main repo and click the Fork button in the top right. Check out GitHub's official article for more details.
Running and Editing Docusaurus Locally
In order to see exactly what your changes will do, it is best to run Docusaurus locally, so you can have a live development environment.
Prerequisites
Before you can run Docusaurus locally, you need to have the following installed on your machine:
- A text editor, such as Visual Studio Code or Sublime Text.
- Node.js (version 12 or newer).
- npm (version 5.2 or newer).
- Git.
These are necessary to clone the repository, install dependencies, and start the local server.
Steps
-
Open a terminal.
-
If you haven't configured Git on your machine, you need to do so before pulling from GitHub. Run the following commands in your terminal:
- Set your Git username:
git config --global user.name "<GitHub Account Name>"
- Set your Git email address:
git config --global user.email "your-email@example.com"
- Set your Git username:
-
If you haven't connected your GitHub account with SSH, follow these steps:
-
Run this command, substituting in the email address associated with your GitHub account. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
ssh-keygen -t ed25519 -b 4096 -C "your-email@example.com"
-
Start the ssh-agent in the background:
eval "$(ssh-agent -s)"
-
Add your SSH private key to the ssh-agent:
ssh-add ~/.ssh/id_rsa
-
Copy the SSH key to your clipboard.
-
Go to your GitHub account settings, select "SSH and GPG keys" and click on "New SSH key". Paste your key into the "Key" field and click "Add SSH key".
-
-
Now, you can clone the repository to your local machine. You can do this by running
git clone git@github.com:<your account name>/ds-pokemon-hacking.github.io.git
in your terminal. -
Clone the repository to your local machine. You can do this by running
git clone git@github.com:<your account name>/ds-pokemon-hacking.github.io.git
in your terminal. -
Navigate to the project directory with
cd ds-pokemon-hacking.github.io
. -
Install the necessary dependencies with
npm install
. -
Once the dependencies are installed, you can start the local server with
npm run start
. -
The local server should now be running. You can access it by opening your web browser and navigating to
http://localhost:3000
.
Remember, any changes you make to the files in the project directory will be reflected in the local server, allowing you to preview your changes in real time.
Creating a New Guide/Resource
- Open guide.md if you're making a guide, or resources.md if you're making a resource, click the Code button and copy its contents.
- In your repository, go to the appropriate folder:
- If it's for Generation IV,
docs/generation-iv/<guides/resources>
. - If it's for Generation V,
docs/generation-v/<guides/resources>
. - If it's all generations,
docs/universal/<guides/resources>
.
- If it's for Generation IV,
- Create a new folder with the following naming convention:
<game(s)>-<title>
.- If it applies to all games/is universal (or Generations IV and V), just name it
title
. - If your guide/resource title has more than one words in it, write all of the words while keeping a
_
between them. - If your guide/resource applies to a single game, just put the shorthand for the game there.
- For example, a Code Injection guide for Platinum would be named
pt-code_injection
.
- For example, a Code Injection guide for Platinum would be named
- If your guide/resource applies to multiple games, bunch the game names together (keeping a
_
between them).- For example, a Code Injection guide for both Black 2 and White 2 would be named
bw_b2w2-code_injection
.
- For example, a Code Injection guide for both Black 2 and White 2 would be named
- If it applies to all games/is universal (or Generations IV and V), just name it
- Create a file within this folder named
<game(s)>-<title>.md
. In other words: with exactly the same name as the folder. This will contain your guide/resource content. - Open the file within a text editor, and paste the template data you copied earlier into it.
Now you're ready to go! Your tutorial should now show up under the category you added it to. Just go ahead and start editing it.
Syntax, Images, Video
- The syntax used must follow the Markdown Format, which is the same as Discord uses. You can also use HTML directives directly, but this may prove to be less stable (and Docusaurus will complain if it does not support it).
- Use the template you pasted in as a guideline, as well as existing information on the repository.
- If you wish to add images to your guide/resource, make a subfolder within your guide/resource folder, put your image there and link to it with the following syntax:
![Optional Description](filepath/image.png)
, wherefilepath
is relative to your guide/resource location. - Videos can be embedded within the repository if they are small enough. If not, you must host them somewhere else, then embed them in your Markdown file from an external hosting service like YouTube.
Saving Changes to GitHub, Pull Requests
Saving Changes
When you are finished, you need to commit your changes.
To do so:
- Open your terminal, and change directory into your local copy of the repository with
cd <path/to/ds-pokemon-hacking.github.io>
. - Run
git add .
to add all of the files. - Run
git commit -m <Your commit message>
to log your changes. - Run
git push origin main
to push your changes to remote. - If all goes according to plan, your changes will be on your fork at
https://github.com/<your account name>/ds-pokemon-hacking.github.io
.
Pull Requests
After you have pushed your changes to your forked repository, you can create a pull request to propose your changes to the original repository.
Make sure it builds and looks correct before submitting your pull request.
- Navigate to the original repository.
- To the right of the Branch menu, click the New pull request button.
- On the Compare page, click compare across forks.
- Confirm that the base fork is the repository you'd like to merge changes into. The head fork is your fork with the changes you'd like to merge.
- Type a title and description for your pull request.
- To create a pull request that is ready for review, click Create Pull Request.
- Afterwards, it will be reviewed by one of the maintainers, and comments made if needed.
- If no changes are needed, it will be merged in, and appear on the site within a few minutes!
A pull request can be created at any time, but is commonly done so after all changes have been made. For more details, you can check out GitHub's official guide.