Permalink
Browse files

Adding partial htmlhelp support to template system

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Jun 2, 2016
1 parent 7c31264 commit d3f2fcd53000fc4a09cf56c90930f8c8e2ad02b4
@@ -1292,6 +1292,64 @@ class FilterDivisibleBy
}
};
//--------------------------------------------------------------------
/** @brief The implementation of the "isRelativeURL" filter */
class FilterIsRelativeURL
{
public:
static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &)
{
if (v.isValid() && v.type()==TemplateVariant::String)
{
QCString s = v.toString();
if (!s.isEmpty() && s.at(0)=='!') return TRUE;
}
return FALSE;
}
};
//--------------------------------------------------------------------
/** @brief The implementation of the "isRelativeURL" filter */
class FilterIsAbsoluteURL
{
public:
static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &)
{
if (v.isValid() && v.type()==TemplateVariant::String)
{
QCString s = v.toString();
if (!s.isEmpty() && s.at(0)=='^') return TRUE;
}
return FALSE;
}
};
//--------------------------------------------------------------------
/** @brief The implementation of the "decodeURL" filter
* The leading character is removed from the value in case it is a ^ or !.
* - ^ is used to encode a absolute URL
* - ! is used to encode a relative URL
*/
class FilterDecodeURL
{
public:
static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &)
{
if (v.isValid() && v.type()==TemplateVariant::String)
{
QCString s = v.toString();
if (!s.isEmpty() && (s.at(0)=='^' || s.at(0)=='!'))
{
return s.mid(1);
}
}
return v;
}
};
//--------------------------------------------------------------------
@@ -1343,25 +1401,28 @@ class TemplateFilterFactory
};
// register a handlers for each filter we support
static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add");
static TemplateFilterFactory::AutoRegister<FilterGet> fGet("get");
static TemplateFilterFactory::AutoRegister<FilterRaw> fRaw("raw");
static TemplateFilterFactory::AutoRegister<FilterList> fList("list");
static TemplateFilterFactory::AutoRegister<FilterAppend> fAppend("append");
static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length");
static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap");
static TemplateFilterFactory::AutoRegister<FilterFlatten> fFlatten("flatten");
static TemplateFilterFactory::AutoRegister<FilterDefault> fDefault("default");
static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend");
static TemplateFilterFactory::AutoRegister<FilterGroupBy> fGroupBy("groupBy");
static TemplateFilterFactory::AutoRegister<FilterRelative> fRelative("relative");
static TemplateFilterFactory::AutoRegister<FilterListSort> fListSort("listsort");
static TemplateFilterFactory::AutoRegister<FilterTexLabel> fTexLabel("texLabel");
static TemplateFilterFactory::AutoRegister<FilterTexIndex> fTexIndex("texIndex");
static TemplateFilterFactory::AutoRegister<FilterPaginate> fPaginate("paginate");
static TemplateFilterFactory::AutoRegister<FilterStripPath> fStripPath("stripPath");
static TemplateFilterFactory::AutoRegister<FilterAlphaIndex> fAlphaIndex("alphaIndex");
static TemplateFilterFactory::AutoRegister<FilterDivisibleBy> fDivisibleBy("divisibleby");
static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add");
static TemplateFilterFactory::AutoRegister<FilterGet> fGet("get");
static TemplateFilterFactory::AutoRegister<FilterRaw> fRaw("raw");
static TemplateFilterFactory::AutoRegister<FilterList> fList("list");
static TemplateFilterFactory::AutoRegister<FilterAppend> fAppend("append");
static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length");
static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap");
static TemplateFilterFactory::AutoRegister<FilterFlatten> fFlatten("flatten");
static TemplateFilterFactory::AutoRegister<FilterDefault> fDefault("default");
static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend");
static TemplateFilterFactory::AutoRegister<FilterGroupBy> fGroupBy("groupBy");
static TemplateFilterFactory::AutoRegister<FilterRelative> fRelative("relative");
static TemplateFilterFactory::AutoRegister<FilterListSort> fListSort("listsort");
static TemplateFilterFactory::AutoRegister<FilterTexLabel> fTexLabel("texLabel");
static TemplateFilterFactory::AutoRegister<FilterTexIndex> fTexIndex("texIndex");
static TemplateFilterFactory::AutoRegister<FilterPaginate> fPaginate("paginate");
static TemplateFilterFactory::AutoRegister<FilterStripPath> fStripPath("stripPath");
static TemplateFilterFactory::AutoRegister<FilterDecodeURL> fDecodeURL("decodeURL");
static TemplateFilterFactory::AutoRegister<FilterAlphaIndex> fAlphaIndex("alphaIndex");
static TemplateFilterFactory::AutoRegister<FilterDivisibleBy> fDivisibleBy("divisibleby");
static TemplateFilterFactory::AutoRegister<FilterIsRelativeURL> fIsRelativeURL("isRelativeURL");
static TemplateFilterFactory::AutoRegister<FilterIsAbsoluteURL> fIsAbsoluteURL("isAbsoluteURL");
//--------------------------------------------------------------------
@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD></HEAD><BODY>
<OBJECT type="text/site properties">
<param name="FrameName" value="right">
</OBJECT>
<UL>
{% recursetree index.nav %}
<LI><OBJECT type="text/sitemap"><param name="Name" value="{{ node.name }}">
<param name="{% if node.file|isAbsoluteURL %}URL{% else %}Local{% endif %}" value="{{ node.file|decodeURL }}{{ config.HTML_FILE_EXTENSION }}{% if node.anchor %}#{{ node.anchor }}{% endif %}">
<param name="ImageNumber" value="1{% if node.is_leaf_node %}1{% endif %}">
</OBJECT>
{% if not node.is_leaf_node %}
<UL>{{ children }}</UL>
{% endif %}
{% endrecursetree %}
</UL>
</BODY>
</HTML>
@@ -2,6 +2,6 @@
var NAVTREEINDEX{{ idx }} =
{
{% for entry in entries %}
"{{ entry.file }}{{ config.HTML_FILE_EXTENSION }}{% if entry.anchor %}#{{ entry.anchor }}{% endif %}":[{% for e in entry.path %}{% if not forloop.first %}{{ e.index }}{% if not forloop.last%},{% endif %}{% endif %}{% endfor %}]{% if not forloop.last %},{%endif %}
"{{ entry.file|decodeURL }}{{ config.HTML_FILE_EXTENSION }}{% if entry.anchor %}#{{ entry.anchor }}{% endif %}":[{% for e in entry.path %}{% if not forloop.first %}{{ e.index }}{% if not forloop.last%},{% endif %}{% endif %}{% endfor %}]{% if not forloop.last %},{%endif %}
{% endfor %}
};
@@ -1,7 +1,7 @@
var NAVTREE =
[
{% recursetree index.nav %}
[ "{{ node.name }}", {% if node.file %}"{% if node.isReference %}{{ node.externalReference }}{% endif %}{{ node.file }}{{ config.HTML_FILE_EXTENSION }}{% if node.anchor %}#{{ node.anchor }}{% endif %}"{% else %}null{% endif %},{% if not node.is_leaf_node %} [
[ "{{ node.name }}", {% if node.file %}"{% if node.isReference %}{{ node.externalReference }}{% endif %}{{ node.file|decodeURL }}{{ config.HTML_FILE_EXTENSION }}{% if node.anchor %}#{{ node.anchor }}{% endif %}"{% else %}null{% endif %},{% if not node.is_leaf_node %} [
{{ children }}
]{% else %} null{% endif %} ]{% if not node.last %},{% endif %}
{% endrecursetree %}
@@ -270,6 +270,7 @@
{% if config.GENERATE_HTMLHELP %}
{% encoding config.CHM_INDEX_ENCODING|default:'CP1250' %}
{% create 'index.hhp' from 'htmlhelpindexhhp.tpl' %}
{% create 'index.hhc' from 'htmlhelpindexhhc.tpl' %}
{% endencoding %}
{% endif %}

0 comments on commit d3f2fcd

Please sign in to comment.