Spock icon indicating copy to clipboard operation
Spock copied to clipboard

Request Handling Documentation Gone?

Open xanderdunn opened this issue 8 years ago • 7 comments

In an old version of spock on Hackage I can find a Request Handling section that includes information on param, params, jsonBody, etc. There isn't information for any of these functions in the Hackage documentation for the most recent version of Spock. Spock still exports these functions, why is the documentation missing?

xanderdunn avatar Mar 14 '17 21:03 xanderdunn

Hi, those functions were moved to a separate package, Spock-core. You can find the Request Handling section here. I know this could be more obvious, I'm trying to help with improving docs at the moment.

brynedwards avatar Mar 15 '17 09:03 brynedwards

Yeah, all these functions are now "hidden" behind module Web.Spock.Action. Maybe we should reexport all the individual functions for good documentation, but then when making changes to Web.Spock.Action one has to be real careful to update all the reexports, so not a big fan...

agrafix avatar Mar 15 '17 13:03 agrafix

I've been looking into doing this "the right way", which IMO would be showing the entire contents of Web.Spock.Action in Web.Spock without having to manually reexport everything. This is described in the Haddock docs, specifically the hide Haddock option, but doesn't seem to work for me (there seem to be a number of issues with module reexports in Haddock, so it might be due to one of them). Unless/until there is a way to make this work, I suggest either:

  • Reexporting everything in Web.Spock.Action individually.
  • Including a sentence or two below the actions heading explaining that the documentation for actions is in Web.Spock.Action

brynedwards avatar Mar 15 '17 15:03 brynedwards

Alternatively we could introduce a dummy identifier and then use hiding when importing/reexporting it. That could work?

agrafix avatar Mar 15 '17 17:03 agrafix

I think that should work, but I tried using hiding myself and couldn't get it to work, I'm assuming it's another Haddock issue.

brynedwards avatar Mar 15 '17 18:03 brynedwards

Hm... Then maybe just highlighting a link to Spock-core is the way to go for now.

agrafix avatar Mar 16 '17 08:03 agrafix

Looking at this again, since Web.Spock and Web.Spock.Core are nearly identical, I think a nice layout would be to have Web.Spock reexport everything from Web.Spock.Core and have module Web.Spock.Core and module Web.Spock.Action at the top of Web.Spock followed by Web.Spock exports, like this module does.

brynedwards avatar Mar 22 '17 10:03 brynedwards