Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 12 Nov 2019, 20:13
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
mdview, a markdown viewer
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 5 [63 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
L18L

Joined: 19 Jun 2010
Posts: 3450
Location: www.eussenheim.de/

PostPosted: Tue 05 May 2015, 13:32    Post subject: Re: mdview, a markdown viewer ready for global use  

jamesbond wrote:
Try it.

Tried.
All right.
Going to convert entire FAQ to mdview..... Wink

Help can be launched by:
Code:
export TEXTDOMAIN=fatdoghelp; mdview -x  /usr/share/doc/faqs ../home.md "" "Fatdog"
for now.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3450
Location: www.eussenheim.de/

PostPosted: Sun 10 May 2015, 04:56    Post subject: Re: mdview, a markdown viewer ready for global use  

L18L wrote:
Going to convert entire FAQ to mdview.....
done
see Fatdog thread please.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3450
Location: www.eussenheim.de/

PostPosted: Tue 12 May 2015, 09:27    Post subject: Re: mdview, a markdown viewer ready for global use
Subject description: without "export TEXTDOMAIN=fatdoghelp"
 

Fatdog64's docs/faq are going to use this markdown format,
extension .md, to be viewed with mdview.

In order to enable SURE translations we are using GNU gettext.

gettext has 2 parameters:
1st is textdomain, (name of the .mo file)
2nd is the translatable message string (msgstr).
If it is one paramter only
then environment variable TEXTDOMAIN is being used.

Example:
Code:
$(gettext fatdoghelp "The VLC media player in Fatdog64 can support BluRay playback.")


Space is cheap but there is no reason for wasting bytes.

Code:
alias _=gettext

usually used with C sources would be nice
but does not work because _ is a markdown tag
and alias cannot be used in mdview AFAIK.

But this little wrapper /usr/bin/t_ does work:

Code:
#!/bin/sh
gettext fatdoghelp "$1"; echo


... and above line is just:

Code:
$(t_ "The VLC media player in Fatdog64 can support BluRay playback.")

___________________________________

How much saved?
About
Code:
$((16 * `grep msgid fatdoghelp.pot | wc -l` / 1024))
= 23 kB.
Not that much but it is looking much nicer.
___________________________________

Speed?

Or an implementation of alias (alias t_=gettext) in mdview?
Code:
$(t_ fatdoghelp"The VLC media player in Fatdog64 can support BluRay playback.")

___________________________________

poor man's solution?

Or maybe just renaming the textdomain?
Code:
$(gettext fh "The VLC media player in Fatdog64 can support BluRay playback.")

___________________________________

Or both?
Code:
$(t_ fh "The VLC media player in Fatdog64 can support BluRay playback.")

___________________________________

Your choice.
___________________________________
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Tue 12 May 2015, 15:50    Post subject:  

https://github.com/visionmedia/mad
Guys, have you considered compatibility with mad?

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Tue 12 May 2015, 22:29    Post subject:  

Hi, guys.

This viewer looks absolutely splendid, except for the obvious:
Maybe I'm missing a nut and a bolt (which is entirely likely!), Smile but:

what editor do you use to create the marked text to be viewed? Shocked

Thanks in advance.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Tue 12 May 2015, 23:44    Post subject:  

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...

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Tue 12 May 2015, 23:55    Post subject:  

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

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3450
Location: www.eussenheim.de/

PostPosted: Wed 13 May 2015, 04:42    Post subject: mdview, a markdown viewer
Subject description: ready for global use
 

musher0 wrote:
what editor do you use to create the marked text...

As quoted by disciple "use any text editor": I am using geany.

musher0 wrote:
... to be viewed?


This text is to be viewed by (surprise): see title of this thread and initial post.

Using this we do need neither web server nor web browser for (run time translated) help files.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 May 2015, 12:03    Post subject: Re: mdview, a markdown viewer
Subject description: ready for global use
 

L18L wrote:
musher0 wrote:
what editor do you use to create the marked text...

As quoted by disciple "use any text editor": I am using geany.

musher0 wrote:
... to be viewed?


This text is to be viewed by (surprise): see title of this thread and initial post.

Using this we do need neither web server nor web browser for (run time translated) help files.


Wrong cut of sentence, Mister L18L Translator.
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
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 May 2015, 12:06    Post subject:  

Almost forgot:
geany's markdown plugin is in limbo, but jEdit and gedit have working ones.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 May 2015, 12:13    Post subject:  

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.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 May 2015, 12:31    Post subject:  

Finally, substance: Smile
Proper description of the markdown language
Proper cheatsheet for the markdown language
Phew. Now this thread is level again.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14451
Location: Gatineau (Qc), Canada

PostPosted: Wed 13 May 2015, 13:07    Post subject:  

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
markdown.html.zip
Description 
zip

 Download 
Filename  markdown.html.zip 
Filesize  918 Bytes 
Downloaded  232 Time(s) 

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3372
Location: The Blue Marble

PostPosted: Wed 13 May 2015, 13:14    Post subject:  

@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):
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, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Wed 13 May 2015, 15:47    Post subject:  

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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 5 [63 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0675s ][ Queries: 12 (0.0140s) ][ GZIP on ]