Skip to content

updating developer docs - #8544

Merged
phobson merged 8 commits into
matplotlib:masterfrom
choldgraf:devel_docs
Apr 28, 2017
Merged

phobson merged 8 commits into
matplotlib:masterfrom
choldgraf:devel_docs

Conversation

@choldgraf

Copy link
Copy Markdown
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.

Comment thread doc/devel/documenting_mpl.rst Outdated
.. 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
Copy Markdown
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.)

Comment thread doc/devel/documenting_mpl.rst Outdated

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
Copy Markdown
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 ?

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
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?

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

thx for the comments @story645 , all addressed

Comment thread doc/devel/documenting_mpl.rst Outdated

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
Copy Markdown
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
Copy Markdown
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!

@phobson phobson left a comment

Copy link
Copy Markdown
Member

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.

Comment thread doc/devel/documenting_mpl.rst Outdated
-----------------

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

contain pages

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
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

Comment thread doc/devel/documenting_mpl.rst Outdated

* 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

choldgraf commented Apr 28, 2017 •

Copy link
Copy Markdown
Contributor Author

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

@QuLogic QuLogic left a comment

Copy link
Copy Markdown
Member

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.

Comment thread doc/devel/documenting_mpl.rst Outdated
.. 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
Copy Markdown
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.

Comment thread doc/devel/documenting_mpl.rst Outdated

.. note::

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LaTeX

Comment thread doc/devel/documenting_mpl.rst Outdated
.. 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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Python

Comment thread doc/devel/documenting_mpl.rst Outdated
General structure
-----------------

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

Copy link
Copy Markdown
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.)

Comment thread doc/devel/documenting_mpl.rst Outdated

* ``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
Copy Markdown
Member

Choose a reason for hiding this comment

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

PDF

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sphinx

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sphinx

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sphinx

Comment thread doc/devel/documenting_mpl.rst Outdated
Installing dependencies
-----------------------

The documentation for matplotlib is generated from ReStructured Text using the

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

ok I think @QuLogic comments addressed

@QuLogic QuLogic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor pluralization.

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

directories

Comment thread doc/devel/documenting_mpl.rst Outdated
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

directories

Comment thread doc/devel/documenting_mpl.rst Outdated

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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Comment thread doc/devel/documenting_mpl.rst Outdated

* 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
Copy Markdown
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
Copy Markdown
Member

Apart from inline comment 👍

Comment thread doc/devel/documenting_mpl.rst Outdated
.. 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
Copy Markdown
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
Copy Markdown
Contributor Author

how does that look @jenshnielsen ?

@choldgraf

choldgraf commented Apr 28, 2017 •

Copy link
Copy Markdown
Contributor Author

does that look correct @anntzer ?

@anntzer

anntzer commented Apr 28, 2017

Copy link
Copy Markdown
Contributor

Probably, but you should try building :-)

@jenshnielsen

Copy link
Copy Markdown
Member

great thanks @choldgraf

@choldgraf

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

🍻

@story645

Copy link
Copy Markdown
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
Copy Markdown
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

story645 commented Apr 30, 2017 •

Copy link
Copy Markdown
Member

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