Skip to content

updating developer docs #8544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 28, 2017
Merged

updating developer docs #8544

merged 8 commits into from
Apr 28, 2017

Conversation

choldgraf
Copy link
Contributor

small change to add some extra useful information for the documentation to help contribute to the docs. We've had a hard time on-boarding new people to help with docs in matplotlib, so hopefully this will help clear up some issues.

.. note::

* You'll need a minimal working latex distribution for many examples to run.
* Graphviz is not pip-installable so you need to install this on your own.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

externel link to Graphviz? (Graphviz is not a python package, so it needs to be installed separately.)


All documentation is built from the :file:`doc/` directory. This folder contains both
``.rst`` files that contains pages in the documentation, folders that contain more
``.rst`` files, and configuration for Sphinx.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing some word here. configuration files ?

An exception to this are the folders :file:`gallery` and :file:`tutorials`, which
exist in the root folder. These contain python files that are built by ``sphinx-gallery``.
When the docs are built, folders of the same name will be generated inside of :file:`docs/`.
These can be safely deleted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which docs, the ones in docs or the ones in gallery?

There are many other flags you can pass to ``make.py``, and you can see the
full list inside that file. Here are two useful ones:

* ``clean`` will delete the built sphinx files. Call if you're getting strange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call who?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe - I meant "call make.py with this input", will fix

@choldgraf
Copy link
Contributor Author

thx for the comments @story645 , all addressed


The output produced by Sphinx can be configured by editing the :file:`conf.py`
file located in the :file:`doc/`.
* ``--allowsphinxwarnings`` will allow the docs to continue building even if sphinx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed this information! thanks for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg my life changed when I found out about this. Instead of re-running for each warning, one at a time, you can just see the output of all the warnings, change them all in one swoop, and then re-build when you want to!

Copy link
Member

@phobson phobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll merge pending CI success.

-----------------

All documentation is built from the :file:`doc/` directory. This folder contains both
``.rst`` files that contains pages in the documentation, folders that contain more
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contain pages

When the docs are built, folders of the same name will be generated inside of :file:`docs/`.
The generated folders :file:`docs/gallery` and :file:`docs/tutorials` can be safely deleted.

The configuration file for Sphinx is in :file:`doc/conf.py`. It controls which folders
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is :file:doc/conf.py


* You'll need a minimal working latex distribution for many examples to run.
* `Graphviz <http://graphviz.readthedocs.io/en/latest/manual.html>`_ is not pip-installable so you need
to install this on your own. This is straightforward with something like
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the conda reference is helpful here 'cause it's not really contextualized.

