Re: does fireball markdown support anchor links?

2015-07-09 Thread Aristotle Pagaltzis
* Michel Fortin michel.for...@michelf.ca [2015-07-09 16:20]:
 I'm not providing this function out of the box for a few reasons: 1.
 any specific algorithm to generate the id to is going to make some
 people complain about non-compatibility with another implementation,
 and 2. it's quite hard to come with something that'll work well with
 non-english text.

There’s also another important reason:

Markdown is used for document fragments that get combined into a single
web page, much more often than it is used for standalone, single full
page documents. E.g. the front page of a weblog with excerpts from
multiple articles; comments in a thread on Reddit, or on GitHub; etc.

But anchors must be unique.

The Markdown processor alone does not have enough information and state
to generate sufficiently unique anchors in such an environment. So, if
automatically generated anchors are desired, their derivation *must* be
performed by code from the environment which has sufficient information
to be able to do that.

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
https://pairlist6.pair.net/mailman/listinfo/markdown-discuss


re: does fireball markdown support anchor links?

2015-07-09 Thread bowerbird via Markdown-Discuss
aristotle, your mockery entertains me immensely.

-bowerbird

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


Re: Markdown-Discuss Digest, Vol 148, Issue 3

2015-07-09 Thread Alice Williams
: text/plain; charset=utf-8

 Le 2015-07-09 ? 0:30, Alan Hogan cont...@alanhogan.com a ?crit :
  Furthermore, auto-gen'd headers *will* break when the text of the header
 is changed, which can be done for any number of innocuous reasons when we
 would like the link to be preserved. (Cool URIs don?t change, right?)
 
  For that reason, I have always been a fan of the ID specification syntax
 that pandoc, PHP Markdown Extra, maruku, kramdown, and a few others support:
 
## This is a header {#a-header}
 
  which compiles to:
 
h2 id=a-headerThis is a header/h2
 
  Look at that! Cleaner Markdown *and* cleaner output than inserting your
 own a tag. And better, more future-proof section IDs than the
 auto-generated variety.
 
  Sadly, I never get to use it, due to the regrettable and totally
 predictable fact that so many Markdown converters ignore it.
 
  Not to pick on showdown, but look at its output:
  h2 id=thisisaheaderaheaderThis is a header {#a-header}/h2

 Yeah, this is sad.

 I'll just point out that PHP Markdown Extra does support automatic
 generation of headers id as long as you provide it with a proper function
 to generate the id from the content of the header. For instance, you can
 configure the parser like this:

 $parser-header_id_func = function ($text) {
 return preg_replace('/[^a-z0-9]/', '-', strtolower($text));
 };

 I'm not providing this function out of the box for a few reasons: 1. any
 specific algorithm to generate the id to is going to make some people
 complain about non-compatibility with another implementation, and 2. it's
 quite hard to come with something that'll work well with non-english text.

 Just try it with accented characters and non-latin scripts and appreciate
 the nonsense.
 http://johnmacfarlane.net/babelmark2/?normalize=1text=%23+English%0A%0A%23+Fran?ais%0A%0A%23+Espa?ol%0A%0A%23+?e?tina%0A%0A%23+???%0A%0A%23+??%0A%0A%23+??%0A%0A%23+???%E2%80%8E%E2%80%8E%0A%0A%23+???
 ??

 Honestly, I find the {#a-header} approach better.

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

 -- next part --
 A non-text attachment was scrubbed...
 Name: smime.p7s
 Type: application/pkcs7-signature
 Size: 4939 bytes
 Desc: not available
 URL: 
 https://pairlist6.pair.net/pipermail/markdown-discuss/attachments/20150709/3da77f0a/attachment-0001.bin
 

 --

 Message: 3
 Date: Thu, 9 Jul 2015 11:56:40 -0700
 From: Alice Williams awilli...@machinezone.com
 To: markdown-discuss@six.pairlist.net
 Subject: How to create anchors in Fireball version of Markdown?(gitlab
 version links do not work)
 Message-ID:
 CAFhkAKOBQEfR=
 fuwf3yhootkc7_xqvjyaxkqhw+i9bdj6nq...@mail.gmail.com
 Content-Type: text/plain; charset=utf-8

 Hi all,

 Just curious if anyone knows how to get anchor links to work with Fireball
 version of Markdown. (The Gitlab standard Markdown achieves anchor links
 like this (but Fireball version does not support this format):

 [link text](#anchor)

 This anchor link does not work with Fireball version.

 Does anyone know how to create Fireball Markdown anchors?

 Thanks,
 Alice
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 https://pairlist6.pair.net/pipermail/markdown-discuss/attachments/20150709/b8b044f2/attachment-0001.html
 

 --

 Message: 4
 Date: Thu, 09 Jul 2015 15:16:32 -0400
 From: Fletcher T. Penney fletc...@fletcherpenney.net
 To: Discussion related to Markdown.
 markdown-discuss@six.pairlist.net
 Subject: Re: How to create anchors in Fireball version of
 Markdown?(gitlab version links do not work)
 Message-ID: 559ec890.4030...@fletcherpenney.net
 Content-Type: text/plain; charset=windows-1252; format=flowed

 I think you need to be more precise in your question.  I tried to flesh
 it out in my prior response, but perhaps I failed.

 The link you describe:

 [link text](#anchor)

 works just fine in any version of Markdown.  It's just a regular link.

 I suspect the problem you are having, as per my other message, is that
 you need something for the link to target.  If an anchor named
 #anchor doesn't exist, that's a separate problem.


 The various replies to your earlier message all suggested ways of
 creating the necessary anchor that would work.

 If those replies did not answer your question, then perhaps you could
 more precisely specify the HTML output you are getting and the HTML
 output you are expecting.


 Fletcher



 On 7/9/15 2:56 PM, Alice Williams wrote:
  Hi all,
 
  Just curious if anyone knows how to get anchor links to work with
  Fireball version of Markdown. (The Gitlab standard Markdown achieves
  anchor links like this (but Fireball version does not support this
 format):
 
  [link text](#anchor)
 
  This anchor link does not work with Fireball version.
 
  Does anyone know how to create Fireball Markdown anchors

markua -- a new flavor for long-form documents

2015-07-09 Thread bowerbird via Markdown-Discuss
some of you probably know that
leanpub.com has been creating
a new flavor targeted at books,
which they are calling markua.

their in-progress documentation:
   https://github.com/markuadoc/markua

here's a little javascript thing to
pull all of the chapters together:

   http://zenmagiclove.com/simple/do-markua.html

that uses marky, brett terpstra's
rad web-based converter, which
in turn uses multimarkdown, so
the resultant .html will _not_ be
accurate according to markua...
but it will give you a rough idea.

  http://markdownrules.com

-bowerbird

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