Skip to content
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

Add rstcheck to CI #3624

Merged
merged 31 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
04cfc48
Add rstcheck dependency
stsewd Feb 16, 2018
607e3e2
Add rstcheck to tox dosc environment
stsewd Feb 16, 2018
c231285
Expand find command on tox
stsewd Feb 16, 2018
73f0883
Add rstcheck config file
stsewd Feb 16, 2018
eec8189
Move to separate env
stsewd Feb 21, 2018
c1e7950
Include new env to travis
stsewd Feb 21, 2018
bb4c86e
Add new requirements file
stsewd Feb 21, 2018
49e544b
Use new requirements file
stsewd Feb 21, 2018
b0775d3
Dependencies
stsewd Feb 21, 2018
2ee1311
Lint docs with python 3.6
stsewd Feb 21, 2018
318d3fa
Check files with recursive option
stsewd Feb 24, 2018
3c35393
Ignore false positive error
stsewd Mar 17, 2018
ed91b6d
Remove unused global ref
stsewd Mar 17, 2018
87e92e5
Remove unused links
stsewd Mar 17, 2018
b1affec
Remove unused link
stsewd Mar 17, 2018
5ed816b
Change links to rst
stsewd Mar 17, 2018
d153df3
Remove unused link
stsewd Mar 17, 2018
6d4a28a
Remove unused links
stsewd Mar 17, 2018
7aafded
Fix internal links
stsewd Mar 17, 2018
f5b6189
Fix internal links
stsewd Mar 17, 2018
5a67cfa
Remove unused links
stsewd Mar 17, 2018
65914a3
Remove unused link
stsewd Mar 17, 2018
8683ab1
Fix internal links
stsewd Mar 17, 2018
ea76877
Fix internal link
stsewd Mar 17, 2018
ffa1179
Ignore false positives
stsewd Mar 17, 2018
994be93
Fix lists
stsewd Mar 17, 2018
eac2029
Use doc directive
stsewd Mar 19, 2018
646c2f8
Fix reference
stsewd Mar 23, 2018
0e25f29
Fix python dictionary on docs
stsewd Apr 11, 2018
d6292bc
Add description to tox env
stsewd May 23, 2018
51f7c7c
Remove trailing comma
stsewd May 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ matrix:
include:
- python: 2.7
env: TOXENV=docs
- python: 3.6
env: TOXENV=docs-lint
- python: 2.7
env: TOXENV=lint
- python: 2.7
Expand Down
4 changes: 4 additions & 0 deletions docs/.rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[rstcheck]
ignore_directives=automodule,http:get
ignore_roles=djangosetting,setting
ignore_messages=(Duplicate implicit target name: ".*")|(Hyperlink target ".*" is not referenced)
Copy link
Member Author

Choose a reason for hiding this comment

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

Those errors are from some hyperlinks that are referenced globally. The duplicates are really false positives.

Copy link
Member

Choose a reason for hiding this comment

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

By ignoring this now that are false positivies, we won't detect the ones that are true when we updated the docs :(

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I going to try to solve others and see if I can get a better regex here

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a better way to expose global hiperlinks? Maybe something like this https://stackoverflow.com/a/19543591/5689214? And for the duplicates target name the most are from subheaders with the same name.

Copy link
Member

Choose a reason for hiding this comment

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

Why not use the :ref: directive for linking across files?

http://www.sphinx-doc.org/es/stable/markup/inline.html#role-ref

Copy link
Member Author

@stsewd stsewd Mar 23, 2018

Choose a reason for hiding this comment

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

rstcheck doesn't search for global refs and are marked as unused. But using ref is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

And also I change others place to use the doc directive https://docs.readthedocs.io/en/latest/docs.html#content.

4 changes: 1 addition & 3 deletions docs/automatic-redirects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Supported Top-Level Redirects
.. note:: These "implicit" redirects are supported for legacy reasons.
We will not be adding support for any more magic redirects.
If you want additional redirects,
they should live at a prefix like :ref:`page-redirect`
they should live at a prefix like `Redirecting to a Page`_
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change these ones?

