-
Notifications
You must be signed in to change notification settings - Fork 68
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
Unclear documentation on how to define and "install" new splices #163
Comments
It looks like you actually have it right. I believe you just have the wrong type signature for placeholder. Instead of this: placeholder :: I.Splice Snap Try this: placeholder :: I.Splice (Handler App App)
|
Right enough, it compiles if I make that change! Thanks. If I have time this weekend I'll have a crack at some doc tweaks. |
That would be great. This kind of feedback is very valuable. On Fri, Dec 4, 2015 at 12:28 PM, Will Thompson [email protected]
|
I generated an app with
snap init
, which uses Heist for templating. Now I want to add a page which interpolates some part of the URL, or a query parameter, or some procedurally-generated content into a template. I believe what I want to do is define a splice?The quickstart guide points me to two other pages:
My first stop was the Snaplets tutorial, I think because snaplets are mentioned on the home page. The example routes here explain clearly how to manipulate state, but not how to render anything other than plain text. This tutorial makes reference to
Part2.hs
(where “a little dummy code for the Foo and Bar snaplets” lives) but doesn't link to it. It then refers me to the snap package's documentation.Here, the Snap.Snaplet.Heist module sounds promising, particularly this documented line of boilerplate:
Or maybe the docs for
heistLocal
:But again I can't find any working examples. So I backtrack and read the Heist Template Tutorial, and I learn:
I'm still none the wiser about how to "put all my splices into a HeistConfig", though.
Reading code from GitHub code search, it looks like I need to do something like:
But this just yields:
At this point I'm afraid I gave up. I was hoping to be able to propose some patches for the docs but I genuinely can't work out how the pieces fit together.
The text was updated successfully, but these errors were encountered: