Linked online documentation now opens a browser window to the exact function reference using div tags
This commit is contained in:
parent
3483bf14b9
commit
f705020348
@ -1,6 +1,6 @@
|
|||||||
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.
|
||||||
@ -93,6 +93,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
|
||||||
Takes a string in text, and wraps it to wrap characters in length with
|
Takes a string in text, and wraps it to wrap characters in length with
|
||||||
|
@ -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 %}
|
|||||||
|
|
||||||
%
|
%
|
||||||
{% 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
|
||||||
%
|
%
|
||||||
|
Loading…
x
Reference in New Issue
Block a user