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

Python: New Django Fathead #673

Merged
merged 2 commits into from Jan 4, 2017

Conversation

Projects
None yet
4 participants
@vigzmv
Member

vigzmv commented Dec 30, 2016

Description of new Instant Answer, or changes

Django Fathead

Related Issues and Discussions

Fixes #552

People to notify

@moollaza

Testing & Review

To be completed by Language Leader (or DDG Staff)

Pull Request

  • Title follows correct format (Specifies Instant Answer + Purpose)
  • Description contains a valid Instant Answer Page Link (e.g. https://duck.co/ia/view/my_ia)

Instant Answer Page

  • Instant Answer page is correctly filled out and contains:
    • One topic for the Search Space Language (Java, Python, Scala, Ruby, etc.)
    • One topic from: Reference, Help, Libraries, Tools
      • Documentation Fatheads are considered "Reference"
    • Description, Data source, and 2+ example queries
    • Perl Module (e.g. "DDG::Fathead::PerlDoc" -- we only need a name, not an actual file)
    • Source Name (for "More at <source_name>" link)
    • Source Domain (must contain http:// or https:// -- can be the same as Data Source)
    • Source Info (used as Subtitle for each Article -- usually matches the IA Name)
    • 'Skip Abstract' is checked off
    • Source ID (ping @moollaza to assign one, once Fathead is ready for Beta deploy)
  • Fathead Tests are passing (run $ duckpan test <fathead_id>)
    • Tester should report any failures

Code

  • Uniformly indented, well commented
  • Fetch.sh and Parse.sh run without errors
  • Output contains no blank lines, or multi-line entries

Pull Request Review Guidelines: https://docs.duckduckhack.com/programming-mission/pr-review.html


Instant Answer Page: https://duck.co/ia/view/django

@daxtheduck

This comment has been minimized.

daxtheduck commented Dec 30, 2016

Django Documentation

Description: Reference for the Python Django Framework

Example Query: Django allowed_hosts, django auth, django static

Tab Name: About

Source: https://docs.djangoproject.com/en/

These are the important fields from the IA page. Please check these for errors or missing information and update the IA page


This is an automated message which will be updated as changes are made to the IA page

@pjhampton pjhampton self-requested a review Jan 1, 2017

@pjhampton pjhampton self-assigned this Jan 1, 2017

@pjhampton pjhampton changed the title from New Django fathead created to Python: New Django Fathead Jan 1, 2017

@moollaza

This comment has been minimized.

Member

moollaza commented Jan 3, 2017

@vigzmv thanks for this -- I've changed your IA Page ID to django and remove the existing "Django" IA page which was not in use.

This is necessary as the ID must match the directory for your Fathead, which is currently django.

As well, I need you to move the removal of the django_built_ins IA to a separate PR, which should also contain the IA page link to that Fathead. This is necessary so we can identify the removal of the Fathead correctly.

@daxtheduck daxtheduck deployed to beta.duckduckgo.com Jan 3, 2017 Active

@moollaza

This comment has been minimized.

Member

moollaza commented Jan 3, 2017

@vigzmv can you also please create a trigger_words.txt file with the following content:

django
django framework
python django
python django framework

This will allow those four phrase to come before/after any of the article titles in the output.txt and still trigger the Fathead. e.g. "django auth" will correctly trigger the Fathead.

wget --quiet https://docs.djangoproject.com/en/1.10/ref/urls/ -O urls.html
wget --quiet https://docs.djangoproject.com/en/1.10/ref/models/database-functions/ -O database-functions.html
wget --quiet https://docs.djangoproject.com/en/1.10/ref/models/fields/ -O fields.html
wget --quiet https://docs.djangoproject.com/en/1.10/ref/migration-operations/ -O migration-operations.html

This comment has been minimized.

@moollaza

moollaza Jan 3, 2017

Member

@vigzmv this is a great start -- the structure of the Django docs clearly doesn't lend itself to being parsed for classes/methods/attributes/etc

I have another idea though, what about downloading the HTML offline docs (instead of several files) and iterating over the Index?

It seems that most entries in the index indicate if they are a class, method, attribute or function in parenthesis. By scraping those and using the css classes on the page, I think we could reliably parse out all the methods, classes, attributes and functions from the docs?

This comment has been minimized.

@moollaza

moollaza Jan 3, 2017

Member

ideally then we would have more context when creating the output and we could more cleverly create redirects to handle queries like "django AddField class", "django add method" etc.

Of course that's not necessary for Version 1, but it may help to make the Fathead more flexible

This comment has been minimized.

@vigzmv

vigzmv Jan 4, 2017

Member

Yes. That's a good idea. I will working to improve this fathead.

@moollaza

This comment has been minimized.

Member

moollaza commented Jan 3, 2017

@vigzmv this is now live on Beta. Because it was installed automatically, you can use your username as a special trigger word to see the IA in action:

https://beta.duckduckgo.com/?q=vigzmv+auth&ia=about

The more unique article titles will work on their own though, without a trigger word:

https://beta.duckduckgo.com/?q=vigzmv+TimeField&ia=about

@daxtheduck daxtheduck deployed to beta.duckduckgo.com Jan 3, 2017 Active

@moollaza

This comment has been minimized.

Member

moollaza commented Jan 3, 2017

@vigzmv once you've moved the django_built_ins to a separate PR, and added in the trigger_words.txt file, this should be good for merge 👍

@daxtheduck daxtheduck deployed to beta.duckduckgo.com Jan 3, 2017 Active

@daxtheduck daxtheduck deployed to beta.duckduckgo.com Jan 4, 2017 Active

@vigzmv

This comment has been minimized.

Member

vigzmv commented Jan 4, 2017

Thanks for the review. I Added Back django_built_ins & Created trigger_words.txt.

@vigzmv

This comment has been minimized.

Member

vigzmv commented Jan 4, 2017

I will send Another PR for Removal of Django_built_ins after this is merged.

@moollaza

This comment has been minimized.

Member

moollaza commented Jan 4, 2017

@vigzmv Thanks! This LGTM 👍

@moollaza moollaza merged commit fb60089 into duckduckgo:master Jan 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment