linux_pangolin
linux_pangolin

Reputation: 81

Can Doxygen project brief contain link?

I am writing my Doxyfile configuration and was wondering if I can include a link within the PROJECT_BRIEF. I have tried HTML and Markdown syntax, but it appears to only accept plaintext. Is there a way to add simple markup to the PROJECT_BRIEF?

PROJECT_BRIEF = "Project heavily inspired by <a href='https://example.com'>Other Project</a>"

Output shows HTML syntax verbatim

PROJECT_BRIEF = "Project heavily inspired by [Other Project](https://example.com)"

Output shows Markdown syntax verbatim

My system currently has Doxygen 1.8.17 installed.

Upvotes: 0

Views: 244

Answers (1)

linux_pangolin
linux_pangolin

Reputation: 81

I managed to accomplish this using a custom HTML_HEADER.

  1. Generate default templates (we will only be looking at header.html).
doxygen -w html header.html footer.html stylesheet.css Doxyfile
rm footer.html stylesheet.css
  1. Modify header.html.

    • Find the existing $projectbrief tag.

      <div id="projectbrief">$projectbrief</div>
      
    • Add some javascript to "unescape" the HTML.

      <script>
        function htmlDecode(input) {
          var doc = new DOMParser().parseFromString(input, "text/html");
          return doc.documentElement.textContent;
        }
        document.getElementById("projectbrief").innerHTML = htmlDecode("$projectbrief");
      </script>
      
  2. Modify Doxyfile to use new HTML_HEADER

HTML_HEADER = header.html
  1. Admire your markup! Output shows correctly formatted  tag

Note: Other output types (e.g. LaTeX) also can similarly use custom header files.

Additionally, Markdown syntax is theoretically possible using any number of JavaScript Markdown parsers.

Upvotes: 1

Related Questions