0
votes

The Problem

I would like to replace the hard-coded timestamp embedded in a Doxygen generated html file with JavaScript (or some other dynamic means) that displays the timestamp of the file.

I only need to support this in HTML.

This looks like it is feasible because Doxygen provides for a HTML_FOOTER option in the config file. Presumably I would use that to add JavaScript to the file.

There are two reasons that I want to do this:

  1. Not have the file change every time I generate so I do not generate clutter in the change history of the file.

  2. Have the date be an actually useful date as to when it last changed.

My current scheme is the documentation is generated anytime there is a commit to the source code. The generated html is rsync'd to the server for display. Rsync is smart enough to only move code that has changed, so the timestamps of the files on the server will not change unless the contents of the file changes. Right now the content changes every time because the Doxygen generated timestamp changes every time.

Here is what I tried:

I used the following JavaScript fragment in place of the Doxygen generated timestamp:

<script> document.write(new Date(document.lastModified)); </script>

Here are the steps I used to put that into my code:

Asked Doxygen to generate header and footer templates with this command:

doxygen -w html header.html footer.html extradoxygen.css

Modify the footer.html file to replace the timestamp with the JavaScript above.

Edited the Doxyfile and entered modified this line:

HTML_FOOTER            = footer.html

Generate the Doxygen and note that the timestamp corresponds to the timestamp of the file.

But that does not work because the timestamp changes every time I refresh the browser.

1

1 Answers

0
votes

Replace $date in footer with server-side include for modification date. From: Apache SSI Includes

"Modification date of the file This document last modified <!--#flastmod file="index.html" -->"

Example Usage