purescript / pursuit

Website for hosting and searching PureScript API documentation
https://pursuit.purescript.org/
Other
169 stars 47 forks source link

Provide Markdown text in the `text` field for json search results #389

Closed hdgarrood closed 5 years ago

hdgarrood commented 5 years ago

Fixes #171

Now:

$ curl http://localhost:3000/search?q=Map -H 'Accept: application/json' 2>/dev/null | jq .[1]
{
  "text": "`Map k v` represents maps from keys of type `k` to values of type `v`.\n",
  "markup": "<p><code>Map k v</code> represents maps from keys of type <code>k</code> to values of type <code>v</code>.</p>\n",
  "url": "http://localhost:3000/packages/purescript-ordered-collections/1.4.0/docs/Data.Map.Internal#t:Map",
  "version": "1.4.0",
  "package": "purescript-ordered-collections",
  "info": {
    "typeOrValue": "TypeLevel",
    "module": "Data.Map.Internal",
    "typeText": null,
    "title": "Map",
    "type": "declaration"
  }
}