Author |
Message |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Tue 28 Apr 2015, 12:54 Post subject:
mdview, a markdown viewer |
|
From the page:
mdview is a super light-weight, GTK-based markdown files viewer. It has no other dependencies other than GTK itself. It reads and displays text files in (a subset of) markdown format, and provide live links to other files as well as to the Internet. It is ideal for showing help files (its original purpose), user manuals, and other small set of hyperlinked markdown files.
Subset of markdown that mdview supports:
* Heading level 1,2,3
* Horizontal rules
* Single-level bullets (but no ordered list)
* Inline-code and codeblocks
* Hyperlinks (format is a simplified version of original markdown)
* Inline images
* Inline formatting: italic, bold, smart double/single quotes, em-dash.
Compiles down to only 60K. No further dependency other than GTK.
Get it from here: https://chiselapp.com/user/jamesbond/repository/mdview3/home
-----
EDIT: Markdown files are plain text files with some human-readable formatting added. Markdown files are created and editable using standard text editor. mdview only supports a limited subset; the formatting that it supports is given in example/index.md.
-----
EDIT: mdview now can converts markdowns to plain text, decorated plain text (with vt100 bold/underline codes), and html too.
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Last edited by jamesbond on Tue 19 May 2015, 11:37; edited 2 times in total
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8683 Location: qld
|
Posted: Fri 01 May 2015, 06:13 Post subject:
|
|
Works well with github markdown
A few typos in the help on the cli.
Code: | # ./mdview -h
mdview - (C) Leandro Pereira 2009, James B 2015.
Usage: mdview [directory [file [home [title]]]]
- directory where the files arem if not specified, current directory.
- file to open, if not specified, index.md is used.
- home file. f not specified, index.md is used.
- title - window title, if not specifieid, mdview is used
You can skip parameters by specifying blanks.
# ./mdview /mnt/sda6/git-repos/pmcputemp-builds/pmcputemp-0.63 home README.md |
(ha, not the only one with typos .. read my screeny!)
Description |
|
Filesize |
53.56 KB |
Viewed |
985 Time(s) |

|
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3445 Location: www.eussenheim.de/
|
Posted: Fri 01 May 2015, 08:05 Post subject:
|
|
### is not h3 but link to png
working `inline code` would be nice.
Description |
save as... /usr/share/doc/index.md
|

Download |
Filename |
index.md.gz |
Filesize |
5.4 KB |
Downloaded |
305 Time(s) |
Description |
Glued with PeasyGlue |
Filesize |
108.54 KB |
Viewed |
936 Time(s) |

|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3445 Location: www.eussenheim.de/
|
Posted: Fri 01 May 2015, 09:35 Post subject:
Fatdog's Home |
|
re-uploaded index.md
download to /usr/share/doc/index.md
launch by:
Code: | mdview /usr/share/doc "" "" "Fatdog's Home" |
... there will be a title too.
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8683 Location: qld
|
Posted: Fri 01 May 2015, 18:02 Post subject:
|
|
How about a run action?
Code: | #!/bin/sh
DIR=${@%/*}
FILE=${@##*/}
HOME=$FILE
TITLE=${FILE%.*}
mdview $DIR $FILE "$HOME" "$TITLE"
|
text_x-markdown (replace the current symlink in fatdog)
In older pups with older shared-mime-info it is reported wrongly as application_x-genesis-rom .. see https://bugs.freedesktop.org/show_bug.cgi?id=27441
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3445 Location: www.eussenheim.de/
|
Posted: Sat 02 May 2015, 05:22 Post subject:
mdview, a markdown viewer Subject description: links |
|
Looks like there is just one link allowed in a "paragraph".
This is working: Code: |
Over the time, Fatdog migrated to support 64-bit platform (hence Fatdog64 name) and grew became an independent distribution of its own - while striving to keep the original spirit of Puppy Linux of being small, fast, and versatile. For a fuller history [http://distro.ibiblio.org/fatdog/web/history.html click here].
Fatdog64 700 series - the latest iteration of Fatdog64 - is
hand-built based on recipes from [http://linuxfromscratch.org Linux From Scratch], version 7.5 (the latest when the Fatdog64 700 alpha1, the first
public release of Fatdog64 700, was released). |
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Sat 02 May 2015, 06:14 Post subject:
|
|
Thanks guys for the feedback, you keep me busy
- ah, the typo
- executable code is not in markdown spec, so I prefer not to extend it. Or, perhaps, I can add a command line switch to enable this extra feature.
- The ### bug is confirmed. This is because the original code does not support links, Leandro use some hack to enable it (I think by marking text with underlines), so everything that has underlines is taken as links.
- line can only have one link bug is also confirmed.
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Sun 03 May 2015, 05:35 Post subject:
|
|
All done except L18L's executable code request. Fossil updated.
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Sun 03 May 2015, 13:09 Post subject:
|
|
L18L's suggestion now implemented. Use $(xxx) to do it, and you need to specify "-x" on the command line. The code is very simplistic, nested $() is not supported e.g. $(echo $(echo a)) will *surely* fail.
I also added non-standard strikethrough, using --- (3 dashes). So 3-dashes now have mutliple functions. Just make sure that these dashes does not begin a line, otherwise it will be taken as either a ruler, or as a marker for header #2.
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3445 Location: www.eussenheim.de/
|
Posted: Mon 04 May 2015, 04:35 Post subject:
mdview, a markdown viewer Subject description: gettext |
|
jamesbond wrote: | L18L's suggestion now implemented. Use $(xxx) to do it, and you need to specify "-x" on the command line. The code is very simplistic, nested $() is not supported e.g. $(echo $(echo a)) will *surely* fail. |
Thanks jamesbond, you keep me busy.
Tested: Code: | 
# Fatdog 64-bit GNU/Linux Operating System
$(TEXTDOMAIN=fatdog; gettext Cancel)
$(gettext fatdog Quit)
$(gettext 'Cancel and Quit') |
The first two work.
Last one not. We need ' inside $().
Re-produce it by: Code: | LANGUAGE=de mdview -x /usr/share/doc home.md "" "Fatdog's Home" |
Description |
|
Filesize |
19.61 KB |
Viewed |
798 Time(s) |

|
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Mon 04 May 2015, 08:16 Post subject:
Re: mdview, a markdown viewer Subject description: gettext |
|
L18L wrote: | Thanks jamesbond, you keep me busy. |
And I will make you even busier. Fossil updated
This now works: Code: | $(echo '$LANG') is $(echo $LANG)
$(echo '$LANG' is $LANG) |
Btw - the output of $() *will* be interpreted as markdown code. Output of $(echo **bold**) will be shown as bold. But again, please don't nest $() or get too smart with it - the code inside is simple and stupid
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3445 Location: www.eussenheim.de/
|
Posted: Mon 04 May 2015, 14:12 Post subject:
Re: mdview, a markdown viewer ready for global use |
|
Cannot use ( ) in text.
Replaced it by --....--
Sorry if have killed an apostrophe without real need.
$(gettext 'here apostrophe can't be used')
$(gettext 'here apostrophe can\'t be used')
$(gettext "here apostrophe can be used")
review text please.
Code: | mdview -x /usr/share/doc home.md "" "Fatdog's Home" |
Description |
|
Filesize |
36.9 KB |
Viewed |
760 Time(s) |

|
Description |
/usr/share/doc/home.md
|

Download |
Filename |
home.md.gz |
Filesize |
5.94 KB |
Downloaded |
290 Time(s) |
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Mon 04 May 2015, 14:44 Post subject:
Re: mdview, a markdown viewer ready for global use |
|
L18L wrote: | Cannot use ( ) in text.
Replaced it by --....-- |
Ah yes, because the ")" will end the $( prematurely. As I said the code is simple and stupid. Let me see if I can make it smarter. I'll be back.
Quote: | Sorry if have killed an apostrophe without real need.
$(gettext 'here apostrophe can't be used')
$(gettext 'here apostrophe can\'t be used')
$(gettext "here apostrophe can be used")
review text please.
|
In this case, you will need to do
$(gettext 'here apostrophe can '\''be used')
That is, you end the single-quote, add a \', and then start the single-quote again. Tthe same way how you single-quote strings in shell, too.
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3445 Location: www.eussenheim.de/
|
Posted: Mon 04 May 2015, 14:53 Post subject:
Re: mdview, a markdown viewer ready for global use |
|
jamesbond wrote: | I'll be back. |
No sleep tonight?
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3207 Location: The Blue Marble
|
Posted: Mon 04 May 2015, 15:56 Post subject:
Re: mdview, a markdown viewer ready for global use |
|
L18L wrote: | No sleep tonight?  | Try it. Attached test cases in examples.
_________________ Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
|
Back to top
|
|
 |
|