Skip to content

Commit a4edbad

Browse files
committed
Merge branch 'master' into index-with-real-path-name
2 parents 2fcd502 + f7d0dcd commit a4edbad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1069
-255
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
*.whl binary
1414
*.woff binary
1515
*.woff2 binary
16+
*.gif binary

CHANGELOG.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
Version 3.5.2
2+
-------------
3+
4+
This is a quick hotfix to the previous version.
5+
6+
:Date: June 11, 2019
7+
8+
* `@ericholscher <http://github.com/ericholscher>`__: Fix version of our sphinx-ext we're installing (`#5789 <https://github.com/rtfd/readthedocs.org/pull/5789>`__)
9+
* `@stsewd <http://github.com/stsewd>`__: Get version from the api (`#5788 <https://github.com/rtfd/readthedocs.org/pull/5788>`__)
10+
11+
Version 3.5.1
12+
-------------
13+
14+
This version contained a `security fix <https://github.com/rtfd/readthedocs.org/security/advisories/GHSA-2mw9-4c46-qrcv>`_
15+
for an open redirect issue.
16+
The problem has been fixed and deployed on readthedocs.org.
17+
For users who depend on the Read the Docs code line for a private instance of Read the Docs,
18+
you are encouraged to update to 3.5.1 as soon as possible.
19+
20+
:Date: June 11, 2019
21+
22+
* `@stsewd <http://github.com/stsewd>`__: Update build images in docs (`#5782 <https://github.com/rtfd/readthedocs.org/pull/5782>`__)
23+
* `@saadmk11 <http://github.com/saadmk11>`__: Validate dict when parsing the mkdocs.yml file (`#5775 <https://github.com/rtfd/readthedocs.org/pull/5775>`__)
24+
* `@stsewd <http://github.com/stsewd>`__: Pin textclassifier dependencies (`#5773 <https://github.com/rtfd/readthedocs.org/pull/5773>`__)
25+
* `@stsewd <http://github.com/stsewd>`__: Fix tests on master (`#5769 <https://github.com/rtfd/readthedocs.org/pull/5769>`__)
26+
* `@stsewd <http://github.com/stsewd>`__: Don't use implicit relative import (`#5767 <https://github.com/rtfd/readthedocs.org/pull/5767>`__)
27+
* `@stsewd <http://github.com/stsewd>`__: Use version_pk to trigger builds (`#5765 <https://github.com/rtfd/readthedocs.org/pull/5765>`__)
28+
* `@davidfischer <http://github.com/davidfischer>`__: Domain UI improvements (`#5764 <https://github.com/rtfd/readthedocs.org/pull/5764>`__)
29+
* `@ericholscher <http://github.com/ericholscher>`__: Try to fix Elastic connection pooling issues (`#5763 <https://github.com/rtfd/readthedocs.org/pull/5763>`__)
30+
* `@pyup-bot <http://github.com/pyup-bot>`__: pyup: Scheduled weekly dependency update for week 22 (`#5762 <https://github.com/rtfd/readthedocs.org/pull/5762>`__)
31+
* `@ericholscher <http://github.com/ericholscher>`__: Try to fix Elastic connection pooling issues (`#5760 <https://github.com/rtfd/readthedocs.org/pull/5760>`__)
32+
* `@davidfischer <http://github.com/davidfischer>`__: Escape variables in mkdocs data (`#5759 <https://github.com/rtfd/readthedocs.org/pull/5759>`__)
33+
* `@humitos <http://github.com/humitos>`__: Serve 404/index.html file for htmldir Sphinx builder (`#5754 <https://github.com/rtfd/readthedocs.org/pull/5754>`__)
34+
* `@wilvk <http://github.com/wilvk>`__: fix sphinx startup guide to not to fail on rtd build as per #2569 (`#5753 <https://github.com/rtfd/readthedocs.org/pull/5753>`__)
35+
* `@stsewd <http://github.com/stsewd>`__: Fix mkdocs relpath (`#5749 <https://github.com/rtfd/readthedocs.org/pull/5749>`__)
36+
* `@stsewd <http://github.com/stsewd>`__: Call lock per task (`#5748 <https://github.com/rtfd/readthedocs.org/pull/5748>`__)
37+
* `@stsewd <http://github.com/stsewd>`__: Pin kombu to 4.3.0 (`#5747 <https://github.com/rtfd/readthedocs.org/pull/5747>`__)
38+
* `@agjohnson <http://github.com/agjohnson>`__: Clarify latexmk option usage (`#5745 <https://github.com/rtfd/readthedocs.org/pull/5745>`__)
39+
* `@ericholscher <http://github.com/ericholscher>`__: Hotfix latexmx builder to ignore error codes (`#5744 <https://github.com/rtfd/readthedocs.org/pull/5744>`__)
40+
* `@ericholscher <http://github.com/ericholscher>`__: Hide the Code API search in the UX for now. (`#5743 <https://github.com/rtfd/readthedocs.org/pull/5743>`__)
41+
* `@davidfischer <http://github.com/davidfischer>`__: Add init.py under readthedocs/api (`#5742 <https://github.com/rtfd/readthedocs.org/pull/5742>`__)
42+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Fix design docs missing from toctree (`#5741 <https://github.com/rtfd/readthedocs.org/pull/5741>`__)
43+
* `@ericholscher <http://github.com/ericholscher>`__: Release 3.5.0 (`#5740 <https://github.com/rtfd/readthedocs.org/pull/5740>`__)
44+
* `@saadmk11 <http://github.com/saadmk11>`__: Pytest Timezone Warning Fixed (`#5739 <https://github.com/rtfd/readthedocs.org/pull/5739>`__)
45+
* `@humitos <http://github.com/humitos>`__: Filter by projects with no banned users (`#5733 <https://github.com/rtfd/readthedocs.org/pull/5733>`__)
46+
* `@davidfischer <http://github.com/davidfischer>`__: Fix the sidebar ad color (`#5731 <https://github.com/rtfd/readthedocs.org/pull/5731>`__)
47+
* `@saadmk11 <http://github.com/saadmk11>`__: Permanent redirect feature added (`#5727 <https://github.com/rtfd/readthedocs.org/pull/5727>`__)
48+
* `@humitos <http://github.com/humitos>`__: Move version "Clean" button to details page (`#5706 <https://github.com/rtfd/readthedocs.org/pull/5706>`__)
49+
* `@gorshunovr <http://github.com/gorshunovr>`__: Update flags documentation (`#5701 <https://github.com/rtfd/readthedocs.org/pull/5701>`__)
50+
* `@davidfischer <http://github.com/davidfischer>`__: Storage updates (`#5698 <https://github.com/rtfd/readthedocs.org/pull/5698>`__)
51+
* `@stsewd <http://github.com/stsewd>`__: Remove files after build (`#5680 <https://github.com/rtfd/readthedocs.org/pull/5680>`__)
52+
* `@stsewd <http://github.com/stsewd>`__: Move community support to email (`#5651 <https://github.com/rtfd/readthedocs.org/pull/5651>`__)
53+
* `@davidfischer <http://github.com/davidfischer>`__: Optimizations and UX improvements to the dashboard screen (`#5637 <https://github.com/rtfd/readthedocs.org/pull/5637>`__)
54+
* `@chrisjsewell <http://github.com/chrisjsewell>`__: Use `--upgrade` instead of `--force-reinstall` for pip installs (`#5635 <https://github.com/rtfd/readthedocs.org/pull/5635>`__)
55+
* `@stsewd <http://github.com/stsewd>`__: Move file validations out of the config module (`#5627 <https://github.com/rtfd/readthedocs.org/pull/5627>`__)
56+
* `@humitos <http://github.com/humitos>`__: Remove old/deprecated build endpoints (`#5479 <https://github.com/rtfd/readthedocs.org/pull/5479>`__)
57+
* `@shivanshu1234 <http://github.com/shivanshu1234>`__: Add link to in-progress build from dashboard. (`#5431 <https://github.com/rtfd/readthedocs.org/pull/5431>`__)
58+
* `@stsewd <http://github.com/stsewd>`__: Downgrade pytest-django (`#5294 <https://github.com/rtfd/readthedocs.org/pull/5294>`__)
59+
160
Version 3.5.0
261
-------------
362

