Skip to content
Snippets Groups Projects
Commit 33998aa1 authored by g0dil's avatar g0dil
Browse files

Add XSLT postprocessing of HTML files to fix browser problems

parent fd91cee6
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ env.Append( ...@@ -14,6 +14,7 @@ env.Append(
CPPPATH = [ '#' ], CPPPATH = [ '#' ],
LIBS = [ 'iberty' ], LIBS = [ 'iberty' ],
DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ], DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ],
DOXY_HTML_XSL = '#/doclib/html-munge.xsl',
) )
import datetime import datetime
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// Free Software Foundation, Inc., // Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Definition of non-inline template functions /** \file
\brief senf::ClientSocketHandle non-inline template implementation
*/
//#include "ClientSocketHandle.ih" //#include "ClientSocketHandle.ih"
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// Free Software Foundation, Inc., // Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Definition of inline template functions /** \file
\brief senf::ClientSocketHandle inline template implementation
*/
//#include "ClientSocketHandle.ih" //#include "ClientSocketHandle.ih"
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
// Free Software Foundation, Inc., // Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief senf::ClientSocketHandle public header
*/
#ifndef HH_ClientSocketHandle_ #ifndef HH_ClientSocketHandle_
#define HH_ClientSocketHandle_ 1 #define HH_ClientSocketHandle_ 1
...@@ -37,7 +41,7 @@ namespace senf { ...@@ -37,7 +41,7 @@ namespace senf {
template <class Policy> class ServerSocketHandle; template <class Policy> class ServerSocketHandle;
/** \brief /** \brief Generic SocketHandle with client interface
\todo Move all not template-parameter dependent code into a \todo Move all not template-parameter dependent code into a
non-template base class non-template base class
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// Free Software Foundation, Inc., // Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Definition of non-inline template functions /** \file
\brief Policy Framework non-inline template implemenation
*/
#include "SocketPolicy.ih" #include "SocketPolicy.ih"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file /** \file
\brief SocketPolicy public header \brief Policy Framework public header
\todo We should probably remove BufferingPolicy from the \todo We should probably remove BufferingPolicy from the
interface, it does not make much sense (how did I come to include interface, it does not make much sense (how did I come to include
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
// Free Software Foundation, Inc., // Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief Policy Framework internal header
*/
#ifndef IH_SocketPolicy_ #ifndef IH_SocketPolicy_
#define IH_SocketPolicy_ 1 #define IH_SocketPolicy_ 1
......
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" encoding="html" />
<xsl:template match="/">
<html>
<body bgcolor="#FFFFFF">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="dl[dt/b/a/text()='Bug:']">
<xsl:copy>
<xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
<xsl:attribute name="class">xref-bug</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="dl[dt/b/a/text()='Fixme:']">
<xsl:copy>
<xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
<xsl:attribute name="class">xref-fixme</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="dl[dt/b/a/text()='Todo:']">
<xsl:copy>
<xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
<xsl:attribute name="class">xref-todo</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="dl[dt/b/a/text()='Idea:']">
<xsl:copy>
<xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
<xsl:attribute name="class">xref-idea</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
...@@ -175,25 +175,24 @@ dl.bug, dl.fixme, dl.todo, dl.idea { ...@@ -175,25 +175,24 @@ dl.bug, dl.fixme, dl.todo, dl.idea {
padding: 0 10px; padding: 0 10px;
} }
dl:contains("Bug:"), dl:contains("Fix:"), dl:contains("Todo:"), dl:contains("Idea:") { dl.xref-bug, dl.xref-fix, dl.xref-todo, dl.xref-idea {
border: 1px solid #CC8888; border: 1px solid #CC8888;
padding: 4px; padding: 2px 3px;
margin: 4px 0;
background-color: #FFEEEE; background-color: #FFEEEE;
color: #666666; color: #666666;
font-size: 6px; font-size: 9px;
line-height: 6px;
overflow: hidden; overflow: hidden;
height: 6px;
} }
dl:contains("Bug:"):hover, dl:contains("Fix:"):hover, dl.xref-bug dt, dl.xref-fix dt, dl.xref-todo dt, dl.xref-idea dt,
dl:contains("Todo:"):hover, dl:contains("Idea:"):hover { dl.xref-bug dd, dl.xref-fix dd, dl.xref-todo dd, dl.xref-idea dd {
line-height: inherit; display: inline;
font-size: inherit; margin: 0;
height: auto; padding: 0;
} }
dl:contains("Bug:") a, dl:contains("Fix:") a, dl:contains("Todo:") a, dl:contains("Idea:") a { dl.xref-bug a, dl.xref-fix a, dl.xref-todo a, dl.xref-idea a {
color: #6666FF; color: #6666FF;
} }
...@@ -202,7 +201,7 @@ dl.fixme { ...@@ -202,7 +201,7 @@ dl.fixme {
background-color: #FFFFDD; background-color: #FFFFDD;
} }
dl:contains("Fix:") { dl.xref-fix {
border-color: #CCCC88; border-color: #CCCC88;
background-color: #FFFFEE; background-color: #FFFFEE;
} }
...@@ -212,7 +211,7 @@ dl.todo { ...@@ -212,7 +211,7 @@ dl.todo {
background-color: #DDFFDD; background-color: #DDFFDD;
} }
dl:contains("Todo:") { dl.xref-todo {
border-color: #88CC88; border-color: #88CC88;
background-color: #EEFFEE; background-color: #EEFFEE;
} }
...@@ -222,7 +221,7 @@ dl.idea { ...@@ -222,7 +221,7 @@ dl.idea {
background-color: #EEEEEE; background-color: #EEEEEE;
} }
dl:contains("Idea:") { dl.xref-idea {
border-color: #CCCCCC; border-color: #CCCCCC;
background-color: #F8F8F8; background-color: #F8F8F8;
} }
......
...@@ -151,11 +151,13 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []): ...@@ -151,11 +151,13 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []):
# ||| WITHIN THE DOXYGEN BUILDER # ||| WITHIN THE DOXYGEN BUILDER
docs = env.Doxygen(doxyfile)[:] docs = env.Doxygen(doxyfile)[:]
xmlnode = None xmlnode = None
htmlnode = None
tagnode = None tagnode = None
for doc in docs: for doc in docs:
if isinstance(doc,SCons.Node.FS.Dir): continue if isinstance(doc,SCons.Node.FS.Dir): continue
if doc.name == 'xml.stamp' : xmlnode = doc if doc.name == 'xml.stamp' : xmlnode = doc
if os.path.splitext(doc.name)[1] == '.stamp' : continue # file stamp if doc.name == 'html.stamp' : htmlnode = doc
if os.path.splitext(doc.name)[1] == '.stamp' : continue # ignore other file stamps
# otherwise it must be the tag file # otherwise it must be the tag file
tagnode = doc tagnode = doc
...@@ -164,10 +166,21 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []): ...@@ -164,10 +166,21 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []):
# references # references
env.AddPostAction( env.AddPostAction(
docs, docs,
env.Action("xsltproc -o %(target)s.temp %(template)s %(target)s && mv %(target)s.temp %(target)s" env.Action("xsltproc --nonet -o %(target)s.temp %(template)s %(target)s && mv %(target)s.temp %(target)s"
% { 'target': tagnode.abspath, % { 'target': tagnode.abspath,
'template': os.path.join(basedir,"tagmunge.xsl") })) 'template': os.path.join(basedir,"tagmunge.xsl") }))
if htmlnode and env.get('DOXY_HTML_XSL'):
xslfile = env.File(env['DOXY_HTML_XSL'])
env.AddPostAction(
docs,
env.Action(("for html in %s/*.html; do " +
"xsltproc --nonet --html -o $${html}.new %s $${html} && mv $${html}.new $${html}; " +
"done")
% (htmlnode.dir.abspath, xslfile.abspath)))
for doc in docs:
env.Depends(doc,xslfile)
if xmlnode: if xmlnode:
xrefs = [] xrefs = []
for type in env.get("DOXY_XREF_TYPES",[ "bug", "todo" ]): for type in env.get("DOXY_XREF_TYPES",[ "bug", "todo" ]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment