-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add rstcheck to CI #3624
Changes from all commits
04cfc48
607e3e2
c231285
73f0883
eec8189
c1e7950
bb4c86e
49e544b
b0775d3
2ee1311
318d3fa
3c35393
ed91b6d
87e92e5
b1affec
5ed816b
d153df3
6d4a28a
7aafded
f5b6189
5a67cfa
65914a3
8683ab1
ea76877
ffa1179
994be93
eac2029
646c2f8
0e25f29
d6292bc
51f7c7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`_ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change these ones?
from http://www.sphinx-doc.org/es/stable/markup/inline.html#role-ref There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. http://www.sphinx-doc.org/en/stable/markup/inline.html#role-numref looks interesting, via sphinx-doc/sphinx#2963 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:: | ||
|
||
|
@@ -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 | ||
--------------------- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
.. _contributing-to-read-the-docs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
============================= | ||
|
||
|
@@ -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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. :: | ||
|
||
|
@@ -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. :: | ||
|
||
|
@@ -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. :: | ||
|
||
|
@@ -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. :: | ||
|
@@ -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. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`__. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (the same for the other changes in this file) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
links to the "Takedown Process" title (L20 in If you remove the title from the link, like this
where that link will follow you? If you build the docs locally, you will find that link doesn't work. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 (see the link on the bottom) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My mouse is on |
||
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 | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :(
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.