prologue icon indicating copy to clipboard operation
prologue copied to clipboard

update examples

Open ringabout opened this issue 3 years ago • 8 comments

update examples like gin web framework

ringabout avatar Sep 16 '20 10:09 ringabout

Is it better if I make a separate repo on my side for examples during developing so I wont have to bother with pull requests until I'm done?

keshon avatar Sep 16 '20 10:09 keshon

that would mean that all examples will assume that prologue is installed globally

keshon avatar Sep 16 '20 10:09 keshon

I think you counld use runableExamples for simple examples. runnableExamples will be checked.

ringabout avatar Sep 16 '20 10:09 ringabout

You could create a seperate repo in planety organization and rely on global prologue installation.

ringabout avatar Sep 16 '20 10:09 ringabout

What did you mean by runableExamples? I'm kinda missed it. I suggest I create some repo on my side like prologue-examples and will gradually fill it with examples (I will do it at my free time). When I finish I can add them to my fork of prologue and will create a pull request to merge.

keshon avatar Sep 16 '20 10:09 keshon

You could create a seperate repo in planety organization.

Ok great then!

keshon avatar Sep 16 '20 10:09 keshon

You could ref to this document https://nim-lang.github.io/Nim/docgen.html Generally, you can write an example file with rst comments like

# example1.nim

## Using GET, POST, PUT, PATCH, DELETE and OPTIONS
## -----------------
runnableExamples:
  proc hello(ctx: Context) {.async.} = discard
  doAssert ................

## Parameters in path
## -----------------------
runnableExamples:
  proc hello(ctx: Context) {.async.} = discard
  doAssert ................

runnableExamples docs in https://nim-lang.org/docs/system.html#runnableExamples%2Cuntyped

ringabout avatar Sep 16 '20 11:09 ringabout

OK, noted, will take a look, thanks!

keshon avatar Sep 16 '20 11:09 keshon