From 0371f9a8ff6fbd489970a170f212e05b24a8d6e2 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 16 Aug 2016 07:39:57 -0700 Subject: [PATCH] Add links to answers. --- lib/how2.js | 3 ++- lib/ui.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/how2.js b/lib/how2.js index 7b8b0ad..8fa45f3 100644 --- a/lib/how2.js +++ b/lib/how2.js @@ -147,7 +147,8 @@ function magic(text, lang) { var markdown = utils.toEscapedMarkdown(answers[index].body_markdown); var title = titles[index]; - console.log(colors.underline.green(title+'\n')); + console.log(colors.underline.green(title) + +' ('+colors.underline.blue(answers[index].link)+')\n'); console.log(markdown); console.log('Press SPACE for more choices, any other key to quit.'); diff --git a/lib/ui.js b/lib/ui.js index dac3b53..0a161f4 100644 --- a/lib/ui.js +++ b/lib/ui.js @@ -200,7 +200,7 @@ function showAnswer(answer) { mouse: true }); - answerBox.setContent(text); + answerBox.setContent(text + '\n(' + colors.underline.blue(answer.link) + ')'); answerBox.key(['escape', 'q'], function() { screen.remove(answerBox);