|
1 |
| -# Repo Organization |
| 1 | +# Contributing to Plotly's Graphing Libraries Documentation |
2 | 2 |
|
3 |
| -Edit or add files in the `_posts` folder in the [source-design-merge](http://github.com/plotly/documentation/tree/source-design-merge) branch. |
| 3 | +## Repo Overview |
4 | 4 |
|
5 |
| -## Clone the Repo and Install Dependencies |
| 5 | +Plotly welcomes contributions to its [open-source graphing libraries documentation](https://plot.ly/graphing-libraries) from its community of users. |
6 | 6 |
|
7 |
| -1. Clone the repo and then check out the source-design-merge branch: |
| 7 | +This repository mainly serves: |
| 8 | +- Plotly's graphing libraries documentation index page at https://plot.ly/graphing-libraries. |
| 9 | + |
| 10 | +- Plotly's JavaScript graphing library documentation at https://plot.ly/javascript |
| 11 | + - Please be aware that **only the content of Plotly's JavaScript graphing library documentation** (hosted at https://plot.ly/javascript) is contained in this repository. You can find the content in the `_posts/plotly_js` directory. |
| 12 | + - For information about editing **plotly.js** documentation [click here](https://github.com/plotly/documentation/blob/source-design-merge/_posts/plotly_js/README.md). |
| 13 | + |
| 14 | +- Plotly's Python graphing library documentation at https://plot.ly/python |
| 15 | + - The content for Plotly's Python graphing library documentation (hosted at https://plot.ly/python) **IS NOT** contained in this repository. It is contained in the `plotly.py` repository at https://github.com/plotly/plotly.py/tree/master/doc and is cloned into this repository at build time. |
| 16 | + - For information about editing **plotly.py** documentation [click here](https://github.com/plotly/plotly.py/blob/master/doc/README.md). |
| 17 | + |
| 18 | +- Plotly's R graphing library documentation at https://plot.ly/r |
| 19 | + - The content for Plotly's R graphing library documentation (hosted at https://plot.ly/r) **IS NOT** contained in this repository. It is contained in the `plotly.r-docs` repository at https://github.com/plotly/plotly.r-docs/ and is cloned into this repository at build time. |
| 20 | + - For information about editing Plotly's **R** documentation [click here](https://github.com/plotly/plotly.r-docs/blob/master/README.md). |
| 21 | + |
| 22 | +## Contribute Quickly to Plotly's JavaScript Graphing Library Documentation |
| 23 | + |
| 24 | +To quickly make a contribution to Plotly's JavaScript graphing libraries documentation, simply submit a pull request with the change you would like to suggest. |
| 25 | + |
| 26 | +The easiest way to do this is to follow the `Edit this page on GitHub` link at the top right of the page you are interested in contributing to: |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +**Note:** You don't have to worry about breaking the site when you submit a pull request!** This is because your change will not be merged to production immediately. A Plotly team member will first perform a code review on your pull request. |
| 31 | + |
| 32 | +## How To Get The Application Working Locally |
| 33 | + |
| 34 | +For more extensive changes to Ploty's JavaScript documentation, we suggest getting the Jekyll application which builds the site to run locally so that you can test your changes as you develop them. |
| 35 | + |
| 36 | +This involves cloning the repository and installing its dependencies: [Git](https://git-scm.com/), [Ruby]((https://www.ruby-lang.org/en/), [Jekyll](https://jekyllrb.com/), and the [Python `requests` package](https://pypi.org/project/requests/). |
| 37 | + |
| 38 | +1. Use [`git`](https://git-scm.com/) to [clone](https://git-scm.com/docs/git-clone) the public `plotly/documentation` repository. Then [check out] (https://git-scm.com/docs/git-checkout) the source-design-merge branch of the `git` repository. |
| 39 | + |
| 40 | +To do so, run the following commands in your terminal: |
8 | 41 |
|
9 | 42 | ```sh
|
10 | 43 | git clone [email protected]:plotly/documentation.git
|
11 | 44 | git fetch origin
|
12 | 45 | git checkout source-design-merge
|
13 | 46 | ```
|
14 | 47 |
|
15 |
| -2. Check Ruby version `$ ruby --version`. We recommend using `version 2.3.3` or the same ruby version as [gh-pages](https://pages.github.com/versions/). Note [RVM](https://rvm.io/rvm/install) is helpful for installing and managing ruby versions. |
| 48 | +**Note:** For historical reasons, the `source-design-merge` branch is the `master` branch of this repository. |
16 | 49 |
|
17 |
| -3. Install bundler and dependencies from the `Gemfile`: |
| 50 | +Running `git status` in your terminal should then output the following: |
18 | 51 |
|
19 | 52 | ```sh
|
20 |
| -gem install bundler |
21 |
| -bundle install |
| 53 | +On branch source-design-merge |
| 54 | +Your branch is up to date with 'origin/source-design-merge'. |
| 55 | + |
| 56 | +nothing to commit, working tree clean |
22 | 57 | ```
|
23 | 58 |
|
24 |
| -Note these dependencies should be the same version that [gh-pages](https://pages.github.com/versions/) is using. |
| 59 | +2. Download Ruby and check your `Ruby` version by running the `ruby --version` command in your terminal. |
25 | 60 |
|
26 |
| -4. When we deploy, a function is run to update the plot schema. To do this successfully you have to make sure you have the `requests` python package: `pip install requests` |
| 61 | +**Note:** We recommend using `version 2.3.3` or the same ruby version as [gh-pages](https://pages.github.com/versions/). Note [RVM](https://rvm.io/rvm/install) is helpful for installing and managing ruby versions. |
27 | 62 |
|
28 |
| -## Making Changes |
| 63 | +3. Download Jekyll and check your Jekyll version by running the `jekyll -v` command in your terminal. We recommend using the same ruby version as [gh-pages](https://pages.github.com/versions/). |
29 | 64 |
|
30 |
| -- For information about editing **plotly.js** docs see: https://github.com/plotly/documentation/blob/source-design-merge/_posts/plotly_js/README.md |
31 |
| -- For information about editing **python** docs see: https://github.com/plotly/documentation/blob/source-design-merge/_posts/python/README.md |
32 |
| -- For information about editing **R** docs see: https://github.com/plotly/documentation/blob/source-design-merge/_posts/r/README.md |
33 |
| -- For information about editing chart studio documentation found at [https://help.plot.ly/tutorials/](https://help.plot.ly/tutorials/) please see this repo: [https://github.com/plotly/plotly.github.io](https://github.com/plotly/plotly.github.io) |
| 65 | +4. Install bundler and dependencies from the Jekyll applicaton's [`Gemfile`](https://github.com/plotly/documentation/blob/source-design-merge/Gemfile) by running the following commands in your terminal: |
| 66 | + |
| 67 | +```sh |
| 68 | +gem install bundler |
| 69 | +bundle install |
| 70 | +``` |
34 | 71 |
|
35 |
| -## Render Changes Locally |
| 72 | +**Note:** These dependencies should be the same version that [gh-pages](https://pages.github.com/versions/) is using. |
36 | 73 |
|
37 |
| -Please **ALWAYS** locally serve the docs and check your changes before committing updates. |
| 74 | +5. Serve the Jekyll application: `bundle exec jekyll serve --config _config_dev.yml`. |
38 | 75 |
|
39 |
| -1. To serve the docs locally, in the documentation repo run: `bundle exec jekyll serve --config _config_dev.yml` |
40 |
| -2. Visit the pages at: [http://localhost:4000/python/](http://localhost:4000/python/) |
41 |
| -3. When you make changes, jekyll should automatically regenerate for you. Read the messages in your terminal to check it out |
| 76 | +6. Visit the pages at: [http://localhost:4000/](http://localhost:4000) |
42 | 77 |
|
43 |
| -There are a TON of posts in here, so rendering can take up to |
44 |
| -thirty minutes! You can *limit* the number of posts that render by |
45 |
| -excluding folders in the `_config_dev.yml` file. |
| 78 | +**Note** The default Jekyll configuration file only builds the JavaScript posts by [excluding folders](https://jekyllrb.com/docs/configuration/options/). If you want to override this behavior, serve the application with a custom Jekyll configuration file in the root of the repository. Do this by copying `_config_dev.yml`, renaming it `_config_personal.yml`, and modifying the `exclude` statement. |
46 | 79 |
|
47 |
| -For example, change `_config_dev.yml` to this: |
| 80 | +- If you name the Jekyll configuration file `_config_personal.yml`, it will be caught by the `.gitignore` file and not committed to version control. |
| 81 | +- Run `bundle exec jekyll serve --config _config_personal.yml` to use the custom configuration file |
48 | 82 |
|
| 83 | +- Example configuration: |
49 | 84 | ```yml
|
50 |
| -staticurl: http://localhost:4000/all_static |
51 |
| -exclude: [_posts/ggplot2, _posts/julia, _posts/matlab, _posts/matplotlib, _posts/nodejs, _posts/r] # [_posts/python,] |
| 85 | +# --- |
| 86 | +# Excludes every directory except JavaScript |
| 87 | +# --- |
| 88 | +exclude: ['_posts/reference_pages', _posts/ggplot2','_posts/julia','_posts/matlab','_posts/node_js','_posts/r','_posts/python','_posts/python-v3','_posts/misc','_posts/dashboards',_posts/scala', '_posts/nodejs', 'node_modules'] |
52 | 89 | ```
|
53 | 90 |
|
54 |
| -and you'll only load the files in `_posts/python`. |
| 91 | +and you'll only load the files in `_posts/plotly_js` directory because that is the only directory that is not excluded. |
55 | 92 |
|
56 |
| -Change it to this |
| 93 | +Change it to this: |
57 | 94 |
|
58 | 95 | ```yml
|
| 96 | +# --- |
| 97 | +# Excludes no directory |
| 98 | +# --- |
59 | 99 | staticurl: http://localhost:4000/all_static
|
60 | 100 | exclude: []
|
61 | 101 | ```
|
62 | 102 |
|
63 |
| -and it'll load everything. |
64 |
| - |
65 |
| -## Make a PR |
66 |
| -Ready for your changes to be reviewed? Make a pull request against the `source-design-merge` branch! |
67 |
| -Create a feature branch and use `git status` to list changed files. |
| 103 | +and you'll load every file because no directories are excluded. |
68 | 104 |
|
69 |
| -(Make sure that the feature branch is a branch off from `source-design-merge` local branch in your machine and not from any other previously worked branch). |
70 |
| -```sh |
71 |
| -git checkout -b your_feature_branch |
72 |
| -git status |
73 |
| -``` |
74 |
| -Add, commit, and push the files that you'd like to add to your pr: |
75 |
| -```sh |
76 |
| -git add file-a |
77 |
| -git add file-b |
78 |
| -git commit -m 'message about your changes' |
79 |
| -git push origin your_feature_branch |
80 |
| -``` |
81 |
| -Visit the [documentation repo](https://github.com/plotly/documentation) and open a pull request against the `source-design-merge` branch. |
| 105 | +## Continuous Integration |
82 | 106 |
|
83 |
| -After your PR has been reviewed and approved, you can merge it into the `source-design-merge` branch! Your changes haven't been deployed yet so they won't be online. That said, be sure to check them after they have been deployed. |
| 107 | +Whenever a pull request is made, a continuous integration workflow is initiated. This includes of: |
| 108 | + - running the `check-or-enforce-order.py` and `front-matter-ci.py` scripts inside of a Docker container to validate YAML front-matter |
| 109 | + - Percy screenshot testing |
84 | 110 |
|
85 |
| -## Search |
| 111 | +Making sure that a pull request passes every continuous integration test is a part of the code review process. |
86 | 112 |
|
87 |
| -We now have search via algolia implemented on our index and reference documentation pages! Please refer to our [make README](https://github.com/plotly/documentation/blob/source-design-merge/make_instructions.txt) for more information on how search works and instructions on how to update or edit Plotly search indices. |
| 113 | +**For more information about the build process, inspect the CircleCI configuration file in this repository at https://github.com/plotly/documentation/blob/source-design-merge/.circleci/config.yml.** |
88 | 114 |
|
89 |
| -## Style Edits |
| 115 | +## Other Documentation |
90 | 116 |
|
91 |
| -Please refer to our [Styles README](https://github.com/plotly/documentation/blob/source-design-merge/style_README.md) |
| 117 | +This repository also contains: |
| 118 | + - Plotly's Node.js, Matlab, Scala, Julia, and Python V3 graphing libraries documentation |
| 119 | + - the reference pages for Plotly's JavaScript, Python, R, and Matlab graphing libraries. |
0 commit comments