Using ref is advised over standard reStructuredText links to sections (like Section title_) because it works across files, when section headings are changed, and for all builders that support cross-references.

from http://www.sphinx-doc.org/es/stable/markup/inline.html#role-ref

Copy link
Member Author

Choose a reason for hiding this comment

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

mmm, well I don't like the idea of exposing a lot of links as global refs and more when they aren't used on the global scope, but I will revert those if you consider.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can make a Sphinx extension that automatically ads each section heading as a global ref, prefixed by pagename or similar? That way you wouldn't need to declare all the refs, but still be able to reference them. That's definitely for another ticket/PR though.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, looks like those are still for explicit section refs, not implicitly creating them, ignore me :)

Copy link
Member

Choose a reason for hiding this comment

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

Found it: http://www.sphinx-doc.org/en/stable/ext/autosectionlabel.html -- it's already built into Sphinx :)

Copy link
Member

Choose a reason for hiding this comment

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

Like it!


The main challenge of URL routing in Read the Docs is handling redirects correctly. Both in the interest of redirecting older URLs that are now obsolete, and in the interest of handling "logical-looking" URLs (leaving out the lang_slug or version_slug shouldn't result in a 404), the following redirects are supported::

Expand All @@ -44,8 +44,6 @@ The main challenge of URL routing in Read the Docs is handling redirects correct
The language redirect will work for any of the defined ``LANGUAGE_CODES`` we support.
The version redirect will work for supported versions.

.. _page-redirect:

Redirecting to a Page
---------------------

Expand Down
7 changes: 5 additions & 2 deletions docs/business/index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Read the Docs Business Features
-------------------------------

.. note:: These features are for our new business offering, `readthedocs.com <https://readthedocs.com/>`_.
.. note:: These features are for our new business offering, `readthedocs.com`_.


All of the other features outlined in these docs work on both sites.
Things inside this section are specific to our business offering.

The largest feature that is different is that documentation on `readthedocs.com <https://readthedocs.com/>`_ is **private**.
The largest feature that is different is that documentation on `readthedocs.com`_ is **private**.
If you have private code that you want documentation for,
this is our solution.

.. _readthedocs.com: https://readthedocs.com

.. toctree::

organizations
Expand Down
2 changes: 0 additions & 2 deletions docs/canonical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
This is a good explanation for why canonical pages are good for SEO:

http://moz.com/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps

.. _dashboard: https://readthedocs.org/dashboard/
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code Notes
- Updated django-celery from `3.0.23` to `3.1.26` as django-celery 3.0.x does not support Django 1.8.
- Updated Celery from `3.0.24` to `3.1.18` because we had to update django-celery. We need to test this extensively and might need to think about using the new Celery API directly and dropping django-celery. See release notes: http://docs.celeryproject.org/en/latest/whatsnew-3.1.html
- Updated tastypie from `0.11.1` to current master (commit `1e1aff3dd4dcd21669e9c68bd7681253b286b856`) as 0.11.x is not compatible with Django 1.8. No surprises expected but we should ask for a proper release, see release notes: https://github.com/django-tastypie/django-tastypie/blob/master/docs/release_notes/v0.12.0.rst
- Updated django-oauth from `0.16.1` to `0.21.0`. No surprises expected, see release notes [in the docs](https://django-allauth.readthedocs.org/en/latest/changelog.html) and [finer grained in the repo](https://github.com/pennersr/django-allauth/blob/9123223f167959e4e5c4074408db068f725559d1/ChangeLog#L1-169)
- Updated django-oauth from `0.16.1` to `0.21.0`. No surprises expected, see release notes `in the docs <https://django-allauth.readthedocs.org/en/latest/changelog.html>`_ and `finer grained in the repo <https://github.com/pennersr/django-allauth/blob/9123223f167959e4e5c4074408db068f725559d1/ChangeLog#L1-169>`_
- Updated django-guardian from `1.2.0` to `1.3.0` to gain Django 1.8 support. No surprises expected, see release notes: https://github.com/lukaszb/django-guardian/blob/devel/CHANGES
- Using `django-formtools` instead of removed `django.contrib.formtools` now. Based on the Django release notes, these modules are the same except of the package name.
- Updated pytest-django from `2.6.2` to `2.8.0`. No tests required, but running the testsuite :smile:
Expand Down
3 changes: 0 additions & 3 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _contributing-to-read-the-docs:
Copy link
Member

Choose a reason for hiding this comment

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

Be careful when removing these ones. This one in particular, is used at https://github.com/rtfd/readthedocs.org/pull/3624/files#diff-c7f13470cacdf0634e185d4313d02a12R55 (L57 in design.rst) so that link is probably dead after removing this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ups, I just missed that one. I usually do a grep to search those references.


Contributing to Read the Docs
=============================

Expand All @@ -10,7 +8,6 @@ get stuck at any point you can create a `ticket on GitHub`_.
All members of our community are expected to follow our :doc:`/code-of-conduct`.
Please make sure you are welcoming and friendly in all of our spaces.

.. _#readthedocs: irc://irc.freenode.net/readthedocs
.. _ticket on GitHub: https://github.com/rtfd/readthedocs.org/issues

Contributing to development
Expand Down
21 changes: 10 additions & 11 deletions docs/custom_installs/local_rtd_vm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Assumptions and Prerequisites
Local RTD Setup
---------------

1. Install RTD.
~~~~~~~~~~~~~~~
Install RTD
~~~~~~~~~~~

To host your documentation on a local RTD installation, set it up in your VM. ::

Expand Down Expand Up @@ -60,8 +60,8 @@ Also don't forget to re-run the dependency installation ::

$ sudo pip install -r requirements.txt

2. Configure the RTD Server and Superuser.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Configure the RTD Server and Superuser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Run the following commands. ::

Expand All @@ -74,8 +74,8 @@ Also don't forget to re-run the dependency installation ::
Email address: [email protected]
Password: pa$$word

3. RTD Server Administration.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RTD Server Administration
~~~~~~~~~~~~~~~~~~~~~~~~~

Navigate to the ``../checkouts/readthedocs.org`` folder in your VM and run the following command. ::

Expand All @@ -86,9 +86,8 @@ You should now be able to log into the admin interface from any PC in your LAN a

Go to the dashboard at ``http://[VM IP ADDRESS]:8000/dashboard`` and follow these steps:

1. Point the repository to your corporate Git project where the documentation source is checked in. Example:
git.corp.company.com:/git/docs/documentation.git

1. Point the repository to your corporate Git project where the documentation source is checked in.
Example: ``git.corp.company.com:/git/docs/documentation.git``.
2. Clone the documentation sources from Git in the VM.
3. Navigate to the root path for documentation.
4. Run the following Sphinx commands. ::
Expand Down Expand Up @@ -127,8 +126,8 @@ SSH to the VM using the ``-A`` directive. ::

This provides all permissions for that particular remote session, which are revoked when you logout.

4. Build Documentation on Local RTD Instance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build Documentation on Local RTD Instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Log into ``http://[VM IP ADDRESS]:[PORT]`` using the django superuser creds and follow these steps.

Expand Down
8 changes: 1 addition & 7 deletions docs/design.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _designing-read-the-docs:

Designing Read the Docs
=======================

Expand Down Expand Up @@ -44,7 +42,7 @@ your example project.
Contributing
------------

Contributions should follow the :ref:`contributing-to-read-the-docs` guidelines where applicable -- ideally you'll
Contributions should follow the :doc:`contribute` guidelines where applicable -- ideally you'll
create a pull request against the `Read the Docs GitHub project`_ from your forked repo and include
a brief description of what you added / removed / changed, as well as an attached image (you can just
take a screenshot and drop it into the PR creation form) of the effects of your changes.
Expand All @@ -54,7 +52,3 @@ browsers, IE8+ -- that's not to say it needs to be pixel-perfect in older browse
making changes that render older browsers utterly unusable (or provide a sane fallback).

.. _Read the Docs GitHub project: https://github.com/rtfd/readthedocs.org/pulls




138 changes: 70 additions & 68 deletions docs/design/theme-context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,74 +25,76 @@ Note that this dictionary is injected under the main key `readthedocs`:

.. code:: python

'readthedocs': {
'v1': {
'version': {
'id': int,
'slug': str,
'verbose_name': str,
'identifier': str,
'type': str,
'build_date': str,
'downloads': {
'pdf: str,
'htmlzip': str,
'epub': str
},
'links': [{
'href': 'https://readthedocs.org/api/v2/version/{id}/',
'rel': 'self
}]
},
'project': {
'id': int
'name': str,
'slug': str,
'description': str,
'language': str,
'canonical_url': str,
'subprojects': [{
'id': int
'name': str,
'slug': str,
'description': str,
'language': str,
'canonical_url': str,
'links': [{
'href': 'https://readthedocs.org/api/v2/project/{id}/',
'rel': 'self
}]
}],
'links': [{
'href': 'https://readthedocs.org/api/v2/project/{id}/',
'rel': 'self
}]
},
'sphinx': {
'html_theme': str,
'source_suffix': str
},
'analytics': {
'user_analytics_code': str,
'global_analytics_code': str
},
'vcs': {
'type': str, # 'bitbucket', 'github', 'gitlab' or 'svn'
'user': str,
'repo': str,
'commit': str,
'version': str,
'display': bool,
'conf_py_path': str
},
'meta': {
'API_HOST': str,
'MEDIA_URL': str,
'PRODUCTION_DOMAIN': str,
'READTHEDOCS': True
}
}
}
{
'readthedocs': {
'v1': {
'version': {
'id': int,
'slug': str,
'verbose_name': str,
'identifier': str,
'type': str,
'build_date': str,
'downloads': {
'pdf': str,
'htmlzip': str,
'epub': str
},
'links': [{
'href': 'https://readthedocs.org/api/v2/version/{id}/',
'rel': 'self'
}],
},
'project': {
'id': int,
'name': str,
'slug': str,
'description': str,
'language': str,
'canonical_url': str,
'subprojects': [{
'id': int,
'name': str,
'slug': str,
'description': str,
'language': str,
'canonical_url': str,
'links': [{
'href': 'https://readthedocs.org/api/v2/project/{id}/',
'rel': 'self'
}]
}],
'links': [{
'href': 'https://readthedocs.org/api/v2/project/{id}/',
'rel': 'self'
}]
},
'sphinx': {
'html_theme': str,
'source_suffix': str
},
'analytics': {
'user_analytics_code': str,
'global_analytics_code': str
},
'vcs': {
'type': str, # 'bitbucket', 'github', 'gitlab' or 'svn'
'user': str,
'repo': str,
'commit': str,
'version': str,
'display': bool,
'conf_py_path': str
},
'meta': {
'API_HOST': str,
'MEDIA_URL': str,
'PRODUCTION_DOMAIN': str,
'READTHEDOCS': True
}
}
}
}


.. warning::
Expand Down
20 changes: 13 additions & 7 deletions docs/dmca/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,36 @@ DMCA Takedown Policy
These are the guidelines that Read the Docs follows when handling DMCA takedown
requests and takedown counter requests. If you are a copyright holder wishing to
submit a takedown request, or an author that has been notified of a takedown
request, please familiarize yourself with `our process <Takedown Process_>`_.
request, please familiarize yourself with `our process`__.
Copy link
Member

Choose a reason for hiding this comment

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

Why we don't leave the extended name here? Isn't it clearer to understand where this will go?

Copy link
Member

Choose a reason for hiding this comment

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

(the same for the other changes in this file)

Copy link
Member Author

Choose a reason for hiding this comment

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

rstcheck didn't recognize those and marked it as errors. And I didn't find that syntax on the quickref http://docutils.sourceforge.net/docs/user/rst/quickref.html#internal-hyperlink-targets.

Copy link
Member

Choose a reason for hiding this comment

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

`our process <Takedown Process_>`_

links to the "Takedown Process" title (L20 in dcma/index.rst)

If you remove the title from the link, like this

`our process`__

where that link will follow you? If you build the docs locally, you will find that link doesn't work.

Copy link
Member Author

Choose a reason for hiding this comment

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

The link is referenced just below https://github.com/rtfd/readthedocs.org/pull/3624/files#diff-1df69b2724a0d4a6195621dcef6dec3cR11

I see the link just fine on my browser

docsdmca

(see the link on the bottom)

Copy link
Member Author

Choose a reason for hiding this comment

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

My mouse is on our process but it doesn't appear on the screeenshot 😁

You will be asked to confirm that you have reviewed information if you submit a
request or counter request.

__ `Takedown Process`_

We aim to keep this entire process as transparent as possible. Our process is
modeled after `GitHub's DMCA takedown process <github-dmca_>`_, which we
modeled after `GitHub's DMCA takedown process`__, which we
appreciate for its focus on transparency and fairness. All requests and counter
requests will be posted to this page below, in the `Request Archive`_. These
requests will be redacted to remove all identifying information, except for Read
the Docs user and project names.

.. _github-dmca: https://help.github.com/articles/dmca-takedown-policy/
__ https://help.github.com/articles/dmca-takedown-policy/

Takedown Process
----------------

Here are the steps the Read the Docs will follow in the takedown request process:

Copyright holder submits a request
This request, if valid, will be posted publicly on this page, `down below
<Request Archive_>`_. The author affected by the takedown request will be
This request, if valid, will be posted publicly on this page, `down below`__.
The author affected by the takedown request will be
notified with a link to the takedown request.

For more information on submitting a takedown request, see: `Submitting a
Request`_

__ `Request Archive`_

Author is contacted
The author of the content in question will be asked to make changes to the
content specified in the takedown request. The author will have 24 hours to
Expand Down Expand Up @@ -61,13 +65,15 @@ Author submits a counter request
If the author believes their content was disabled as a result of a mistake,
a counter request may be submitted. It would be advised that authors seek
legal council before continuing. If the submitted counter request is
sufficiently detailed, this counter will also be added to `this page
<Request Archive_>`_. The copyright holder will be notified, with a link to
sufficiently detailed, this counter will also be added to `this page`__.
The copyright holder will be notified, with a link to
this counter request.

For more information on submitting a counter request, see: `Submitting a
Counter`_

__ `Request Archive`_

Copyright holder may file legal action
At this point, if the copyright holder wishes to keep the offending content
disabled, the copyright holder must file for legal action ordering the
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ RTD doesn't have explicit support for this. That said, a tool like `Disqus`_ (an
How do I support multiple languages of documentation?
-----------------------------------------------------

See the section on :ref:`Localization of Documentation`.
See the section on :doc:`localization`.

Does Read The Docs work well with "legible" docstrings?
-------------------------------------------------------
Expand Down
8 changes: 2 additions & 6 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ Write Your Docs

You have two options for formatting your documentation:

* :ref:`in-rst`
* :ref:`in-markdown`

.. _in-rst:
* `In reStructuredText`_
* `In Markdown`_

In reStructuredText
~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -53,8 +51,6 @@ or `this template`_ if you need help). Build them to see how they look::
Edit your files and rebuild until you like what you see, then commit your changes and push to your public repository.
Once you have Sphinx documentation in a public repository, you can start using Read the Docs.

.. _in-markdown:

In Markdown
~~~~~~~~~~~

Expand Down
Loading