From 1006b4afc4c5ec89fcf6a39f348add4067635147 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 23 Oct 2017 16:44:59 -0700 Subject: [PATCH] help.markup: allow $url to have display text that's not just the url. --- basis/help/markup/markup.factor | 2 +- .../control-pictures/control-pictures-docs.factor | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index b8638a65de..7bd73e0bb6 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -77,7 +77,7 @@ ALIAS: $slot $snippet [ strong-style get print-element* ] ($span) ; : $url ( children -- ) - first dup >url [ + [ ?second ] [ first ] bi over [ nip dup ] unless >url [ dup present href associate url-style get assoc-union [ write-object ] with-style ] ($span) ; diff --git a/extra/unicode/control-pictures/control-pictures-docs.factor b/extra/unicode/control-pictures/control-pictures-docs.factor index 7567444e3a..feeca10270 100644 --- a/extra/unicode/control-pictures/control-pictures-docs.factor +++ b/extra/unicode/control-pictures/control-pictures-docs.factor @@ -1,16 +1,8 @@ ! Copyright (C) 2017 Pi. ! See http://factorcode.org/license.txt for BSD license. -USING: assocs hashtables help.markup help.stylesheet help.syntax -help.topics io.styles kernel namespaces present sequences -strings urls ; +USING: help.markup help.syntax strings ; IN: unicode.control-pictures -: $url-to ( children -- ) - first2 >url [ - dup present href associate url-style get assoc-union - [ write-object ] with-style - ] ($span) ; - HELP: control-pictures { $values { "string" string } @@ -18,7 +10,7 @@ HELP: control-pictures { $description "Transforms C0 control characters into their corresponding Control Picture block codepoints." } ; ARTICLE: "unicode.control-pictures" "Control Pictures" -"The " { $vocab-link "unicode.control-pictures" } " vocabulary provides a utility word " { $link control-pictures } " for transforming characters in the nonprintable " { $url-to "ASCII C0 block" "http://www.unicode.org/charts/PDF/U0000.pdf" } " to their representations in the " { $url-to "Control Pictures" "http://www.unicode.org/charts/PDF/U2400.pdf" } " block. It has no effect on any other characters." +"The " { $vocab-link "unicode.control-pictures" } " vocabulary provides a utility word " { $link control-pictures } " for transforming characters in the nonprintable " { $url "http://www.unicode.org/charts/PDF/U0000.pdf" "ASCII C0 block" } " to their representations in the " { $url "http://www.unicode.org/charts/PDF/U2400.pdf" "Control Pictures" } " block. It has no effect on any other characters." ; ABOUT: "unicode.control-pictures"