Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
--- /dev/null
+#+TITLE: TODO
+
+# No point to having GitLab issues for a one-man project
+
+* TODO Pretty colors in terminal
+* TODO Preferences should go into a config file
+* TODO Terminal color themes
import uri
import xmltree
import uri
import xmltree
-# TODO Pretty colors in terminal
-# import terminal
-
# Supported video players in order of preference
# Supported video players in order of preference
-# TODO Should go into a config file
let supportedPlayers = @["mpv", "mplayer", "vlc"]
let supportedPlayers = @["mpv", "mplayer", "vlc"]
+# Hard-coded terminal colors
+proc reset(): string {.procvar.} = "\e[0m"
+proc bold*(s: string): string {.procvar.} = "\e[1m" & s & reset()
+
+proc fgMagenta*(s: string): string {.procvar.} = "\e[35m" & s & reset()
+proc fgCyan*(s: string): string {.procvar.} = "\e[36m" & s & reset()
+
type SearchResult = tuple[title: string, url: string]
proc selectMediaPlayer(): string =
type SearchResult = tuple[title: string, url: string]
proc selectMediaPlayer(): string =
proc presentVideoOptions(searchResults: seq[SearchResult]) =
for index, (title, url) in searchResults:
proc presentVideoOptions(searchResults: seq[SearchResult]) =
for index, (title, url) in searchResults:
- echo index, ". ", title, "\n", url, "\n"
+ echo index, ". ", title.bold.fgMagenta, "\n", url.fgCyan, "\n"
presentVideoOptions(
extractTitlesAndUrls(
presentVideoOptions(
extractTitlesAndUrls(