Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown tag for document title

Tags:

markdown

Is there no way to indicate the document title in a Markdown document?

I've come to use Markdown with Sublime Text to prepare many of my personal and business documents. I often want to have a kind of "top level" heading analogous to the Title style in Word, for example. So, for example:

### Things to Do ###  At Home ======= *    Mow the cat *    Feed the lawn  At the Office ============= *    Learn Markdown *    Use Big-O notation in a clever way 

But the ### Things to Do ### line is not respected by Markdown, and I don't know an alternative. Is there one?

I could use the Heading 1 style for the title and then Heading 2 for the rest, but if I need a deeper nesting of headings, I quickly run out of depth. And, after all, a title fundamentally isn't a heading per se. It would be nice, for example, if Markdown-to-HTML parsers used the Title for the page <title> as well as for a top-of-page header a la Word titles.

like image 943
OldPeculier Avatar asked Jun 13 '13 22:06

OldPeculier


People also ask

How do you write a title in Markdown?

You can set the title metadata on the command line: --metadata=title:"Document Title" . @MichaelChirico, any way to do that with the title in the document (not -T , not --metadata title="annoying" ), in pandoc 2.11 ?

How do you add a tag in Markdown?

Add tags to your markdown files You add tags by defining them in the frontmatter of your Markdown file. The frontmatter is the area at the top surrounded by dashes that includes post data like the title and date. I went to the zoo today.

Can I use HTML tags in Markdown?

Span-level HTML tags — e.g. <span> , <cite> , or <del> — can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML <a> or <img> tags instead of Markdown's link or image syntax, go right ahead.


1 Answers

If you are referring to pandoc markdown specifically the simplest approach is to use '%', e.g.

% Document Title  # Header 1  content  ## Header 2  ## Header 2 

see http://pandoc.org/README.html#metadata-blocks for more information on pandoc markdown.

like image 159
Ian Walters Avatar answered Sep 26 '22 18:09

Ian Walters