public class SphinxLinks extends Object implements freemarker.template.TemplateMethodModelEx
| Constructor and Description |
|---|
SphinxLinks(ModuleDefinition module) |
| Modifier and Type | Method and Description |
|---|---|
Object |
exec(List arguments)
Takes a string and replaces occurrences of rst/sphinx with kurento domain markup with javadoc
and jsdoc equivalents.
|
String |
make_id(String txt)
Our use case is
$ python -c "from docutils import nodes; print('term-'+nodes.make_id('QR'))" , which
returns term-qr i.e., identifiers conforming to the regular expression
[a-z](-?[a-z0-9]+)* |
String |
translate(String text,
List<String[]> patterns)
Clone the python unicode translate method in legacy languages younger than python.
|
public SphinxLinks(ModuleDefinition module)
public Object exec(List arguments) throws freemarker.template.TemplateModelException
exec in interface freemarker.template.TemplateMethodModelexec in interface freemarker.template.TemplateMethodModelExarguments - A list of arguments as Strings from the call. The first one is the rst/sphinx text,
and the second optional one defines the current class full name.freemarker.template.TemplateModelExceptionTemplateMethodModelEx.exec(java.util.List)public String translate(String text, List<String[]> patterns)
text - string for which translation is neededpatterns - Array of arrays {target, replacement). The target is substituted by the replacement.http://docs.python.org/3/library/stdtypes.html#str.translatepublic String make_id(String txt)
$ python -c "from docutils import nodes; print('term-'+nodes.make_id('QR'))" , which
returns term-qr i.e., identifiers conforming to the regular expression
[a-z](-?[a-z0-9]+)*
But there is a requirement to use pure java for this task. So we clone the function here. python docutils is public domain.
://code.nabla.net/doc/docutils/api/docutils/nodes/docutils.nodes. make_id.htmlCopyright © 2016. All rights reserved.