Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown to create pages and table of contents?

I started to use markdown to take notes.

I use marked to view my markdown notes and its beautiful.

But as my notes get longer I find it difficult to find what I want.

I know markdown can create tables, but is it able to create table of contents, that jumps to sections, or define page sections in markdown?

Alternatively, are there markdown readers/editors that could do such things. Search would be good feature to have too.

In short, I want to make it my awesome note taking tool and functions much like writing a book etc.

like image 217
resting Avatar asked Aug 14 '12 08:08

resting


People also ask

What is TOC in Markdown?

Some markdown editors (like stackedit.io) support a [TOC] “command”, which will insert/show a Table Of Contents, based on the headlines of the current document.

Can Markdown use HTML?

Fortunately, Markdown has full HTML support, so you can code a table in HTML and go right back to Markdown in the same document. Plus, it's much easier to read raw Markdown than it is to read raw HTML.

Is Markdown easy to learn?

Markdown is a fast and easy way to take notes, create content for a website, and produce print-ready documents. It doesn't take long to learn the Markdown syntax, and once you know how to use it, you can write using Markdown just about everywhere.

What does ``` do in Markdown?

Mostly, Markdown is just regular text with a few non-alphabetic characters thrown in, like # or *. Markdown coverts text with four leading spaces into a code block; with GFM you can wrap your code with ``` to create a code block without the leading spaces.


2 Answers

Here's a useful method. Should produce clickable references in any MarkDown editor.

# Table of contents 1. [Introduction](#introduction) 2. [Some paragraph](#paragraph1)     1. [Sub paragraph](#subparagraph1) 3. [Another paragraph](#paragraph2)  ## This is the introduction <a name="introduction"></a> Some introduction text, formatted in heading 2 style  ## Some paragraph <a name="paragraph1"></a> The first paragraph text  ### Sub paragraph <a name="subparagraph1"></a> This is a sub paragraph, formatted in heading 3 style  ## Another paragraph <a name="paragraph2"></a> The second paragraph text 

Produces:

Table of contents

  1. Introduction
  2. Some paragraph
    1. Sub paragraph
  3. Another paragraph

This is the introduction

Some introduction text, formatted in heading 2 style

Some paragraph

The first paragraph text

Sub paragraph

This is a sub paragraph, formatted in heading 3 style

Another paragraph

The second paragraph text

like image 36
Tum Avatar answered Oct 04 '22 05:10

Tum


You can give this a try.

# Table of Contents 1. [Example](#example) 2. [Example2](#example2) 3. [Third Example](#third-example) 4. [Fourth Example](#fourth-examplehttpwwwfourthexamplecom)   ## Example ## Example2 ## Third Example ## [Fourth Example](http://www.fourthexample.com)  
like image 113
Rick Avatar answered Oct 04 '22 04:10

Rick