Markdown code blocks migration part 7 (#20547)

This commit is contained in:
Andrey Makarov 2022-10-12 17:13:43 +03:00 • committed by GitHub
commit 19ff746916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 426 additions and 411 deletions

View file

@ -75,11 +75,11 @@ proc inotify_rm_watch*(fd: cint; wd: cint): cint {.cdecl,
iterator inotify_events*(evs: pointer, n: int): ptr InotifyEvent =
## Abstract the packed buffer interface to yield event object pointers.
##
## .. code-block:: Nim
## ```Nim
## var evs = newSeq[byte](8192) # Already did inotify_init+add_watch
## while (let n = read(fd, evs[0].addr, 8192); n) > 0: # read forever
## for e in inotify_events(evs[0].addr, n): echo e[].len # echo name lens
## ```
var ev: ptr InotifyEvent = cast[ptr InotifyEvent](evs)
var n = n
while n > 0:

View file

@ -1093,11 +1093,11 @@ template onSignal*(signals: varargs[cint], body: untyped) =
## scope.
##
## Example:
##
## .. code-block::
## ```Nim
## from std/posix import SIGINT, SIGTERM, onSignal
## onSignal(SIGINT, SIGTERM):
## echo "bye from signal ", sig
## ```
for s in signals:
handle_signal(s,