Merge pull request #129 from gvvaughan/pull-request/custom_see_hander-doc-fix
doc: improve match pattern for manual page references with custom_see_handler.
Steve J Donovan
10 years ago
399 | 399 | |
400 | 400 | local upat = "http://www.kernel.org/doc/man-pages/online/pages/man%s/%s.%s.html" |
401 | 401 | |
402 | custom_see_handler('^(%a+)%((%d)%)$',function(name,section) | |
402 | custom_see_handler('^([%w_]+)%((%d)%)$',function(name,section) | |
403 | 403 | local url = upat:format(section,name,section) |
404 | 404 | local name = name .. '(' ..section..')' |
405 | 405 | return name, url |
406 | 406 | end) |
407 | 407 | |
408 | '^(%a+)%((%d)%)$' both matches the pattern and extracts the name and its section. Then it's | |
408 | '^([%w_]+)%((%d)%)$' both matches the pattern and extracts the name and its section. Then it's | |
409 | 409 | a simple matter of building up the appropriate URL. The function is expected to |
410 | 410 | return _link text_ and _link source_ and the patterns are checked before LDoc tries to resolve |
411 | 411 | project references. So it is best to make them match as exactly as possible. |