From 8aa35c07247c1563d7b03b9e1231157727dea2b4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 8 Nov 2017 20:15:46 +0800 Subject: [PATCH] doc.kak: Use a github compatible anchor generation Convert session names to lowercase and replace spaces with minus to generate anchor names. --- doc/pages/commands.asciidoc | 4 ++-- rc/core/doc.kak | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/pages/commands.asciidoc b/doc/pages/commands.asciidoc index ea4bf9e5..4f9bc851 100644 --- a/doc/pages/commands.asciidoc +++ b/doc/pages/commands.asciidoc @@ -83,7 +83,7 @@ command *q!* has to be used). Aliases are mentionned below each commands. *-markup*::: expand the markup strings in *text* (See - <>) + <>) *-debug*::: print the given text to the *\*debug** buffer @@ -138,7 +138,7 @@ command *q!* has to be used). Aliases are mentionned below each commands. *define-command* [] :: *alias* def + - define a new command (c.f. the 'Declaring new commands' section below) + define a new command (See <>) *map* :: bind a list of keys to a combination (See <>) diff --git a/rc/core/doc.kak b/rc/core/doc.kak index 847e93bd..059fb02a 100644 --- a/rc/core/doc.kak +++ b/rc/core/doc.kak @@ -39,7 +39,7 @@ define-command -hidden doc-parse-anchors %{ # Find sections as add them as imlicit anchors execute-keys \%s ^={2,}\h+([^\n]+)$ evaluate-commands -itersel %{ - set-option -add buffer doc_anchors "%val{selection_desc}|%reg{1}" + set-option -add buffer doc_anchors "%val{selection_desc}|%sh{printf '%s' \"$kak_reg_1\" | tr '[A-Z ]' '[a-z-]'}" } # Parse explicit anchors and remove their text