Commit f7050203 authored by hbristow's avatar hbristow

Linked online documentation now opens a browser window to the exact function…

Linked online documentation now opens a browser window to the exact function reference using div tags
parent 3483bf14
from textwrap import TextWrapper from textwrap import TextWrapper
from string import split, join from string import split, join
import re import re, os
def inputs(args): def inputs(args):
'''Keeps only the input arguments in a list of elements. '''Keeps only the input arguments in a list of elements.
...@@ -92,6 +92,12 @@ def stripTags(text): ...@@ -92,6 +92,12 @@ def stripTags(text):
def qualify(text, name): def qualify(text, name):
return re.sub(name.upper(), 'CV.'+name.upper(), text) return re.sub(name.upper(), 'CV.'+name.upper(), text)
def slugify(text):
return text.lower().replace('_', '-')
def filename(fullpath):
return os.path.splitext(os.path.basename(fullpath))[0]
def comment(text, wrap=80, escape='% ', escape_first='', escape_last=''): def comment(text, wrap=80, escape='% ', escape_first='', escape_last=''):
'''comment filter '''comment filter
......
...@@ -46,12 +46,14 @@ class MatlabWrapperGenerator(object): ...@@ -46,12 +46,14 @@ class MatlabWrapperGenerator(object):
jtemplate.filters['toLowerCamelCase'] = toLowerCamelCase jtemplate.filters['toLowerCamelCase'] = toLowerCamelCase
jtemplate.filters['toUnderCase'] = toUnderCase jtemplate.filters['toUnderCase'] = toUnderCase
jtemplate.filters['stripTags'] = stripTags jtemplate.filters['stripTags'] = stripTags
jtemplate.filters['filename'] = filename
jtemplate.filters['comment'] = comment jtemplate.filters['comment'] = comment
jtemplate.filters['inputs'] = inputs jtemplate.filters['inputs'] = inputs
jtemplate.filters['ninputs'] = ninputs jtemplate.filters['ninputs'] = ninputs
jtemplate.filters['outputs'] = outputs jtemplate.filters['outputs'] = outputs
jtemplate.filters['noutputs'] = noutputs jtemplate.filters['noutputs'] = noutputs
jtemplate.filters['qualify'] = qualify jtemplate.filters['qualify'] = qualify
jtemplate.filters['slugify'] = slugify
jtemplate.filters['only'] = only jtemplate.filters['only'] = only
jtemplate.filters['void'] = void jtemplate.filters['void'] = void
jtemplate.filters['not'] = flip jtemplate.filters['not'] = flip
......
...@@ -52,6 +52,7 @@ cv.{{ item }}{% if not loop.last %}, {% endif %} ...@@ -52,6 +52,7 @@ cv.{{ item }}{% if not loop.last %}, {% endif %}
% %
{% endif %} {% endif %}
% Official documentation: http://docs.opencv.org {% set url = 'http://docs.opencv.org/modules/' + doc.module + '/doc/' + (doc.file|filename) + '.html#' + (fun.name|slugify) %}
% Online docs: <a href="matlab: web('{{url}}', '-browser')">{{url}}</a>
% Copyright {{ time.strftime("%Y", time.localtime()) }} The OpenCV Foundation % Copyright {{ time.strftime("%Y", time.localtime()) }} The OpenCV Foundation
% %
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment