Re: Styling Markdown approaches

2013-05-02 Thread Aristotle Pagaltzis
* Sherwood Botsford sgbotsf...@gmail.com [2013-04-20 16:20]:
 It's actually worse than that, because for me MMD is actually a module
 in Template Toolkit. So my information is MD markup wrapped in
 a preface and epilog of template toolkit.

[% FILTER replace('[^/][^]*\K', ' markdown=1') # Perl 5.10+ required for 
\K %]
div
*Hooray!!*
/div
[% END %]
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-20 Thread Sherwood Botsford
I love standards.  There are so many to choose from.

Yes the core of MD is similar.  But there are enough edge cases that you
cannot count on being able to take MD from one location and using it at
another.  I would prefer to be able to control this behaviour either with a
configuration file, or inline material, rather than having to edit the
markup for each file itself.  Doing it inline, means that in theory for
each tweak there is a configuation value that follows the 'standard' (such
as it isn't) and a value for the tweak.

In the archives of this list there are records of many items discussing
where Gruber's spec was ambiguous.And the canonical code doesn't make
html that validates, as loose tags are surrounded by P tags.

Fork my own? I've done that.  I have the older CPAN version of MMD and have
hacked the default value of the markdown flag so that it is 1 all the
time.  It's a crummy hack.   I have to redo it every time I update my CPAN
library for a new version of Perl.


I write web pages.  I went to MD because it minimized the amount of
repetitive markup I was doing.

Will it bite me?  Quite possibly.  But my MD files are not public access.

It's actually worse than that, because for me MMD is actually a module in
Template Toolkit.  So my information is MD markup wrapped in a preface and
epilog of template toolkit.  Included file in the TT portion create my
static menu. Portable? No.  But the result is a static page, without
javascript (except for google analytics) that loads blindingly fast, and
allows me to use a shared server without worrying about CPU contention.

But it would be a 3 hour hack to write a script to strip the TT wrapper
off, another hack to explicityly put in the markdown=1 flags.  But
meanwhile I have cleaner looking markup.

However, I won't try to convert anyone.  Several people have spoken
eloquently that this is a Bad Thing (tm) and no one has agreed.  I must
abide by the Will of the People, and withdraw to the Cave of the
Curmudgeons.

Respectfully,

Sherwood of Sherwood's Forests

Sherwood Botsford
Sherwood's Forests --  http://Sherwoods-Forests.com
780-848-2548
50042 Range Rd 31
Warburg, Alberta T0C 2T0



On 19 April 2013 20:22, Michel Fortin michel.for...@michelf.ca wrote:

 Le 19-avr.-2013 à 17:00, Sherwood Botsford sgbotsf...@gmail.com a écrit
 :

  That particular cat is out of the bag, however, and we have a score of
  implementations.  From all apparent discussion here, there is no
 particular
  urge for the writers to get together to reduce the implementations.  So
 we
  have 20 document formats already.  And not all the implementers are
  concerned with backward compatibility.
 
  The same can be said of html and CSS.  CSS configures how the html is
  rendered.  So CMD could configure the way MD is rendered.

 CSS doesn't change how the HTML is parsed, only how it looks (and sometime
 how it behaves). Similarly, configuration options in a Markdown parser that
 let you adjust *the output* to your linking are very welcome.

 As for all the implementations, they mostly vary in edge cases and in
 their extensions to the core syntax. The core Markdown syntax (as defined
 by John Gruber) is pretty much the same everywhere, and this includes how
 HTML blocks are parsed. Implementations doing things differently than core
 Markdown are doing it mostly by adding restrictions out of security
 concerns with user-generated content.

 By the way, if you really feel like it you should go ahead and hack your
 preferred implementation to do what you want. Just keep in mind that your
 documents using this tweaked syntax feature won't work right with other
 implementations. This might or might not come to bite you in the future
 depending on what you intend to do with those documents.


 --
 Michel Fortin
 michel.for...@michelf.ca
 http://michelf.ca/

 ___
 Markdown-Discuss mailing list
 Markdown-Discuss@six.pairlist.net
 http://six.pairlist.net/mailman/listinfo/markdown-discuss

___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-20 Thread Paul Wilson
With respect to Aristotle Pagaltzis, I have to disagree, at least in part.

Markdown is two things - a document format and some code to process text
written in Markdown format into a different format, often HTML.

Using a configuration file to adjust the actions of the code seems to me to
be a perfectly reasonable approach, and I can't see how it will result in
broken documents. Depending on what the config file holds, and what changes
you make to the values, the output may look somewhat different, but broken?
That seems a bit harsh.

In fact you can likely change the the output by using a different library.
As the discussions here illustrate, there is no bible for Markdown, just a
number of similar but usually not identical options. If you want to change
the appearance, changing the CSS is another option.