contrib/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARG label
2+
3+
FROM readthedocs/build:${label}
4+
5+
ARG uid
6+
ARG gid
7+
8+
ENV UID ${uid}
9+
ENV GID ${gid}
10+
11+
USER root
12+
RUN groupmod --gid ${GID} docs
13+
RUN usermod --uid ${UID} --gid ${GID} docs
14+
USER docs
15+
16+
CMD ["/bin/bash"]

contrib/docker_build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
uid=`id -u`
4+
gid=`id -g`
5+
basedir=`dirname "$0"`
6+
dockerfile=${basedir}/Dockerfile
7+
8+
version=$1
9+
[ -n "${version}" ] || version="latest"
10+
11+
docker build \
12+
--no-cache \
13+
-t readthedocs/build-dev:${version} \
14+
--build-arg uid=${uid} \
15+
--build-arg gid=${gid} \
16+
--build-arg label=${version} \
17+
- <${dockerfile}

contrib/readme.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
Contrib
2+
=======
3+
4+
Building development Docker image
5+
---------------------------------
6+
7+
If you run Linux, you likely need to build a local Docker image that extends our
8+
default image::
9+
10+
contrib/docker_build.sh latest
11+
112
Running Read the Docs via Supervisord
2-
=====================================
13+
-------------------------------------
314

