From 86bba6a538e51a18204651cf9a9a72fceec839d4 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 21 Dec 2020 10:54:42 -0800 Subject: Add infrastructure for links to Git commits. - Add a tag which accepts a Git hash. Leave as is for svn revisions. In theory we could add a new attribute to to say which VCS to use, but this would require tagging either all SVN revisions or all Git hashes explicitly which would be invasive. A new tag going forward seems simpler. - Revert svnweb.link back to generating svnweb links. This fixes all the explicit 's referring to SVN src commits in existing documentation. - Add a cgit.link which links to a Git commit in cgit. githash generates cgit.link's when asked to generate a href. Reviewed by: gjb, ygy Differential Revision: https://reviews.freebsd.org/D27703 --- share/misc/docbook.css | 4 ++++ share/xml/docbook50.dtd | 16 +++++++++++++--- share/xml/freebsd-common.xsl | 15 ++++++++++++++- share/xml/freebsd-fo.xsl | 17 +++++++++++++++++ share/xml/freebsd-xhtml-common.xsl | 18 ++++++++++++++++++ share/xml/freebsd50.rnc | 1 + 6 files changed, 67 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/misc/docbook.css b/share/misc/docbook.css index c4029cf975..38e7bf476e 100644 --- a/share/misc/docbook.css +++ b/share/misc/docbook.css @@ -265,6 +265,10 @@ html { color: #007a00; } +.gitref { + color: #007a00; +} + .guimenu, .guimenuitem, .guisubmenu, .guilabel, .interface, .shortcut, .shortcut .keycap { diff --git a/share/xml/docbook50.dtd b/share/xml/docbook50.dtd index 9bb6f37f10..365f54eddc 100644 --- a/share/xml/docbook50.dtd +++ b/share/xml/docbook50.dtd @@ -321,7 +321,7 @@ > + revnumber|buildtarget|xi:include|githash)*> - + + + + + + revnumber|buildtarget|githash)*> + + + + + @@ -25,7 +30,15 @@ - + + + + + + + diff --git a/share/xml/freebsd-fo.xsl b/share/xml/freebsd-fo.xsl index 3d786b2de7..102e4dba31 100644 --- a/share/xml/freebsd-fo.xsl +++ b/share/xml/freebsd-fo.xsl @@ -581,6 +581,23 @@ + + + + + + + + + + + + + + + + + diff --git a/share/xml/freebsd-xhtml-common.xsl b/share/xml/freebsd-xhtml-common.xsl index 3f90b34249..abc66af2d4 100644 --- a/share/xml/freebsd-xhtml-common.xsl +++ b/share/xml/freebsd-xhtml-common.xsl @@ -212,6 +212,24 @@ + + + + + + + + + + + + + + + + + + https://www.FreeBSD.org/cgi/man.cgi?query= diff --git a/share/xml/freebsd50.rnc b/share/xml/freebsd50.rnc index a240d0317a..695542c1c6 100644 --- a/share/xml/freebsd50.rnc +++ b/share/xml/freebsd50.rnc @@ -39,6 +39,7 @@ include "/usr/local/share/xml/docbook/5.0/rng/docbook.rnc" inherit = db { # FreeBSD extension: add buildtarget element to allowed inlines db.extension.inlines = db.buildtarget | db.revnumber + | db.githash # | db.trademark -- cgit v1.2.3