A config file suits my personal preference for packages, so I'd probably
use one happily, but I recognise that others will differ. In the end I
rarely use Markdown, but I have incorporated some of the ideas that I've
seen into the system that I prefer - and that's driven by a configuration
file.

Regards,
Paul
-- 
Software - secure, cheap, quick - choose any two
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-20 Thread Kai Hendry
On 20 April 2013 16:43, Paul Wilson pw6...@gmail.com wrote:
 you make to the values, the output may look somewhat different, but broken?
 That seems a bit harsh.

My markdown doesn't have this div markdown=1 option and this is what
it looks like:
http://s.natalian.org/2013-04-20/1366474134_1366x768.png

Yes you can probably parse the content, but it looks broken to
everyone else. Doesn't compare to HTML's degrade gracefully
paradigm.

 In fact you can likely change the the output by using a different library.
 As the discussions here illustrate, there is no bible for Markdown, just a
 number of similar but usually not identical options. If you want to change
 the appearance, changing the CSS is another option.

Er, it's really hard to id and class markdown without div markdown=1
support for example. Perhaps I've misunderstood you. I did find the
markdown + options analogy to html + css pretty awful.

 A config file suits my personal preference for packages, so I'd probably use
 one happily, but I recognise that others will differ. In the end I rarely
 use Markdown, but I have incorporated some of the ideas that I've seen into
 the system that I prefer - and that's driven by a configuration file.

I think you are totally missing the interoperability argument here. It
might be great for you, but if you are investing a lot of effort into
putting stuff in markdown, you need interoperability. Just imagine if
say the markdown corpus of German laws
https://github.com/bundestag/gesetze forked markdown so much you
needed their special interpreter in order to read it easily? That
would be ridiculous.

I'm already super pissed that neither Debian's default markdown, nor
pagedown nor https://github.com/Gottox/smu supports div markdown=1.
I guess I'll work around it, by keeping to the lowest common
denominator, and accommodate different styled sections differently
(spawn new pagedown textarea and preview) in my silly editor tool
thingie: word sister. https://github.com/kaihendry/wordsister

Kind regards,
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-20 Thread Waylan Limberg
I think the syntax rules regarding raw html [1] shed some light on this issue:

 Markdown is not a replacement for HTML, or even close
 to it. Its syntax is very small, corresponding only to a very
 small subset of HTML tags. The idea is not to create a
 syntax that makes it easier to insert HTML tags. In my
 opinion, HTML tags are already easy to insert. The idea
 for Markdown is to make it easy to read, write, and edit
 prose. HTML is a publishing format; Markdown is a writing
 format. Thus, Markdown’s formatting syntax only addresses
 issues that can be conveyed in plain text.

 For any markup that is not covered by Markdown’s syntax,
 you simply use HTML itself. There’s no need to preface it
 or delimit it to indicate that you’re switching from Markdown
 to HTML; you just use the tags.

In other words, if you want a *publishing* format, use  raw HTML. If
you want to wrap some text in a div to add styling hooks, fine. But if
you want to format the contents of that div, then use HTML for that
also. After all, Markdown is not a replacement for HTML.

Yes, some markdown implementations have added some optional extras,
but those extras generally fit into the philosophy quoted above (see
definition lists). That said, I have seen some pretty horrid requests
for extending the syntax as the maintainer of the Python-Markdown
project (which has an extensive API for writing extensions). While I
agree that user defined extensions are an appropriate way to go, one
should always be careful when introducing new syntax. John
MacFarlane's FAQ [2] is evidence of that.

[1]: http://daringfireball.net/projects/markdown/syntax#html
[2]: http://johnmacfarlane.net/babelmark2/faq.html

--

\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-19 Thread Aristotle Pagaltzis
* Sherwood Botsford sgbotsf...@gmail.com [2013-04-18 17:20]:
 (I wish that this was a toggle that could be set in a .mmdrc file.
 There are a lot of things that I wish I could set in an .mmdrc file.)

That would be bad for Markdown.
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-19 Thread Sherwood Botsford
Why?

Most reasonably powerful unix commands have some combination of command
line or startup files to control behavior.

At the present stage when someone wants something new, they have to fork
their least unfavorite version, and tweak it to their purpose.




Respectfully,

Sherwood of Sherwood's Forests

Sherwood Botsford
Sherwood's Forests --  http://Sherwoods-Forests.com
780-848-2548
50042 Range Rd 31
Warburg, Alberta T0C 2T0



