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)

search.diff (9.6 KB ) - added by Fraser Nevett 16 years ago.
search.patch (9.6 KB ) - added by Fraser Nevett 16 years ago.
Same as search.diff, but hopefully Trac will display a .patch file
annotations.xml (1.3 KB ) - added by Fraser Nevett 16 years ago.
context.xml (1.4 KB ) - added by Fraser Nevett 16 years ago.

Download all attachments as: .zip

Change History (7)

by Fraser Nevett, 16 years ago

Attachment: search.diff added

by Fraser Nevett, 16 years ago

Attachment: search.patch added

Same as search.diff, but hopefully Trac will display a .patch file

by Fraser Nevett, 16 years ago

Attachment: annotations.xml added

by Fraser Nevett, 16 years ago

Attachment: context.xml added

comment:1 by Fraser Nevett, 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:

  1. The regex for the document view was preventing the images and source 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).


  1. The unpickling of files in views.py was failing in Windows. I had to add 'rb' to the open 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:

  1. Go to http://www.google.com/coop/cse/ and click on Create
  2. In the name and description fields, just enter "Temp" for now
  3. In sites to search, just enter "example.com" for now
  4. Ensure the "Do not show ads" checkbox is ticked (as Django is non-profit)
  5. Accept the Ts&Cs and Finish
  6. Go into the new CSE's control panel
  7. Go into the Advanced screen
  8. It will display the unique labels for the new CSE (_cse_XXXXXXXXXXX and _cse_exclude_XXXXXXXXXXX)
  9. Edit the attached context.xml file, replacing my CSE's labels with the new CSE's labels (and also the CustomSearchEngine element's id attribute appropriately) and then upload it.
  10. Edit the attached annotations.xml file, replacing my CSE's labels with the new CSE's labels and then upload it.
  11. Go into the Sites screen and remove "example.com"
  12. Go into the Preview screen
  13. 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.

in reply to:  1 comment:2 by Ramiro Morales, 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 Jacob, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in [8844].

frasern, this is awesome -- thanks so much for the work and really cool clear instructions!

Note: See TracTickets for help on using tickets.
Back to Top