Paragraph tags around blocks

2009-03-05 Thread Sherwood Botsford
For those of you who are expert you may chuckle over this.
Perhaps if it's in the record, however, it may help someone else.


I was  getting cases of



standing on a line by itself, getting converted to this:




Yes, the line above and below are blank.
Yes the div tag is starting at the first column

It displays as intended.  Firefox's browser is clever, but it won't
validate, and given all the whinging
I've done about non-validating web pages, I better get mine right.


I'm processing with template toolkit.  If I turn off the multimarkdown
filter, this is what's being passed:
 32 
 33 
 35 
 36 
 37 
 38
 39
 40
 41 
 42
 43 # Contact Info
 44If you want to write, phone, email, drive here this is the place to
 45 find out how.
 46

 32
 33 
 35 
 36 
 37 
 38
 39 
 40
 41 Contact Info
 42
 43 If you want to write, phone, email, drive here this is the place to
 44 find out how.  
 45

As a sanity check I reverted to Markdown instead of multimarkdown

No change.

Now it wasn't happening in all files

An hour of pruning copies of files that worked versus ones that didn't
found the following:

This file would work:

[%  USE MARKDOWN %]
[%  FILTER MARKDOWN %]




[% END  #filter markdown %]


This file would not work:
[%  USE MARKDOWN %]
[%  FILTER MARKDOWN %]




[% END  #filter markdown %]


The [% boxes are template toolkit instructions.
So TT was NOT handling markdown the closing  in the non-working cases.
Markdown couldn't find a closing tag to match the opening tag,
therefore it must be text,
and gets wrapped in  tags.

Go figure.

-- 
Sherwood Botsford
Sherwood's Forests
Warburg, Alberta T0C 2T0
http://www.sherwoods-forests.com
780-848-2548
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Table of contents

2009-03-05 Thread Fletcher T. Penney
MultiMarkdown has the ability to generate such a ToC, complete with  
links from the headers back to the ToC via the xhtml-toc.xslt file.


Strictly speaking, this file can be used by xsltproc on any XHTML  
file, not necessarily one that was created by MMD.




Fletcher




On Mar 5, 2009, at 1:03 PM, Sherwood Botsford wrote:


The bird is right on this one.  You want easy ways to navigate, and
multiple ones to navigate.

I *don't* think that markdown is the place for this however.

I find working even with Markdown to put a picture in a file is slow
and awkward.  You want to avoid this level of detail while you are
writing.
You want to write, not tweak brackets and braces and such. Don't turn
MD into the mess that HTML is.

I think this is better approached by your page generating software.
Consider:
Write your basic markdown.
Labelmaker goes through your markdown, and any header lines get an
auto generated label put before them to create an anchor.
Labelmaker is customized to look for sequences like ### Table and
# Figure and do the right thing.

The previous-toc-next links are handled by your templating software.

Now you are just writing markdown.

the only thing I'd add to markdown would be a good mechanism for
resolving links externally, so that if you rename a file, you don't
have to back trace all the files that reference them.  Again this
should be programmed.  You put the link in normally the first time.  A
program pulls the links out, puts a 'external reference link' tag in
markdown, and adds this to the external link.  Ideally it's smart
enough taht if you reference something several times, it reuses the
tag.  Now if you rename or move a file, you only have to fix it in the
single external links file.




--
Sherwood Botsford
Sherwood's Forests
Warburg, Alberta T0C 2T0
http://www.sherwoods-forests.com
780-848-2548
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss




--
Fletcher T. Penney
fletc...@fletcherpenney.net

People demand freedom of speech to make up for the freedom of thought
which they avoid.
- Soren Aabye Kierkegaard (1813-1855)



smime.p7s
Description: S/MIME cryptographic signature
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Table of contents

2009-03-05 Thread Sherwood Botsford
The bird is right on this one.  You want easy ways to navigate, and
multiple ones to navigate.

I *don't* think that markdown is the place for this however.

I find working even with Markdown to put a picture in a file is slow
and awkward.  You want to avoid this level of detail while you are
writing.
You want to write, not tweak brackets and braces and such. Don't turn
MD into the mess that HTML is.

I think this is better approached by your page generating software.
Consider:
Write your basic markdown.
Labelmaker goes through your markdown, and any header lines get an
auto generated label put before them to create an anchor.
Labelmaker is customized to look for sequences like ### Table and
# Figure and do the right thing.

The previous-toc-next links are handled by your templating software.

Now you are just writing markdown.

the only thing I'd add to markdown would be a good mechanism for
resolving links externally, so that if you rename a file, you don't
have to back trace all the files that reference them.  Again this
should be programmed.  You put the link in normally the first time.  A
program pulls the links out, puts a 'external reference link' tag in
markdown, and adds this to the external link.  Ideally it's smart
enough taht if you reference something several times, it reuses the
tag.  Now if you rename or move a file, you only have to fix it in the
single external links file.




-- 
Sherwood Botsford
Sherwood's Forests
Warburg, Alberta T0C 2T0
http://www.sherwoods-forests.com
780-848-2548
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


re: Table of contents

2009-03-05 Thread Bowerbird
i'm told that typophiles consider "table of contents"
to be redundant, and that "contents" is sufficient...

whatever...

at any rate, of course you will want to make sure that
the toc entries _link_ to their respective chapters, but
don't stop there, my friends.   have the chapter headers
link _back_ to the contents page, to improve navigation.

and sometimes people want to "skim across" chapters,
so put a link on each chapter that goes to the next one.
and another link that goes to the previous one as well...

follow the same procedure for the table of illustrations.
and figures.   and any other structure that's appropriate.

some of you will be inclined to dismiss this as overkill.

fine.   be that way.

those of you who actually try it, and use it for a while,
will come to learn that it's really quite handy, and you
will continue using it forever, and be glad you tried it.

-bowerbird



**
A Good Credit Score is 700 or Above. See yours in just 2 easy 
steps! 
(http://pr.atwola.com/promoclk/100126575x1219957551x1201325337/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26hmpgID
%3D62%26bcd%3DfebemailfooterNO62)
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Table of contents

2009-03-05 Thread david parsons
In article ,
Daniel Winterstein   wrote:
>--===0471983932==
>Content-Type: multipart/alternative; boundary=001636c59672452e2f04645bc875
>
>--001636c59672452e2f04645bc875
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 7bit
>
>I'm using Markdown in an app and would like to provide support for including
>a table of contents.


A couple of the markdown implementations have got support for tables
of contents.   Discount (my implementation) supports it (it builds
a table of contents from the headers and lets you get to it
via a library call,) the python implementation has one, as
does pandoc.



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


Re: Table of contents

2009-03-05 Thread Sherwood Botsford
Tables of contents should be generated automatically.  Maintaining
them by hand especially with electronic documents that are shall we
say, a bit unstable, is truly a PITA

FrameMaker had (may still have) a feature in which you could abstract
the content of styles from your document, and apply a different style
to use them in a TOC.

E.g. (Adapting language a bit here for the web world) You could
extract H1 through H6, stuff them in a file.  Then you apply an
appropriate CSS to them to make a reasonable looking TOC.

Two approaches occur to me:
1.  Put a label above headline. Context grep for lines in your
markdown files that start with #.  Use 1 line of previous context.
Perl script turns the  label plus the filename into a markdown URL link.

grep -r -B1 "^#" tt2
...
tt2/Advice/Design/Landscaping.tt2-
tt2/Advice/Design/Landscaping.tt2:# Planning for Change
tt2/Advice/Design/Landscaping.tt2: or
tt2/Advice/Design/Landscaping.tt2:##Gee, Those Little Trees Look Silly
--
tt2/Advice/Design/Landscaping.tt2-don't notice.
tt2/Advice/Design/Landscaping.tt2: Lessons:
--
tt2/Advice/Design/Design_Principles.tt2-
tt2/Advice/Design/Design_Principles.tt2:# Principles of Design.
--
tt2/Advice/Design/Design_Principles.tt2-
tt2/Advice/Design/Design_Principles.tt2:##  Basic principles.
--
tt2/Advice/Design/Design_Principles.tt2-
tt2/Advice/Design/Design_Principles.tt2:   Repetition.
--
tt2/Advice/Design/Design_Principles.tt2-
tt2/Advice/Design/Design_Principles.tt2:   Alternation
--


You'll note that I was being clever and cute and used headlines to do
something stylistic. My Bad.

Approaches you could take for this:
* Only index headlines that have a label on them.
* multiple successive headlines are glommed together for indexing. If
the secondary heads are in different size, then they are shown in
parentheses.


The otehr approach is to look for the label, then take the line
immediately following that.  If you are consistent, you would be able
to pull lists of figures, photos, tables and equations from your
documents this way.


-- 
Sherwood Botsford
Sherwood's Forests
Warburg, Alberta T0C 2T0
http://www.sherwoods-forests.com
780-848-2548
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Table of contents

2009-03-05 Thread Waylan Limberg
On Thu, Mar 5, 2009 at 4:27 AM, Daniel Winterstein
 wrote:
>
> I'm using Markdown in an app and would like to provide support for including
> a table of contents.
> Any suggestions for a syntax? Has anyone done this before?

Yes, Python-Markdown has an extension [1] that does this.
Unfortunately, its not documented properly yet (it hasn't been
officially released yet either), but it works on the same basic
premise as your third suggestion. It uses all the headers to build a
nested list and then either inserts that list at the location of the
marker ``[TOC]``, or if the marker is not found, at the beginning of
the document.

[1]: 
http://gitorious.org/projects/python-markdown/repos/mainline/blobs/master/markdown/extensions/toc.py

-- 

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


Table of contents

2009-03-05 Thread Daniel Winterstein
I'm using Markdown in an app and would like to provide support for including
a table of contents.
Any suggestions for a syntax? Has anyone done this before?
My first thoughts are:

1. Have a special header item (using markdown extra's header syntax), e.g.

generate-contents: yes

2. Have a special xml tag with optional alternative text inside, e.g.


1. First thingy
2. Second thingy
3. Other stuff


3. Detect that a set of list items matches the first few headers. E.g. if
the document has headers

# Monkeys
## Chimps
## Humans
## Proboscis monkeys
## Other monkeys
## Do Lemur's count?

Then a list that ran:

1. Monkeys
   1. Chimps
   2. Humans

Would be detected as the start of a contents list, and the other entries
would automatically be added to it. This seems the nicest approach in some
respects, but also the one likely to cause confusion and annoyance.

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