Skip to content
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

Naive fix for hoogle. Strip html and formatting #434

Merged

Conversation

Projects
None yet
2 participants
@jdcaperon
Copy link
Collaborator

commented May 14, 2019

Fixes #433

For reference, the response format directly returns a list of dicts now. Example dict:

{"url":"https://hackage.haskell.org/package/base/docs/Prelude.html#v:const","module":{"url":"https://hackage.haskell.org/package/base/docs/Prelude.html","name":"Prelude"},"package":{"url":"https://hackage.haskell.org/package/base","name":"base"},"item":"<span class=name><s0>const</s0></span> :: a -&gt; b -&gt; a","type":"","docs":"<tt>const x</tt> is a unary function which evaluates to <tt>x</tt> for\nall inputs.\n\n<pre>\n&gt;&gt;&gt; const 42 \"hello\"\n42\n</pre>\n\n<pre>\n&gt;&gt;&gt; map (const 42) [0..3]\n[42,42,42,42]\n</pre>\n"}

The responses now also contain HTML markup. It's trivial to strip from the type sig but less so from the docs segment without the formatting for the docs section being a little awkward.

image

image

@jdcaperon jdcaperon requested a review from nicklambourne May 15, 2019

@nicklambourne nicklambourne merged commit 0f43c59 into UQComputingSociety:master Jun 1, 2019

1 check passed

Jenkins No test results found.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.