415
This is the easiest way to start all of the commands you'll need for development
516
in an environment relatively close to the production evironment. All you need is
Loading

docs/config-file/v2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ The Docker image used for building the docs.
260260
Each image support different Python versions and has different packages installed,
261261
as defined here:
262262

263-
* `stable <https://github.com/rtfd/readthedocs-docker-images/tree/releases/3.x>`_: :buildpyversions:`3.0`
264-
* `latest <https://github.com/rtfd/readthedocs-docker-images/tree/releases/4.x>`_: :buildpyversions:`4.0`
263+
* `stable <https://github.com/rtfd/readthedocs-docker-images/tree/releases/4.x>`_: :buildpyversions:`stable`
264+
* `latest <https://github.com/rtfd/readthedocs-docker-images/tree/releases/5.x>`_: :buildpyversions:`latest`
265265

266266
sphinx
267267
~~~~~~

docs/design/in-doc-search-ui.rst

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
In Doc Search UI
2+
================
3+
4+
Giving readers the ability to easily search the information
5+
that they are looking for is important for us.
6+
We have already upgraded to the latest version of `Elasticsearch`_ and
7+
we plan to implement `search as you type` feature for all the documentations hosted by us.
8+
It will be designed to provide instant results as soon as the user starts
9+
typing in the search bar with a clean and minimal frontend.
10+
This design document aims to provides the details of it.
11+
This is a GSoC'19 project.
12+
13+
.. warning::
14+
15+
This design document details future features that are **not yet implemented**.
16+
To discuss this document, please get in touch in the `issue tracker`_.
17+
18+
19+
The final result may look something like this:
20+
21+
.. figure:: ../_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
22+
:align: center
23+
:target: ../_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
24+
25+
Short demo
26+
27+
28+
Goals And Non-Goals
29+
-------------------
30+
31+
Project Goals
32+
++++++++++++++
33+
34+
* Support a search-as-you-type/autocomplete interface.
35+
* Support across all (or virtually all) Sphinx themes.
36+
* Support for the JavaScript user experience down to IE11 or graceful degradation where we can't support it.
37+
* Project maintainers should have a way to opt-in/opt-out of this feature.
38+
* (Optional) Project maintainers should have the flexibility to change some of the styles using custom CSS and JS files.
39+
40+
Non-Goals
41+
++++++++++
42+
43+
* For the initial release, we are targeting only Sphinx documentations
44+
as we don't index MkDocs documentations to our Elasticsearch index.
45+
46+
47+
Existing Search Implementation
48+
------------------------------
49+
50+
We have a detailed documentation explaing the underlying architecture of our search backend
51+
and how we index documents to our Elasticsearch index.
52+
You can read about it :doc:`here <../development/search>`.
53+
54+
55+
Proposed Architecture for In-Doc Search UI
56+
------------------------------------------
57+
58+
Frontend
59+
++++++++
60+
61+
Technologies
62+
~~~~~~~~~~~~
63+
64+
Frontend is to designed in a theme agnostics way. For that,
65+
we explored various libraries which may be of use but none of them fits our needs.
66+
So, we might be using vanilla JavaScript for this purpose.
67+
This will provide us some advantages over using any third party library:
68+
69+
* Better control over the DOM.
70+
* Performance benefits.
71+
72+
73+
Proposed Architecture
74+
~~~~~~~~~~~~~~~~~~~~~
75+
76+
We plan to select the search bar, which is present in every theme,
77+
and use the `querySelector()`_ method of JavaScript.
78+
Then add an event listener to it to listen for the changes and
79+
fire a search query to our backend as soon as there is any change.
80+
Our backend will then return the suggestions,
81+
which will be shown to the user in a clean and minimal UI.
82+
We will be using `document.createElement()`_ and `node.removeChild()`_ method
83+
provided by JavaScript as we don't want empty `<div>` hanging out in the DOM.
84+
85+
We have a few ways to include the required JavaScript and CSS files in all the projects:
86+
87+
* Add CSS into `readthedocs-doc-embed.css` and JS into `readthedocs-doc-embed.js`
88+
and it will get included.
89+
* Package the in-doc search into it's own self-contained CSS and JS files
90+
and include them in a similar manner to `readthedocs-doc-embed.*`.
91+
* It might be possible to package up the in-doc CSS/JS as a sphinx extension.
92+
This might be nice because then it's easy to enable it on a per-project basis.
93+
When we are ready to roll it out to a wider audience,
94+
we can make a decision to just turn it on for everybody (put it in `here`_)
95+
or we could enable it as an opt-in feature like the `404 extension`_.
96+
97+
98+
UI/UX
99+
~~~~~
100+
101+
We have two ways which can be used to show suggestions to the user.
102+
103+
* Show suggestions below the search bar.
104+
* Open a full page search interface when the user click on search field.
105+
106+
107+
Backend
108+
+++++++
109+
110+
We have a few options to support `search as you type` feature,
111+
but we need to decide that which option would be best for our use-case.
112+
113+
Edge NGram Tokenizer
114+
~~~~~~~~~~~~~~~~~~~~
115+
116+
* Pros
117+
118+
* More effective than Completion Suggester when it comes to autocompleting
119+
words that can appear in any order.
120+
* It is considerable fast because most of the work is being done at index time,
121+
hence the time taken for autocompletion is reduced.
122+
* Supports highlighting of the matching terms.
123+
124+
* Cons
125+
126+
* Requires greater disk space.
127+
128+
129+
Completion Suggester
130+
~~~~~~~~~~~~~~~~~~~~
131+
132+
* Pros
133+
134+
* Really fast as it is optimized for speed.
135+
* Does not require large disk space.
136+
137+
* Cons
138+
139+
* Matching always starts at the beginning of the text. So, for example,
140+
"Hel" will match "Hello, World" but not "World Hello".
141+
* Highlighting of the matching words is not supported.
142+
* According to the official docs for Completion Suggester,
143+
fast lookups are costly to build and are stored in-memory.
144+
145+
146+
Milestones
147+
----------
148+
149+
+-----------------------------------------------------------------------------------+------------------+
150+
| Milestone | Due Date |
151+
+===================================================================================+==================+
152+
| A local implementation of the project. | 12th June, 2019 |
153+
+-----------------------------------------------------------------------------------+------------------+
154+
| In-doc search on a test project hosted on Read the Docs using the RTD Search API. | 20th June, 2019 |
155+
+-----------------------------------------------------------------------------------+------------------+
156+
| In-doc search on docs.readthedocs.io. | 20th June, 2019 |
157+
+-----------------------------------------------------------------------------------+------------------+
158+
| Friendly user trial where users can add this on their own docs. | 5th July, 2019 |
159+
+-----------------------------------------------------------------------------------+------------------+
160+
| Additional UX testing on the top-10 Sphinx themes. | 15th July, 2019 |
161+
+-----------------------------------------------------------------------------------+------------------+
162+
| Finalize the UI. | 25th July, 2019 |
163+
+-----------------------------------------------------------------------------------+------------------+
164+
| Improve the search backend for efficient and fast search results. | 10th August, 2019|
165+
+-----------------------------------------------------------------------------------+------------------+
166+
167+
168+
Open Questions
169+
++++++++++++++
170+
171+
* Should we rely on jQuery, any third party library or pure vanilla JavaScript?
172+
* Are the subprojects to be searched?
173+
* Is our existing Search API is sufficient?
174+
* Should we go for edge ngrams or completion suggester?
175+
176+
177+
.. _issue tracker: https://github.com/rtfd/readthedocs.org/issues
178+
.. _Elasticsearch: https://www.elastic.co/products/elasticsearch
179+
.. _querySelector(): https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
180+
.. _document.createElement(): https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
181+
.. _node.removeChild(): https://developer.mozilla.org/en-US/docs/Web/API/Node/removeChild
182+
.. _here: https://github.com/rtfd/readthedocs.org/blob/9ca5858e859dea0759d913e8db70a623d62d6a16/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl#L135-L142
183+
.. _404 extension : https://github.com/rtfd/sphinx-notfound-page

0 commit comments

Comments
 (0)