|
| 1 | +# Getting Set Up |
| 2 | + |
| 3 | +While it's technically possible to start contributing just through editing the markdown, we ask that you build the project locally to test your changes & ensure the result is what you'd expect. |
| 4 | + |
| 5 | +To start working locally, you'll need to: |
| 6 | + |
| 7 | +1. [Install Python](#install-python) |
| 8 | +2. [Download the repo locally](#download-the-repo-locally) |
| 9 | +3. [Install dependencies](#install-dependencies) |
| 10 | +4. [Build the project](#build-the-project) |
| 11 | + |
| 12 | +??? tip "Quickstart guide" |
| 13 | + |
| 14 | + Assuming you're familiar with some of the below, here's a quick example way to get set up: |
| 15 | + |
| 16 | + ```sh |
| 17 | + # Clone target repo |
| 18 | + git clone https://github.com/docsforadobe/after-effects-scripting-guide.git |
| 19 | + |
| 20 | + # Navigate to that directory |
| 21 | + cd after-effects-scripting-guide |
| 22 | + |
| 23 | + # Install dependencies |
| 24 | + pip install -r requirements.txt |
| 25 | + |
| 26 | + # Serve the docs |
| 27 | + mkdocs serve |
| 28 | + ``` |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Install Python |
| 33 | + |
| 34 | +This project runs on Python & dependent packages. |
| 35 | + |
| 36 | +You'll need to install [Python 3](https://www.python.org/downloads/) & pip (a Python package manager; typically comes with Python installs) |
| 37 | + |
| 38 | +!!! note |
| 39 | + Specific Python installation instructions will depend on your OS; see above links for more info. |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## Download the repo locally |
| 44 | + |
| 45 | +From a terminal, enter the command: |
| 46 | + |
| 47 | +```sh |
| 48 | +git clone path/to/repo.git |
| 49 | +``` |
| 50 | + |
| 51 | +For example, to download the [After Effects Scripting Guide](https://github.com/docsforadobe/after-effects-scripting-guide/): |
| 52 | + |
| 53 | +```sh |
| 54 | +git clone https://github.com/docsforadobe/after-effects-scripting-guide.git |
| 55 | +``` |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Install dependencies |
| 60 | + |
| 61 | +Once Python is installed, you'll need to install the required dependencies for the specific documentation guide you're working in. |
| 62 | + |
| 63 | +The dependencies for each repo is held in a text file in the root of the repo, `requirements.txt`. |
| 64 | + |
| 65 | +These are things like the actual system used to build the project ("MkDocs"), as well as any plugins or extensions required for the specific guide you're working in. |
| 66 | + |
| 67 | +**First, open a terminal to the repo's directory.** |
| 68 | + |
| 69 | +Then, you can tell Python to install these dependencies globally onto your device with the following command: |
| 70 | + |
| 71 | +```sh |
| 72 | +pip install -r requirements.txt |
| 73 | +``` |
| 74 | + |
| 75 | +If you're wanting to install these locally (for just the local user), you can append the `--user` flag: |
| 76 | + |
| 77 | +```sh |
| 78 | +pip install -r requirements.txt --user |
| 79 | +``` |
| 80 | + |
| 81 | +#### MacOS & Virtual Environments |
| 82 | + |
| 83 | +On MacOS, you may need to set up a virtual environment in order for Python to allow you to install these dependencies. |
| 84 | + |
| 85 | +This author isn't familiar enough to explain *why* this is required, though these commands seem to do the trick *before* running the `pip` command above. |
| 86 | + |
| 87 | +```sh |
| 88 | +python3 -m venv venv/ |
| 89 | +source venv/bin/activate |
| 90 | +``` |
| 91 | + |
| 92 | +This will create a subfolder in the directory, `/venv/`, that will hold these dependencies. These files should not be committed to the repo, with `/venv/` being present in each repo's `.gitignore` file. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Build the project |
| 97 | + |
| 98 | +Once the dependencies are installed, you can run the following command to build a local copy of the docs: |
| 99 | + |
| 100 | +```sh |
| 101 | +mkdocs serve |
| 102 | +``` |
| 103 | + |
| 104 | +This will set up a virtual server, render the docs to html, and offer up a local url to view these local docs at. |
| 105 | + |
| 106 | +By default, this local url is `http://127.0.0.1:8000`. |
| 107 | + |
| 108 | +!!! tip |
| 109 | + Any update to the MkDocs config file (`./mkdocs.yml`) or any of the .md docs files will automagically reload the above pages, showing the updates! |
| 110 | + |
| 111 | +Be sure to keep an eye on the terminal for any potential errors or warnings that may come up while working. |
0 commit comments