Skip to content

Commit f3b111a

Browse files
committed
Comment at the end of file indicating when docs were generated
1 parent 8a9aedc commit f3b111a

File tree

1 file changed

+14
-0
lines changed
  • doc-tool/src/dotty/tools/dottydoc/staticsite

1 file changed

+14
-0
lines changed

doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import java.io.{ File => JFile, OutputStreamWriter, BufferedWriter, ByteArrayInp
88
import java.util.{ List => JList, Map => JMap, Arrays }
99
import java.nio.file.Path
1010
import java.nio.charset.StandardCharsets
11+
import java.util.Calendar
12+
import java.text.SimpleDateFormat
13+
import java.io.PrintWriter
14+
1115

1216
import com.vladsch.flexmark.parser.ParserEmulationProfile
1317
import com.vladsch.flexmark.parser.Parser
@@ -311,6 +315,16 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma
311315
* defaults, the user-defined one will take precedence.
312316
*/
313317
val layouts: Map[String, Layout] = {
318+
319+
val cal = Calendar.getInstance()
320+
val today = cal.getTime()
321+
val currentHour = new SimpleDateFormat("hh").format(today)
322+
val currentMinute = new SimpleDateFormat("mm").format(today)
323+
val amOrPm = new SimpleDateFormat("a").format(today)
324+
val x = "<!-- generated on " + cal.get(Calendar.DATE) + "/"+ (cal.get(Calendar.MONTH)+1)+ "/"+cal.get(Calendar.YEAR) + " " + currentHour + ":" + currentMinute + ":" + amOrPm + "-->"
325+
var loc = root.getAbsolutePath.toString + "/.." + "/doc-tool/resources/_layouts/main.html"
326+
scala.tools.nsc.io.File(loc).appendAll(x)
327+
314328
val userDefinedLayouts =
315329
root
316330
.listFiles.find(d => d.getName == "_layouts" && d.isDirectory)

0 commit comments

Comments
 (0)