Command or tool to interpret and read asciidoctor syntax through terminal?

Hello Friends

For a .adoc file to write documentation, it based on the asciidoctor syntax, is possible through GUI use either VSCode or AsciiDocFX to see a preview. Therefore the asciidoctor syntax is rendered/interpreted to be read it.

For the terminal what software - if exists - would do the same job about to render/interpret the asciidoctor syntax to read it? I mean something like the execution of:

  • <toolname> tutorial.adoc

Consider as example: have a html file and use w3m to interpret and read it.
Therefore I want practically the same behavior like man <commandname>, read a documentation with a pretty format.

You could write a script to do it
Render it to a temporary html file, then use html2text to display the html file as text.

Is this what you’re looking for?

There is literally an asciidoc to nroff (manpage) translator.

I haven’t tried it.

I wrote a shell script 3 years ago to read a dump of HTML files from a wiki when my company transitioned into an outsource arrangement with a major customer…

#!/usr/bin/env bash
# view some html crap with "w3m" and "less"
PROG=$(basename $0)
case $PLAT in
		echo "don't be running that shit...  shit, not here..."
		exit 1
IFS=$(echo -en "\n\b")
if [ ! -f $REND ] ; then
	echo "w3m is not installed... install it?"
	echo "e.g. "
	echo "         sudo apt install w3m"
	echo "     - or - "
	echo "         sudo dnf install w3m"
	exit 1
if [ "$#" -lt 1 ]; then
    echo "Illegal number of parameters"
    echo "e.g. "
    echo "      $PROG How_to_reboot_a_Zone_-_GooRoo.html"
    echo " expecting a HTML file.... exiting"
    exit 1
$REND -dump $DOC | $PAGER

And because I use less as my pager, I can use vi navigation keys to navigate the output (and better yet “/” to search the HTML output).

Might use this.
It should fix an html file that is in too small a font to print by the usual method of making it a pdf file

I used it, with some mods.
I had this really useful website

and I wanted to print it.
The classic method using print or print to pdf failed… the fontsize was miniscule. You cant change fontsize in a .pdf file.

w3m rendered it to text, which was eminently printable.

1 Like

Thanks to all for the replies and feedback, I will try to test each approach. A cold beer to you all.

1 Like