From e6da4a4a4f586baa8219e299e2002316f10f1b56 Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Sat, 19 Sep 2026 13:13:12 +0200 Subject: [PATCH] DOCS: Use a repository-relative path in the `helpers.js` debugging example. - Read `pkg/js/helpers.js` instead of a path under `/Users/tlimoncelli/`, and note that the command runs from the root of the repository. - Mark both "Debug `helpers.js`" code blocks as `shell` and remove the `$` prompt. Refs https://github.com/DNSControl/dnscontrol/pull/4827 --- documentation/advanced-features/debugging-with-dlv.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/advanced-features/debugging-with-dlv.md b/documentation/advanced-features/debugging-with-dlv.md index 382105684e..d317fa0504 100644 --- a/documentation/advanced-features/debugging-with-dlv.md +++ b/documentation/advanced-features/debugging-with-dlv.md @@ -85,7 +85,7 @@ VSCode equivalent configuration is: Develop a function: -``` +```shell node -e " function IP(dot) { var d = dot.split('.'); @@ -95,13 +95,13 @@ console.log(IP('135.181.247.240')); " ``` -Debug a function within helpers.js: +Debug a function within `helpers.js` (run from the root of the repository): -``` -$ node -e " +```shell +node -e " const fs = require('fs'); const vm = require('vm'); -const code = fs.readFileSync('/Users/tlimoncelli/gitthings/dnscontrol/pkg/js/helpers.js', 'utf8'); +const code = fs.readFileSync('pkg/js/helpers.js', 'utf8'); const sandbox = {}; vm.createContext(sandbox); vm.runInContext(code, sandbox);