Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

header label in doxygen markdown page makes header title disappear

I notice a strange problem with doxygen 1.8.2. Including a header label causes the header title to disappear from the output html.

With the following markdown file:

Title            {#title}
=====

Section 1        {#section1}
---------
Text for section 1

I get the output as:

Title

Text for section 1

But, if I remove the {#section1} label from the markdown file, I get the correct output as:

Title

Section 1

Text for section 1

What is the mistake I am making here?

Edit I observed the following warning when I label a section:

 warning: found subsection command outside of section context!
like image 384
Masked Man Avatar asked Nov 30 '12 15:11

Masked Man


People also ask

How to make header in Markdown?

– What Is Mark Down How To Make Header In Markdown? Adding a # sign ( for heading) in front of words or phrases will make the heading more concise. In a number symbol set, you ought to use several at one heading level.

What is Markdown in Doxygen?

Markdown support was introduced in doxygen version 1.8.0. It is a plain text formatting syntax written by John Gruber, with the following underlying design goal: ‍The design goal for Markdown's formatting syntax is to make it as readable as possible.

What are the different types of headers in Doxygen?

We continue with more text in another paragraph. Just like Markdown, doxygen supports two types of headers A header is followed by a line containing only ='s or -'s. Note that the exact amount of ='s or -'s is not important as long as there are at least two. Alternatively, you can use #'s at the start of a line to make a header.

How do I list all sections of a page in Doxygen?

Doxygen supports a special link marker [TOC] which can be placed in a page to produce a table of contents at the start of the page, listing all sections. Note that using [TOC] is the same as using a ableofcontents command.


2 Answers

After some investigation, I have decided this appears to be a bug, but only because it is slightly counter-intuitive.

Consider the following:

The Main Section {#the_main_section}
================

Subsection One {#first}
--------------

Something highly interesting...

The document starts with a level 1 header (as described here) and so Doxygen parses "The Main Section" as the name and title of the page. The header and the label {#the_main_section} appear to be disregarded once the header has been converted into a page name.

The processing then moves on to the rest of the document and When it reaches "Subsection One", it believes that there is no parent "Section" for the "subsection" (as the "Section" was converted to a page name) and this is where it chokes.

More specifically, it discards the subsection (header) as it believes there is no parent "section". All other text remains, but is treated as part of the "page" (with no section parent).

The "fix" is to add another "level 1 header" after the initial "level 1 header" e.g.

My Great Documentation (Which Becomes the Page Name)
====================================================

The First Section
=================

Q. What? I already created a level 1 heading?
A. Yup, but that was converted to a page name/title and discarded, so now
   we have to create another level 1 heading for my first section. Don't
   be fooled into thinking that the opening heading in this document is
   still treated as an opening heading by Doxygen - it's not!
like image 122
PeterByte Avatar answered Sep 25 '22 16:09

PeterByte


Same issue in the version 1.8.9.1. You can avoid it by using # tags instead of --- .

For example:

[TOC]

Page Title {#pageTitle}
==========
Lorem ipsum dolor sit amet

# section 1 {#section1}
Lorem ipsum dolor sit amet

## Section 1.1 {#section1-1}
Lorem ipsum dolor sit amet

# section 2 {#section2}
Lorem ipsum dolor sit amet

# section 3 {#section3}
Lorem ipsum dolor sit amet

## section 3.1 {#section3-1}
Lorem ipsum dolor sit amet

# section 4 {#section4}
Lorem ipsum dolor sit amet

will work. You can even put the [TOC] tag below the page Title definition to remove it from the table of content.

like image 26
Michael Avatar answered Sep 23 '22 16:09

Michael