cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit deeea437efa87993473199605e95a068861c16aa
parent 53a79a3295d8fa5c781ffa983bed22241327c779
Author: René Wagner <rwa@clttr.info>
Date:   Tue,  7 Dec 2021 21:04:43 +0100

add backlink search via `l` command

closes #22

Diffstat:
MREADME.md | 1+
Msrc/gmnlm.c | 6++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -26,6 +26,7 @@ It includes the following modifications: - colored headings & links - default 4 char indenting - `s` command to directly search in geminispace (via geminispace.info) +- `l` command to search for backlinks to current URI (via geminispace.info) - `k` command to remove the bookmark for the current page - `u` command to navigate 1 path element up - `e[N]` command to open a link or the current URI in default external program (requires `xdg-open`) diff --git a/src/gmnlm.c b/src/gmnlm.c @@ -99,6 +99,7 @@ const char *help_msg = "k\t\tRemove bookmark for current page\n" "r\t\tReload the page\n" "s\t\tSearch via geminispace.info\n" + "l\t\tSearch backlinks to current URI via geminispace.info\n" "/<text>\t\tSearch for text (POSIX regular expression)\n" "n\t\tJump to next search match\n" "d <path>\tDownload page to <path>\n" @@ -646,6 +647,11 @@ do_prompts(const char *prompt, struct browser *browser) fprintf(browser->tty, "Alttext instead of preformatted block is now %s\n\n", browser->alttext ? "ENABLED" : "DISABLED"); result = PROMPT_AGAIN; goto exit; + case 'l': + snprintf(url, sizeof(url), "gemini://geminispace.info/backlinks?%s", browser->plain_url); + set_url(browser, url, &browser->history); + result = PROMPT_ANSWERED; + goto exit; case 'b': if (in[1]) historyhops =(int)strtol(in+1, &endptr, 10); while (historyhops > 0) {