Skip to content

Commit 0cc211f

Browse files
authored
Merge pull request #12 from docsforadobe/add/style-guide
Add contribution style guide
2 parents 230d770 + 6f7ea65 commit 0cc211f

File tree

8 files changed

+714
-137
lines changed

8 files changed

+714
-137
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ jobs:
3232
mkdocs-material-
3333
- run: >
3434
pip install
35+
markdown_grid_tables
3536
mkdocs-exclude-search
36-
mkdocs-material
3737
mkdocs-git-revision-date-localized-plugin
38+
mkdocs-material
3839
mkdocs-print-site-plugin
3940
- run: mkdocs gh-deploy --force

docs/contributing/contribution-guide.md

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,25 @@
22

33
This endeavour is primarily community-supported & run; contributors are welcome and encouraged to suggest fixes, adjustments, notes/warnings, and anything else that may help the project.
44

5-
This project is written in [Markdown](https://en.wikipedia.org/wiki/Markdown), styled & served using [mkdocs](https://www.mkdocs.org/).
5+
This project is written in [Markdown](https://en.wikipedia.org/wiki/Markdown), served using [MkDocs](https://www.mkdocs.org/), themed with [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
66

7-
---
8-
9-
## Build HTML Locally
10-
11-
Before pushing to the online project (or submitting a PR), we ask that you develop & test the project locally to ensure the result is what you'd expect.
12-
13-
To build locally:
14-
15-
- Install python & pip
16-
- From a terminal, navigate to the project directory and run the following command to install dependencies:
17-
```sh
18-
pip install -r requirements.txt
19-
```
20-
- When done, run the following command to serve the docs:
21-
```sh
22-
mkdocs serve
23-
```
24-
- Open your browser to the provided url (`http://127.0.0.1:8000`) by default to view the live-updating docs
25-
26-
---
27-
28-
## Admonitions Usage
29-
30-
Currently, the following [admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) are in use in this project. Try to keep one piece of data per note, for easier parsing.
31-
32-
```
337
!!! note
34-
Notes detail version added, and/or relevant pieces of information.
8+
Broad info on Markdown syntax is outside the scope of this guide. Please familiarise yourself with it before contributing.
359

36-
!!! tip
37-
Tips detail version added, and/or relevant pieces of information.
10+
---
3811

39-
!!! warning
40-
Warnings convey negative behaviours, or when something won't work the way you'd expect.
41-
```
12+
## Contributing
4213

43-
These will render as:
14+
This contribution guide is split into a few chapters.
4415

45-
!!! note
46-
Notes detail version added, and/or relevant pieces of information.
16+
- [To set up your environment & get started with contributing](./getting-set-up.md)
17+
- [Documentation style](./style-guide.md)
18+
- [Other tips & tricks](./other-tips.md)
4719

4820
!!! tip
49-
Tips detail version added, and/or relevant pieces of information.
50-
51-
!!! warning
52-
Warnings convey negative behaviours, or when something won't work the way you'd expect.
53-
54-
---
55-
56-
## Adding undocumented attributes or methods
57-
58-
If you find attributes or methods that are not mentioned in this documentation, and they are not publically announced by Adobe, please add this warning to attribute/method so the user knows to use it at their own risk.
59-
60-
```
61-
!!! warning
62-
This method/property is officially undocumented and was found via research. The information here may be inaccurate, and this whole method/property may disappear or stop working some point. Please contribute if you have more information on it!
63-
```
21+
*This repo itself* may not adhere to the standards above, as we're using a number of custom features to help demonstrate best practices.
6422

65-
Rendered as:
66-
!!! warning
67-
This method/property is officially undocumented and was found via research. The information here may be inaccurate, and this whole method/property may disappear or stop working some point. Please contribute if you have more information on it!
23+
If in doubt, follow the above guides and templates, *not* the source code of this contribution guide.
6824

6925
---
7026

docs/contributing/getting-set-up.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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.

docs/contributing/other-tips.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Other Tips
2+
3+
Various other tips, suggestions, solutions that we've found to be helpful when working on these guides.
4+
5+
---
6+
7+
## Use code editor extensions!
8+
9+
As markdown is such a common language, there are a *ton* of code editor extensions to help writing it. Take advantage of them!
10+
11+
One specific place this can help is when working with [tables](./style-guide.md#tables). As these can get fairly long and unwieldy, being able to quickly format the table to align columns & fix formatting is *way* better than doing this by hand.
12+
13+
---
14+
15+
## Adding undocumented attributes or methods
16+
17+
If you find attributes or methods that are not mentioned in this documentation, and they are not publically announced by Adobe, please add this warning to attribute/method so the user knows to use it at their own risk.
18+
19+
=== "Rendered"
20+
21+
!!! warning
22+
This method/property is officially undocumented and was found via research. The information here may be inaccurate, and this whole method/property may disappear or stop working some point. Please contribute if you have more information on it!
23+
24+
=== "Markdown"
25+
26+
```
27+
!!! warning
28+
This method/property is officially undocumented and was found via research. The information here may be inaccurate, and this whole method/property may disappear or stop working some point. Please contribute if you have more information on it!
29+
```

0 commit comments

Comments
 (0)