rpastuszak a year ago

Here's the snippet I'm using:

    markdown () {
       pandoc $1 | lynx -stdin
    }

usage:

    $ markdown README.md
I don't often use pandoc or lynx so might check out glow instead, but I thought some of you might find this approach simpler in case you already have these tools installed.
  • version_five a year ago

    Hey, you reminded me, I once experimented with pandoc's conversion script- you can write a lua script that handles the different markdown styles - to just output escape sequences for different colors or bold/italics depending on the header level, so that you could just translate the markdown into something prettier in your shell.

    Your approach is more sensible, I had fun playing with the lua script though. Pandoc will spit out a reference script that formats the output as html so it it pretty easy to work off of

  • luckman212 a year ago

    You need quotes around "$1" otherwise `markdown "my file.md"` won't work because of the whitespace.

  • tempodox a year ago

    And you could swap pandoc with multimarkdown. Achieves the same.

  • xcdzvyn a year ago

    But it doesn't have pizzazz! :-)

    • aaws11 a year ago

      cheeky chooky

tstack a year ago

Rendering markdown in the terminal[1] was also recently added to the Logfile Navigator (https://lnav.org). It was partially inspired by Glow. There are some extra features in lnav's implementation, like a breadcrumb bar so that you can jump to different sections of the document.

(You might question why a log file viewer needs markdown support... It's used mainly to make the builtin help text look nicer. But, it can also be used in other places, like adding comments to log messages and generating reports. It's even used to implement an interactive tutorial[2].)

[1] - https://lnav.org/2022/08/06/markdown-support.html [2] - https://lnav.org/2022/09/01/playground.html

kickingvegas a year ago

"Glow works with the Charm Cloud to allow you to store any markdown files in your own private collection." So are we to presume that Charm Cloud is always going to be an intermediary between the user and their private collection? Seems like a vulnerable position place to be when using sensitive info captured in Markdown.

IanCal a year ago

Interesting, I'm a bit concerned about pushing arbitrary things to a third party on just pressing s though. I know there's talk of encryption but still, that's a much bigger thing than just rendering markdown.

  • cglong a year ago

    It looks like there's a config flag that disables all network activity, including to/from their cloud.

version_five a year ago

Vim already does a lot of this between syntax highlighting and the fact that markdown is designed to be readable as text. I think it's an interesting space though.

One thing that would be cool is image support for terminals that support them.

I'm also curious (tangentially) if there are any terminals that support different fonts and sizes (at the same time)?

  • naikrovek a year ago

    2x wide and 2x tall fonts were commonly supported on old terminals, though not commonly used. I bet xterm supports both today.

    edit: yep. see https://en.wikipedia.org/wiki/Vttest

    • version_five a year ago

      Very interesting, thanks!

      In case anyone is interested, I just checked, and xterm supports it, terminal on ubuntu does not, nor does iterm2 on mac nor termux on android

1-more a year ago

I have a very nice tool for checking out the GitHub pull requests I'm assigned to review that uses this to preview the description. Way nicer than anything else I tried in that it can do emojis (not sure if they're encoded as shortcodes or what), tables, etc.

  • petepete a year ago

    GitHub's command line tool does a pretty good job of this, it does emoji too.

    • 1-more a year ago

      I use that to get the markdown in the list of PRs assigned to me, then I use fzf (fuzzy finder) to choose between them with Glow for the previewing. I think I tried previewing the PR with GH and because it would fetch each PR description anew it wasn't good for arrowing between the PRs like I wanted.

dotancohen a year ago

I'd love to see how the markup is actually rendered. The README has an animated gif, but it goes by so fast that I really can't see how anything is rendered. Screenshots would be fine for this purpose, why the bling?

bubuanabelas a year ago

A few years ago I wrote markcat, a cli toot to process markdown but more focused on readability. To this day I do `markcat README.md` a lot .

https://github.com/BubuAnabelas/markcat/

  • imiric a year ago

    Thanks, this looks much better.

    Glow does too much. I don't care about using their cloud, a new pager, or a TUI for that matter. Just render Markdown and let me view it with my pager of choice.

mgrandl a year ago

I recently tried it. The CLI works great, but there is one super basic feature missing in the TUI that makes me not want to use it and that is search inside a document. There is already a FR on Github, but it got no attention so far.

  • truemotive a year ago

    if it’s still open, I think I’ll take a stab at this in the near future…

_ZeD_ a year ago

uhm... but wasn't md designed to be readable as is? what do you guys miss from "less mydoc.md"?

  • mekster a year ago

    Unless I'm a character inside the Matrix, I prefer visual converters.

worldsavior a year ago

How is the analogy of this tool, rendering markdown in the CLI, has to do with uploading markdown files to a cloud service? Seems out of scope.

thih9 a year ago

What does it do exactly?

E.g. is it only changing the text’s color / font style? Or is it also doing something more, like positioning or spacing?

booi a year ago

I feel like I’ve boomeranged from loving CLI/TUI interfaces to native UI to web/html interfaces, back to native UI and then now I’m all about the TUI/CLI again with musikcube.

  • zozbot234 a year ago

    Real-world web/HTML UI's tend to suck. But a well-made, lightweight, accessible web UI can be quite effective much like a TUI.

  • pxc a year ago

    I think what I like in a UI tends to be common in TUIs, but what I enjoy in a UI isn't necessarily attached to any of the categories you mention.

    What do you feel is uniquely appealing about UIs in those different categories that has your excitement pinging between them?

    • infogulch a year ago

      For me:

      terminal: beautiful simplicity & efficiency -- everything is a stream of bytes, output is characters displayed on a regular grid

      web: bang-for-buck experience -- hard to beat for middling interactivity plus high development velocity

      native: maxed out capacity for experience & interactivity

dimator a year ago

on mac, pointing to one file doesn't page the output. I can't get the output paged using `less`, it loses all the formatting and color. starting the TUI (no args) and then choosing the file works fine, however.

less --version

less 608 (PCRE2 regular expressions)

  • 7362398724 a year ago

    are you using `less -r` to pass through raw ansi code?

    it also looks like it has a `-p` option for a pager

    > CLI output can be displayed in your preferred pager with the -p flag. This defaults to the ANSI-aware less -r if $PAGER is not explicitly set.

    • dimator a year ago

      yes, was using `less -r`

      but `glow -p file.md` is working great! thanks