mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
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 string import split, join
|
||||
import re
|
||||
import re, os
|
||||
|
||||
def inputs(args):
|
||||
'''Keeps only the input arguments in a list of elements.
|
||||
@ -92,6 +92,12 @@ def stripTags(text):
|
||||
|
||||
def qualify(text, name):
|
||||
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=''):
|
||||
'''comment filter
|
||||
|
@ -46,12 +46,14 @@ class MatlabWrapperGenerator(object):
|
||||
jtemplate.filters['toLowerCamelCase'] = toLowerCamelCase
|
||||
jtemplate.filters['toUnderCase'] = toUnderCase
|
||||
jtemplate.filters['stripTags'] = stripTags
|
||||
jtemplate.filters['filename'] = filename
|
||||
jtemplate.filters['comment'] = comment
|
||||
jtemplate.filters['inputs'] = inputs
|
||||
jtemplate.filters['ninputs'] = ninputs
|
||||
jtemplate.filters['outputs'] = outputs
|
||||
jtemplate.filters['noutputs'] = noutputs
|
||||
jtemplate.filters['qualify'] = qualify
|
||||
jtemplate.filters['slugify'] = slugify
|
||||
jtemplate.filters['only'] = only
|
||||
jtemplate.filters['void'] = void
|
||||
jtemplate.filters['not'] = flip
|
||||
|
@ -52,6 +52,7 @@ cv.{{ item }}{% if not loop.last %}, {% 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
|
||||
%
|
||||
|
Loading…
Reference in New Issue
Block a user