Opened 16 years ago
Closed 16 years ago
#8723 closed (fixed)
Search facility for the new documentation site
Reported by: | Fraser Nevett | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The new documentation site (in preview at http://docs.djangoproject.com/) is currently lacking a search facility.
I have created a patch and will attach it shortly.
Attachments (4)
Change History (7)
by , 16 years ago
Attachment: | search.diff added |
---|
by , 16 years ago
Attachment: | search.patch added |
---|
by , 16 years ago
Attachment: | annotations.xml added |
---|
by , 16 years ago
Attachment: | context.xml added |
---|
follow-up: 2 comment:1 by , 16 years ago
Attached is a patch that adds an embedded Google Custom Search Engine (CSE). Unfortunately Trac doesn't seem to be showing the patch correctly -- please let me know if I need to generate the patch differently to get this to work.
The patch also includes fixes for a couple of issues I noticed in the djangodocs
app, specifically:
- The regex for the
document
view was preventing theimages
andsource
patterns from ever matching, so I reorderd these. This means the images now show up in the docs (though eventually these should probably be served statically outside Django).
- The unpickling of files in
views.py
was failing in Windows. I had to add'rb'
to theopen
calls to force the files to be read as binary.
Note that the patch is currently using a CSE key (014182425414053223532:sfhzyefydv8) which I generated on my Google Account. This will work and can be used for testing, but unfortunately it doesn't seem to be possible for me to transfer ownership of this key to someone else. I suspect a core dev will want to generate their own key so that they retain full control over the CSE settings.
I have exported and attached the settings of the CSE I created and the following instructions should allow a core dev to create a new CSE based upon my one:
- Go to http://www.google.com/coop/cse/ and click on Create
- In the name and description fields, just enter "Temp" for now
- In sites to search, just enter "example.com" for now
- Ensure the "Do not show ads" checkbox is ticked (as Django is non-profit)
- Accept the Ts&Cs and Finish
- Go into the new CSE's control panel
- Go into the Advanced screen
- It will display the unique labels for the new CSE (_cse_XXXXXXXXXXX and _cse_exclude_XXXXXXXXXXX)
- Edit the attached context.xml file, replacing my CSE's labels with the new CSE's labels (and also the
CustomSearchEngine
element'sid
attribute appropriately) and then upload it. - Edit the attached annotations.xml file, replacing my CSE's labels with the new CSE's labels and then upload it.
- Go into the Sites screen and remove "example.com"
- Go into the Preview screen
- The link to "homepage" contains the unique key for the new CSE. Edit the patch's
search_form.html
to put in this key.
There is a thread on django-developers discussing this.
comment:2 by , 16 years ago
Replying to frasern:
[...] Unfortunately Trac doesn't seem to be showing the patch correctly -- please let me know if I need to generate the patch differently to get this to work.
No need to worry, the patch parser of this old Trac version has some problems to render some patches to HTML (possible causes are \ No newline at end of file
tokens, the size of the patch, the patch has been generated by a tool different from svn diff
, ...). But you patch is safe and will be downloaded and reviewed by a triager or core developer.
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in [8844].
frasern, this is awesome -- thanks so much for the work and really cool clear instructions!
Same as search.diff, but hopefully Trac will display a .patch file