hapi-docs icon indicating copy to clipboard operation
hapi-docs copied to clipboard

Code Examples & Example Response

Open emrealparslan93 opened this issue 5 years ago • 4 comments

How can I generate code examples and example responses?

emrealparslan93 avatar Mar 07 '19 16:03 emrealparslan93

Guide coming with a new release soon ✌️

henrikruscon avatar Mar 08 '19 06:03 henrikruscon

Also stuck on this :)

I can't see in the example how code examples or languages are enabled. Is the heroku app using an older version of the example/plugin?

antony avatar Jul 02 '19 12:07 antony

For anybody else who stumbles across this - check out this repository, make your template changes, run npm run build then copy the dist dir to wherever you want to point templateDir.

antony avatar Jul 02 '19 14:07 antony

@antony good advice, thanks! To add on to that, if your examples are a part of route data, you can modify path.js to pull that data from additional fields. For example, examples: Hoek.reach(routeOptions, 'examples') || null

And use that field in the template. You will then have to fork and publish the module under your own name/org or point to a git repo.

kahluagenie avatar Sep 25 '19 21:09 kahluagenie