Skip to main content

Contribution Guide

Authors(s): SpagoAsparago, PlatinumMaster


Creating a Fork

  1. If you don't have one already, you first need to create a GitHub account
  2. 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:

These are necessary to clone the repository, install dependencies, and start the local server.

Steps

  1. Fork the repository.

  2. Open a terminal.

  3. 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"
  4. 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".

  5. 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.

  6. 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.

  7. Navigate to the project directory with cd ds-pokemon-hacking.github.io.

  8. Install the necessary dependencies with npm install.

  9. Once the dependencies are installed, you can start the local server with npm run start.

  10. 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

  1. 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.
  2. 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>.
  3. 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.
    • 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.
  4. 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.
  5. 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

  1. 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).
  2. Use the template you pasted in as a guideline, as well as existing information on the repository.
  3. 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), where filepath is relative to your guide/resource location.
  4. 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:

  1. Open your terminal, and change directory into your local copy of the repository with cd <path/to/ds-pokemon-hacking.github.io>.
  2. Run git add . to add all of the files.
  3. Run git commit -m <Your commit message> to log your changes.
  4. Run git push origin main to push your changes to remote.
  5. 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.

  1. Navigate to the original repository.
  2. To the right of the Branch menu, click the New pull request button.
  3. On the Compare page, click compare across forks.
  4. 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.
  5. Type a title and description for your pull request.
  6. To create a pull request that is ready for review, click Create Pull Request.
  7. Afterwards, it will be reviewed by one of the maintainers, and comments made if needed.
  8. 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.