you can also pass a ``latex`` flag to make.py to build a pdf, or pass no
arguments to build everything.
There are many other flags you can pass to ``make.py``, and you can see the
full list inside that file. Here are two useful ones:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or run ./make.py --help? (maybe?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this in the flags section

@choldgraf
Copy link
Contributor Author

choldgraf commented Apr 28, 2017

another round of changes made - very helpful @story645 , thanks!

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization is minor, but the link is the major thing.

.. note::

* You'll need a minimal working latex distribution for many examples to run.
* `Graphviz <http://graphviz.readthedocs.io/en/latest/manual.html>`_ is not pip-installable so you need
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link is not to the right graphviz. It is here.

@@ -19,6 +24,31 @@ The requirements are as follows (https://github.com/matplotlib/matplotlib/blob/m
6. pillow
7. graphviz

.. note::

* You'll need a minimal working latex distribution for many examples to run.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LaTeX

.. note::

An exception to this are the folders :file:`gallery` and :file:`tutorials`, which
exist in the root folder. These contain python files that are built by ``sphinx-gallery``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python

General structure
-----------------

All documentation is built from the :file:`doc/` directory. This folder contains both
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One case of "directory" and many of "folder"; I think we should be consistent about it (preferring directory, myself.)


* ``clean`` will delete the built sphinx files. Use this command if you're getting strange
errors about missing paths or broken links, particularly if you move files around.
* ``latex`` builds a pdf of the documentation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PDF

The generated folders :file:`docs/gallery` and :file:`docs/tutorials` can be safely deleted.

The configuration file for Sphinx is :file:`doc/conf.py`. It controls which folders
sphinx parses, how the docs are built, and how the extensions are used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx

There are many other flags you can pass to ``make.py``, and you can see the
full list inside that file. Here are two useful ones:

* ``clean`` will delete the built sphinx files. Use this command if you're getting strange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx

The output produced by Sphinx can be configured by editing the :file:`conf.py`
file located in the :file:`doc/`.
* ``--help`` will (among other things) display the allowed commands for ``make.py``.
* ``--allowsphinxwarnings`` will allow the docs to continue building even if sphinx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx

@@ -7,9 +7,14 @@ Developer's tips for documenting matplotlib
Getting started
===============

Installing dependencies
-----------------------

The documentation for matplotlib is generated from ReStructured Text using the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually (the rather oddly capitalized) reStructuredText.

@choldgraf
Copy link
Contributor Author

ok I think @QuLogic comments addressed

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor pluralization.

The generated folders :file:`docs/gallery` and :file:`docs/tutorials` can be safely deleted.
An exception to this are the directories :file:`gallery` and :file:`tutorials`, which
exist in the root directory. These contain Python files that are built by ``sphinx-gallery``.
When the docs are built, directory of the same name will be generated inside of :file:`docs/`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directories

All documentation is built from the :file:`doc/` directory. This folder contains both
``.rst`` files that contain pages in the documentation, folders that contain more
All documentation is built from the :file:`doc/` directory. This directory contains both
``.rst`` files that contain pages in the documentation, directory that contain more
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directories


The configuration file for Sphinx is :file:`doc/conf.py`. It controls which folders
sphinx parses, how the docs are built, and how the extensions are used.
The configuration file for Sphinx is :file:`doc/conf.py`. It controls which directory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directories

@choldgraf
Copy link
Contributor Author

ugh, that's what I get for ctrl+f ing the world "folder". good catch


* You'll need a minimal working LaTeX distribution for many examples to run.
* `Graphviz <http://www.graphviz.org/Download.php>`_ is not pip-installable so you need
to install this on your own.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this sounds like Graphviz is a python package which just happens to be non pip installable. I think it could be made more clear that it is a completely separate binary and not a python package.

@jenshnielsen
Copy link
Member

Apart from inline comment 👍

.. note::

An exception to this are the directories :file:`gallery` and :file:`tutorials`, which
exist in the root directory. These contain Python files that are built by ``sphinx-gallery``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s-g should be be a link instead of double-quoted, similarly to Sphinx_ (note the underscore) at the top. The link targets are listed a bit in the middle of nowhere (just before the Figure section), may be worth moving them to the top or the bottom or the file (or just use inline link format like for graphviz above).

@choldgraf
Copy link
Contributor Author

how does that look @jenshnielsen ?

@choldgraf
Copy link
Contributor Author

choldgraf commented Apr 28, 2017

does that look correct @anntzer ?

@anntzer
Copy link
Contributor

anntzer commented Apr 28, 2017

Probably, but you should try building :-)

@jenshnielsen
Copy link
Member

great thanks @choldgraf

@choldgraf
Copy link
Contributor Author

@anntzer good call - it wasn't quite right but the latest push builds correctly :)

@phobson phobson merged commit e69bdaa into matplotlib:master Apr 28, 2017
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Apr 28, 2017
@choldgraf
Copy link
Contributor Author

🍻

@story645
Copy link
Member

I now want to undo one of my statements 'cause now I get why you made that comment about anaconda. Though I'd then say, "can be installed with conda conda install -c conda-forge graphviz

@choldgraf
Copy link
Contributor Author

yeah - I like things to be as actionable / straightforward as possible for users/devs, though I think most folks will be able to figure it out w/o this language in there. I could go either way

@story645
Copy link
Member

story645 commented Apr 30, 2017

I'm tempted to do something like, if you're using conda, you can install the following requirements as follows:

conda install sphinx numpydoc ipython mock pillow -y
conda install -c conda-forge graphviz -y

Ugh, really hate that there's a mix of pip and conda here. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants