doc:page_section_headings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:page_section_headings [2026/03/31 14:06] – [Markdown syntax] Simon Grantdoc:page_section_headings [2026/04/12 18:08] (current) Simon Grant
Line 5: Line 5:
 When we talk about headings, we often use "h1" to mean a top-level heading, like a page title, because in HTML it is coded as `<h1>`. h2 is the next level down, etc. When we talk about headings, we often use "h1" to mean a top-level heading, like a page title, because in HTML it is coded as `<h1>`. h2 is the next level down, etc.
  
-The text "Paragraphs and page section headings" above is a top-level, or h1 heading. +The heading above – "Paragraphs and page section headings" – is a top-level, or h1 heading. 
-The text "Using the editing menu" just following is an h2 heading.+The heading  below – "Using the editing menu" – is an h2 heading.
  
 Paragraph breaks are created simply by leaving a completely blank line between paragraphs. This is true for all the lightweight markup languages that we mention here. Paragraph breaks are created simply by leaving a completely blank line between paragraphs. This is true for all the lightweight markup languages that we mention here.
  
 Try out all these techniques below in the [[playground:playground]]. Try out all these techniques below in the [[playground:playground]].
 +
 +----
 +
 ===== Using the editing menu ===== ===== Using the editing menu =====
  
Line 19: Line 22:
   * `H>` gives you a heading at a higher level than the previous one above   * `H>` gives you a heading at a higher level than the previous one above
   * `H#` allows you to choose the heading level you want   * `H#` allows you to choose the heading level you want
 +
 +----
  
 ===== DokuWiki syntax ===== ===== DokuWiki syntax =====
Line 41: Line 46:
 To see more clearly how these are coded, you can try to Edit, then Cancel. To see more clearly how these are coded, you can try to Edit, then Cancel.
  
----+---
 +`# An h1 heading with one "#" sign`
  
 # An h1 heading with one "#" sign # An h1 heading with one "#" sign
  
 +```
 Another h1 heading, made by putting '='s underneath Another h1 heading, made by putting '='s underneath
 ================================================== ==================================================
 +```
 +
 +Another h1 heading, made by putting '='s underneath
 +==================================================
 +
 +`## An h2 heading with two "##" sign`
 +
 ## An h2 heading with two "##" sign ## An h2 heading with two "##" sign
  
 +```
 And anther Markdown h2 with '-'s underneath And anther Markdown h2 with '-'s underneath
 ----------------------------------------- -----------------------------------------
 +```
  
 +And anther Markdown h2 with '-'s underneath
 +-----------------------------------------
 +
 +
 +`### An h3 heading with three "###" signs`
 ### An h3 heading with three "###" signs ### An h3 heading with three "###" signs
  
----+----
  
 However, we don't recommend using Markdown for headings, as there appears to be a bug connected with their use, that removes blank lines when a section is edited. This can sometimes result in an h2 heading appearing as "## (with section title)" in the flow of the text. If this happens, change the heading to DokuWiki syntax, and insert a blank line before and after, to be sure. However, we don't recommend using Markdown for headings, as there appears to be a bug connected with their use, that removes blank lines when a section is edited. This can sometimes result in an h2 heading appearing as "## (with section title)" in the flow of the text. If this happens, change the heading to DokuWiki syntax, and insert a blank line before and after, to be sure.
  
-Unlike with Markdown in other places, you cannot use different text styles or links in DokuWiki, even with this plugin.+If you do use Markdown headings, be sure to leave a blank space after the one or more `#` characters. 
 + 
 +Unlike with Markdown in other places, you cannot use different text styles or links in DokuWiki, even with this plugin, because of the way DokuWiki works. 
 + 
 +----
  
 ===== MediaWiki ===== ===== MediaWiki =====
Line 64: Line 89:
 MediaWiki markup looks like a mixture of DokuWiki and Markdown. MediaWiki markup looks like a mixture of DokuWiki and Markdown.
  
-Mediawiki `= heading 1 =` is DokuWiki `====== heading 1 ======`Mediawiki `=== heading 3 ===` is DokuWiki `==== heading 3 ====`etc. The DokuWiki rationale seems to be that a more important heading should be more visible, hence with more `=` signs; but the MediaWiki rationale is to match the number of `=` signs with the number of the heading level. As HTML has 6 levels of heading, MediaWiki follows up from 1 to 6 =; DokuWiki counts down from 6 to 1 =.+Mediawiki `= heading 1 =` is the same as DokuWiki `====== heading 1 ======`; Mediawiki `== heading 2 ==` is DokuWiki `===== heading 2 =====`; Mediawiki `=== heading 3 ===` is DokuWiki `==== heading 3 ====`etc. The DokuWiki rationale seems to be that a more important heading should be more visible, hence with more `=` signs; but the MediaWiki rationale is to match the number of `=` signs with the number of the heading level. As HTML has 6 levels of heading, MediaWiki follows up from 1 to 6 =; DokuWiki counts down from 6 to 1 =. See [[MediaWiki and DokuWiki]]. 
 + 
 +===== Table of contents ===== 
 + 
 +When there are headings in a page, DokuWiki automatically provides a table of contents in the top right of the page. You should be able to see that now. Clicking on any entry in the table of contents takes you directly to that section of the page. Hover over any of the things in that table, and you will see the URL has a `#` and then a form of the section title. This is exactly the same as is used in HTML on the web. 
 + 
 +You can fold away the table of contents by clicking at the top of it. 
 + 
 +This means that you can link to a section in any wiki page by appending `#` and then the modified section heading text. To give an example, the URL `https://www.dokuwiki.org/wiki:syntax#sectioning` takes you to [[doku>syntax#sectioning]] in the middle of DokuWiki's syntax page. These links to section headings work both for fully spelled out URLs and for short, internal links.
  • doc/page_section_headings.1774965986.txt.gz
  • Last modified: 2026/03/31 14:06
  • by Simon Grant