On 19 April 2013 05:25, Aristotle Pagaltzis pagalt...@gmx.de wrote:

 * Sherwood Botsford sgbotsf...@gmail.com [2013-04-18 17:20]:
  (I wish that this was a toggle that could be set in a .mmdrc file.
  There are a lot of things that I wish I could set in an .mmdrc file.)

 That would be bad for Markdown.
 ___
 Markdown-Discuss mailing list
 Markdown-Discuss@six.pairlist.net
 http://six.pairlist.net/mailman/listinfo/markdown-discuss

___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-19 Thread Michel Fortin
Le 19-avr.-2013 à 17:00, Sherwood Botsford sgbotsf...@gmail.com a écrit :

 That particular cat is out of the bag, however, and we have a score of
 implementations.  From all apparent discussion here, there is no particular
 urge for the writers to get together to reduce the implementations.  So we
 have 20 document formats already.  And not all the implementers are
 concerned with backward compatibility.
 
 The same can be said of html and CSS.  CSS configures how the html is
 rendered.  So CMD could configure the way MD is rendered.

CSS doesn't change how the HTML is parsed, only how it looks (and sometime how 
it behaves). Similarly, configuration options in a Markdown parser that let you 
adjust *the output* to your linking are very welcome.

As for all the implementations, they mostly vary in edge cases and in their 
extensions to the core syntax. The core Markdown syntax (as defined by John 
Gruber) is pretty much the same everywhere, and this includes how HTML blocks 
are parsed. Implementations doing things differently than core Markdown are 
doing it mostly by adding restrictions out of security concerns with 
user-generated content.

By the way, if you really feel like it you should go ahead and hack your 
preferred implementation to do what you want. Just keep in mind that your 
documents using this tweaked syntax feature won't work right with other 
implementations. This might or might not come to bite you in the future 
depending on what you intend to do with those documents.


-- 
Michel Fortin
michel.for...@michelf.ca
http://michelf.ca/

___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-18 Thread Kai Hendry
Since folks with considerably more influence than myself have tried
(and failed?) to standardise markdown:
http://www.codinghorror.com/blog/2012/10/the-future-of-markdown.html

I think I need to rethink my approach of using Pagedown.
https://code.google.com/p/pagedown/

Are there editors that basically expand markdown input into HTML in
the textarea I wonder?

The big saving for Markdown for me is just auto-wrapping paragraphs.
Nice bullet point making. Nicer link making actions, e.g.

* foo CR

becomes

lifoo/li

after returning the carriage return. Or perhaps asking people to
highlight a region. Which in turns gets churned into HTML.

Anyway, just a brain fart on how I can possibly get out of this mixing
HTML  Markdown quagmire.
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Styling Markdown approaches

2013-04-18 Thread Sherwood Botsford
There is a babel markdown web site that you can see how various dialects
convert markup.

The only html I use in on my website now is the div tag, usually with a
class or ID.  This controls my layout.  MMD has sufficient table handling
for my purposes.

So for me, my MD looks like this:

# This is a title
## And a subtitle underneath it.

This is intoductory text on my page

DIV class=picr4

![Image alternate text](http://path/to/Image)

caption to the image above, explaining it's relevance to the main text

***
/div

Class picr4 is styled to float right, and be 40% of the width of the
container.  I have a half dozen classes.  Caption text is styled with
.picr4 p {  so that it is visually distinct from the body text

So far I've not found much else that I need.



I don't think you want to make changes insitu.  However take a look at
stackexchange.com  They use a subset of MD as their site markup language
for user replies, and they compose MD in one window and display it in
another.  It's a good way to do this for interactive use.

Respectfully,

Sherwood of Sherwood's Forests

Sherwood Botsford
Sherwood's Forests --  http://Sherwoods-Forests.com
780-848-2548
50042 Range Rd 31
Warburg, Alberta T0C 2T0



On 18 April 2013 09:52, Kai Hendry hen...@iki.fi wrote:

 Since folks with considerably more influence than myself have tried
 (and failed?) to standardise markdown:
 http://www.codinghorror.com/blog/2012/10/the-future-of-markdown.html

 I think I need to rethink my approach of using Pagedown.
 https://code.google.com/p/pagedown/

 Are there editors that basically expand markdown input into HTML in
 the textarea I wonder?

 The big saving for Markdown for me is just auto-wrapping paragraphs.
 Nice bullet point making. Nicer link making actions, e.g.

 * foo CR

 becomes

 lifoo/li

 after returning the carriage return. Or perhaps asking people to
 highlight a region. Which in turns gets churned into HTML.

 Anyway, just a brain fart on how I can possibly get out of this mixing
 HTML  Markdown quagmire.
 ___
 Markdown-Discuss mailing list
 Markdown-Discuss@six.pairlist.net
 http://six.pairlist.net/mailman/listinfo/markdown-discuss

___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss