mdview, a markdown viewer
Markdown is very simple - use any text editor. In fact it's questionable whether it even needs a specialist "viewer", let alone an "editor".
Otherwise maybe you should try google if you want to find an editor with preview ability or special buttons so you don't have to type in your formatting or something...
Otherwise maybe you should try google if you want to find an editor with preview ability or special buttons so you don't have to type in your formatting or something...
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Thanks, disciple.
In the meantime, I found John Gruber's "Daring Fireball" site, which explains
this mini formating language and how to use it:
http://daringfireball.net/projects/markdown/basics
BFN.
musher0
In the meantime, I found John Gruber's "Daring Fireball" site, which explains
this mini formating language and how to use it:
http://daringfireball.net/projects/markdown/basics
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
mdview, a markdown viewer
As quoted by disciple "use any text editor": I am using geany.musher0 wrote:what editor do you use to create the marked text...
This text is to be viewed by (surprise): see title of this thread and initial post.musher0 wrote: ... to be viewed?
Using this we do need neither web server nor web browser for (run time translated) help files.
Re: mdview, a markdown viewer
Wrong cut of sentence, Mister L18L Translator.L18L wrote:As quoted by disciple "use any text editor": I am using geany.musher0 wrote:what editor do you use to create the marked text...
This text is to be viewed by (surprise): see title of this thread and initial post.musher0 wrote: ... to be viewed?
Using this we do need neither web server nor web browser for (run time translated) help files.
Ok I'll write it as in German: "MarkedTextToBeViewed" or
Marked-Text-To-Be-Viewed": as an entire and single concept.
And thanks for your usual trampling of my ideas.
Anyway, this entire thread is flawed because it contains no indication
as to how to produce the markdown text itself.
Where is the "legend" of this markdown language? Aside from Gruber's
site, which is not that clear. Hey, even maps have legends.
Where is a clear code for this markdown language? Hey, Morse Code is
clear, for example. LaTEX code is pretty clear too. This? Not so sure.
So IMO this entire thread is flawed because everyone is commenting on
the "view" side of it. Everyone is bowing to jamesbond with oooh's and
aaah's, but no one seems to have a clue about the "writing" side of it.
It stands to logic that if someone here doesn't provide the "code" or the
"legend" for this language, no text will be written in it, and there will be
nothing to use jamesbond's viewer with.
Until then: ha! this thread is completely pointless.
Sorry for being so frank.
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Untested converter
I'm still looking for a clear table of the markdown code, but at least I can
use Mark McCahill's pandoc-online above to convert text from whatever
format to markdown.
BFN.
I'm still looking for a clear table of the markdown code, but at least I can
use Mark McCahill's pandoc-online above to convert text from whatever
format to markdown.
BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Finally, substance:
Proper description of the markdown language
Proper cheatsheet for the markdown language
Phew. Now this thread is level again.
Proper description of the markdown language
Proper cheatsheet for the markdown language
Phew. Now this thread is level again.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Hello all.
Attached is more "meat" on the markdown language, in html format.
(Just unzip and load in your browser.)
Of interest: the snip2code site has many markdown "snips" for those
who learn better by example.
https://www.snip2code.com/Explore/Public?q=markdown
I also chanced upon a reallly good markdown editor on-line.
https://stackedit.io/editor
(Sorry, the forum does not process https URLs.)
Enjoy.
musher0
Attached is more "meat" on the markdown language, in html format.
(Just unzip and load in your browser.)
Of interest: the snip2code site has many markdown "snips" for those
who learn better by example.
https://www.snip2code.com/Explore/Public?q=markdown
I also chanced upon a reallly good markdown editor on-line.
https://stackedit.io/editor
(Sorry, the forum does not process https URLs.)
Enjoy.
musher0
- Attachments
-
- markdown.html.zip
- (918 Bytes) Downloaded 309 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
@disciple: Guys, have you considered compatibility with mad?
Interesting link, thanks. "mad" seems to be a markdown-to-tty-text converter, useful if you want to view markdowns in console without GUI. It also supports a subset of markdown (mdview supports a slightly larger subset), so I guess in a way it is already compatible. mdview does not have the automatic search for mad-pages though; a simple script should be able to simulate that.
@musher0: "In the meantime, I found John Gruber's "Daring Fireball" site, which explains ..."
John Gruber is the creator of the Markdown format, and his website should be considered as authoritative (though I agree perhaps not the most clear). John supplies a markdown-to-HTML converter on that site, and anything that claims to be Markdown-compliant must produce the same output as John's converter.
That being said, mdview only supports a limited subset of the format, and what little it supports is given in its example/index.md file.
@musher0: "It stands to logic that if someone here doesn't provide the "code" or the "legend" for this language".
Yes, I am guilty of this. I should have linked John's page in the first post. I forgot that not everybody is familiar with markdown. I will edit the first post.
disciple and L18L have responded to you about the editor, but since you have found John's page, I may as well quote from it (emphasis mine):
@musher0: "... pandoc-online above to convert text from whatever format to markdown ..."
Markdown is not a *target* format, it is a *source* format. The idea is you don't convert whatever *to* markdown; instead, you *write* in markdown and convert it to something else (mdview is in fact a "markdown-to-pango-formatted text" converter, and the engine behind it can be used to convert markdown to HTML too). Another point is that even if there is no viewer available, the source markdown documents are easy to read as plain text.
Markdown (especially the subset used in mdview) is easy to write because it simply reflects how people usually write emails.
Thanks for the other links about markdowns.
Interesting link, thanks. "mad" seems to be a markdown-to-tty-text converter, useful if you want to view markdowns in console without GUI. It also supports a subset of markdown (mdview supports a slightly larger subset), so I guess in a way it is already compatible. mdview does not have the automatic search for mad-pages though; a simple script should be able to simulate that.
@musher0: "In the meantime, I found John Gruber's "Daring Fireball" site, which explains ..."
John Gruber is the creator of the Markdown format, and his website should be considered as authoritative (though I agree perhaps not the most clear). John supplies a markdown-to-HTML converter on that site, and anything that claims to be Markdown-compliant must produce the same output as John's converter.
That being said, mdview only supports a limited subset of the format, and what little it supports is given in its example/index.md file.
@musher0: "It stands to logic that if someone here doesn't provide the "code" or the "legend" for this language".
Yes, I am guilty of this. I should have linked John's page in the first post. I forgot that not everybody is familiar with markdown. I will edit the first post.
disciple and L18L have responded to you about the editor, but since you have found John's page, I may as well quote from it (emphasis mine):
John Gruber wrote:The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.
@musher0: "... pandoc-online above to convert text from whatever format to markdown ..."
Markdown is not a *target* format, it is a *source* format. The idea is you don't convert whatever *to* markdown; instead, you *write* in markdown and convert it to something else (mdview is in fact a "markdown-to-pango-formatted text" converter, and the engine behind it can be used to convert markdown to HTML too). Another point is that even if there is no viewer available, the source markdown documents are easy to read as plain text.
Markdown (especially the subset used in mdview) is easy to write because it simply reflects how people usually write emails.
Thanks for the other links about markdowns.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
Yes, mad is a replacement for the classic 'man', which traditionally isn't included in Puppy. But if you're using a markdown based help you could include mad as well.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
run action
Excellent.01micko wrote:How about a run action?
text_x-markdown (replace the current symlink in fatdog)Code: Select all
#!/bin/sh DIR=${@%/*} FILE=${@##*/} HOME=$FILE TITLE=${FILE%.*} mdview $DIR $FILE "$HOME" "$TITLE"
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
Extended for use in Fatdog's Help-Home&FAQ:
Code: Select all
#! /bin/sh
DIR=${@%/*}
FILE=${@##*/}
TITLE=${FILE%.*}
case $DIR in
/usr/share/doc/faqs) # fd64-701
HOME=index.md
TEXTDOMAIN=fatdoghelp mdview -x $DIR $FILE "$HOME" "$TITLE"
;;
*)
HOME=$FILE
mdview $DIR $FILE "$HOME" "$TITLE"
;;
esac
Dunno what on earth I was thinking ( ), but maybe $HOME should be something else as to not cause conflict with the environmental variable, user's $HOME.
Puppy Linux Blog - contact me for access
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
mdview, a markdown viewer
Maybe it is not always necessary to think much01micko wrote:Dunno what on earth I was thinking ( ), but maybe $HOME should be something else as to not cause conflict with the environmental variable, user's $HOME.
I had not noticed any conflict.
This HOME is mdview s Home (just the icon I am thinking now).
In Fatdog Help the Home icon refers to index.md
and Home has to be a link of its own....
Another non issue: TEXTDOMAIN does work without being exported.
- Attachments
-
- HOME.png
- LOL
- (15.46 KiB) Downloaded 562 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: mdview, a markdown viewer
Yes you are right!L18L wrote:Maybe it is not always necessary to think much01micko wrote:Dunno what on earth I was thinking ( ), but maybe $HOME should be something else as to not cause conflict with the environmental variable, user's $HOME.
I had not noticed any conflict.
There is a conflict of course.
I have renamed HOME to thisHOME
... and added README
my /etc/xdg/rox.surceforge.net/MIME-types/text_x-markdown wrote:#! /bin/sh
DIR=${@%/*}
FILE=${@##*/}
TITLE=${FILE%.*}
thisHOME=$FILE
case $FILE in
README*)
mdview -x $DIR $FILE "$thisHOME" "$TITLE"
;;
esac
case $DIR in
/usr/share/doc/faqs)
thisHOME=index.md
TITLE=Fatdog64
TEXTDOMAIN=fatdoghelp mdview -x $DIR $FILE "$thisHOME" "$TITLE"
;;
*)
mdview $DIR $FILE "$thisHOME" "$TITLE"
;;
esac
- Attachments
-
- README.md.png
- (39.81 KiB) Downloaded 546 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
mdview, a markdown viewer
Suggest this /etc/xdg/rox.surceforge.net/MIME-types/text_x-markdown:
tested with translated README.md
LIESMICH.md symlinked
Code: Select all
#! /bin/sh
[ $(readlink $@) ] && FILE=$(readlink $@) || FILE=$@
DIR=${@%/*}
FILE=${FILE##*/}
TITLE=${FILE%.*}
thisHOME=$FILE
thisTEXTDOMAIN=$TEXTDOMAIN
case $FILE in
README*)
TITLE=${@%.*}
thisTEXTDOMAIN=README
;;
esac
case $DIR in
/usr/share/doc/faqs)
thisHOME=index.md
TITLE=Fatdog64
thisTEXTDOMAIN=fatdoghelp
;;
esac
TEXTDOMAIN=$thisTEXTDOMAIN mdview -x $DIR $FILE "$thisHOME" "$TITLE"
LIESMICH.md symlinked
- Attachments
-
- README_gettexted.png
- (25.97 KiB) Downloaded 661 times
Following suggestion by disciple, the latest fossil version of mdview now supports output to console (stdout), as plain text (--text), text with vt100 codes (bold/color, works with urxvt/xterm/console) (--tty), and as html (--html); so in a way it is now compatible with "mad" (or in other words, subsumes "mad" functionality for converting markdown to decorated text).
Pipe --tty output to "less -R" for paging, if wished.
Pipe --tty output to "less -R" for paging, if wished.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
Great. Markdown was also born to be neat and readable on terminals. This feature makes a lot of sense. Thanks.jamesbond wrote:Following suggestion by disciple, the latest fossil version of mdview now supports output to console (stdout), as plain text (--text), text with vt100 codes (bold/color, works with urxvt/xterm/console) (--tty), and as html (--html); so in a way it is now compatible with "mad" (or in other words, subsumes "mad" functionality for converting markdown to decorated text).
Pipe --tty output to "less -R" for paging, if wished.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
- charlie6
- Posts: 1230
- Joined: Mon 30 Jun 2008, 04:03
- Location: Saint-Gérard / Walloon part of Belgium
GLIB error opening html files
Hi jamesbond,
i got mdview compiled on wheezy-3.5.2.11;
it opens the .md file coming with the tarball file (file.md, README.md, index.md)
i'd hope to open html files as the ones present in /usr/share/doc using the following command line:
although this displays the raw pburn.html:
I might have missed something...
Could you help me please ?
Thanks in advance
Charlie
i got mdview compiled on wheezy-3.5.2.11;
it opens the .md file coming with the tarball file (file.md, README.md, index.md)
i'd hope to open html files as the ones present in /usr/share/doc using the following command line:
Code: Select all
# mdview --html /usr/share/doc/ pburn.html
(process:29936): GLib-GObject-CRITICAL **: /build/buildd-glib2.0_2.33.12+really2.32.4-5-i386-eISom6/glib2.0-2.33.12+really2.32.4/./gobject/gtype.c:2722: You forgot to call g_type_init()
(process:29936): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
(process:29936): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed
^C
Code: Select all
# mdview -x /usr/share/doc pburn.html
Could you help me please ?
Thanks in advance
Charlie
- Attachments
-
- mdview_pbrun.dothtml.jpg
- # mdview -x /usr/share/doc pburn.html
- (38.84 KiB) Downloaded 576 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: GLIB error opening html files
Hi charlie6,
html is markup language
and md means mark down which is much simpler.
You might have expected to get an html viewer.
But it is a md viewer.
mdview --html generates fragments of html.
If you like to see pburn in markdown see attached file.
(It was just fun to copy it from browser into the .md file and do a few modifications)
html is markup language
and md means mark down which is much simpler.
You might have expected to get an html viewer.
But it is a md viewer.
mdview --html generates fragments of html.
If you like to see pburn in markdown see attached file.
(It was just fun to copy it from browser into the .md file and do a few modifications)
- Attachments
-
- pburn.md.gz
- remove fake .gz and have fun
- (14.99 KiB) Downloaded 390 times