|
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 | +Plotly welcomes contributions to its [open-source graphing libraries documentation](https://plot.ly/graphing-libraries) from its community of users. |
4 | 4 |
|
5 |
| -## Clone the Repo and Install Dependencies |
| 5 | +The `source-design-merge` branch of this repository hosts a Jekyll application hosted on GitHub Pages that serves Plotly's graphing libraries documentation. |
6 | 6 |
|
7 |
| -1. Clone the repo and then check out the source-design-merge branch: |
| 7 | +The index page for the documentation website is located at https://plot.ly/graphing-libraries. |
| 8 | + |
| 9 | +### plotly.js |
| 10 | + |
| 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 | + |
| 13 | +For information about editing **plotly.js** documentation [click here](https://github.com/plotly/documentation/blob/readme-updates/_posts/plotly_js/README.md). |
| 14 | + |
| 15 | +### plotly.py |
| 16 | + |
| 17 | +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. |
| 18 | + |
| 19 | +For information about editing **plotly.py** documentation [click here] (https://github.com/plotly/plotly.py/blob/master/doc/README.md). |
| 20 | + |
| 21 | +### plotly.r |
| 22 | + |
| 23 | +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. |
| 24 | + |
| 25 | +For information about editing Plotly's **R** documentation [click here](https://github.com/plotly/plotly.r-docs/blob/master/README.md). |
| 26 | + |
| 27 | +**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.** |
| 28 | + |
| 29 | +## Contribute Quickly to Plotly's JavaScript Graphing Library Documentation |
| 30 | + |
| 31 | +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 to the `source-design-merge` branch of this repository. |
| 32 | + |
| 33 | +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: |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +**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. |
| 38 | + |
| 39 | +## How To Get The Application Working Locally |
| 40 | + |
| 41 | +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. |
| 42 | + |
| 43 | +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/). |
| 44 | + |
| 45 | +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. |
| 46 | + |
| 47 | +To do so, run the following commands in your terminal: |
8 | 48 |
|
9 | 49 | ```sh
|
10 | 50 | git clone git@github.com:plotly/documentation.git
|
11 | 51 | git fetch origin
|
12 | 52 | git checkout source-design-merge
|
13 | 53 | ```
|
14 | 54 |
|
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. |
16 |
| - |
17 |
| -3. Install bundler and dependencies from the `Gemfile`: |
| 55 | +Running `git status` in your terminal should then output the following: |
18 | 56 |
|
19 | 57 | ```sh
|
20 |
| -gem install bundler |
21 |
| -bundle install |
| 58 | +On branch source-design-merge |
| 59 | +Your branch is up to date with 'origin/source-design-merge'. |
| 60 | + |
| 61 | +nothing to commit, working tree clean |
22 | 62 | ```
|
23 | 63 |
|
24 |
| -Note these dependencies should be the same version that [gh-pages](https://pages.github.com/versions/) is using. |
| 64 | +2. Download Ruby and check your `Ruby` version by running the `ruby --version` command in your terminal. |
25 | 65 |
|
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` |
| 66 | +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 | 67 |
|
28 |
| -## Making Changes |
| 68 | +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 | 69 |
|
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) |
| 70 | +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: |
| 71 | + |
| 72 | +```sh |
| 73 | +gem install bundler |
| 74 | +bundle install |
| 75 | +``` |
34 | 76 |
|
35 |
| -## Render Changes Locally |
| 77 | +Note these dependencies should be the same version that [gh-pages](https://pages.github.com/versions/) is using. |
36 | 78 |
|
37 |
| -Please **ALWAYS** locally serve the docs and check your changes before committing updates. |
| 79 | +5. When Plotly deploys its graphing libraries documentation to GitHub pages, a function is run to simultaneously update the graphing libraries plot schema in order to keep the two in sync. To do this successfully you have to make sure you have Python and the `requests` Python package installed in your local development environment: `pip install requests`. |
38 | 80 |
|
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 |
| 81 | +6. Serve the Jekyll application: `bundle exec jekyll serve --config _config_dev.yml`. |
| 82 | +7. Visit the pages at: [http://localhost:4000/](http://localhost:4000) |
| 83 | +8. When you make changes, Jekyll should automatically regenerate the application for you. Read the messages in your terminal to check it out. |
42 | 84 |
|
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. |
| 85 | +There are a TON of posts in here, so rendering can take up to thirty minutes! You can *limit* the number of posts that render by [excluding folders](https://jekyllrb.com/docs/configuration/options/) from being served using custom Jekyll configuration options. |
46 | 86 |
|
47 |
| -For example, change `_config_dev.yml` to this: |
| 87 | +To do so, create a `_config_personal.yml` file: |
48 | 88 |
|
49 | 89 | ```yml
|
50 | 90 | staticurl: http://localhost:4000/all_static
|
51 |
| -exclude: [_posts/ggplot2, _posts/julia, _posts/matlab, _posts/matplotlib, _posts/nodejs, _posts/r] # [_posts/python,] |
| 91 | +exclude: [_posts/ggplot2, _posts/julia, _posts/matlab, _posts/matplotlib, _posts/nodejs, _posts/r, posts/python] # [_posts/plotly_js,] |
52 | 92 | ```
|
53 | 93 |
|
54 |
| -and you'll only load the files in `_posts/python`. |
| 94 | +and you'll only load the files in `_posts/plotly_js`. |
55 | 95 |
|
56 |
| -Change it to this |
| 96 | +Change it to this: |
57 | 97 |
|
58 | 98 | ```yml
|
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. |
68 |
| - |
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. |
82 |
| - |
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. |
84 |
| - |
85 |
| -## Search |
86 |
| - |
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. |
88 |
| - |
89 |
| -## Style Edits |
90 |
| - |
91 |
| -Please refer to our [Styles README](https://github.com/plotly/documentation/blob/source-design-merge/style_README.md) |
| 103 | +and it'll load everything. |
0 commit comments