2013/1/21 Vincent Massol <vincent(a)massol.net>et>:
Hi Richard,
On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <rhierlmeier(a)googlemail.com>
wrote:
Hi XWiki users,
I could not find in the XWiki documentation a hint of the supported languages for the
code macro.
I wrote a small script in a XWiki page that read out of pygment (the technology behind
the code macro) all supported languages with language name, files extension and mimetype.
See:
http://www.hierlmeier.de/wiki/bin/view/Main/SupportedCodeMacroLanguages
Very nice! Would be awesome if you contribute it as a code snippet on
http://extensions.xwiki.org ! :)
Thanks
-Vincent
Yes, very nice page.
More than snippet, generated table could be in Code Macro page
itselft, couldn't it?
I directly put in application the page nad update on my own wiki a
page where I have ViM code, and I get the following error
org.xwiki.rendering.macro.MacroExecutionException: Failed to highlight content
at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:121)
at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:51)
[...]
Caused by: Traceback (most recent call last):
File "<string>", line 3, in <module>
File "<string>", line 3, in <module>
File "__pyclasspath__/pygments/lexers/__init__.py", line 75, in
get_lexer_by_name
File "__pyclasspath__/pygments/lexer.py", line 451, in __call__
File "__pyclasspath__/pygments/lexers/text.py", line 791, in __init__
java.lang.ClassFormatError: Invalid method Code length 79892 in class
file pygments/lexers/_vimbuiltins$py
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at org.python.core.BytecodeLoader$Loader.loadClassFromBytes(BytecodeLoader.java:119)
at org.python.core.BytecodeLoader.makeClass(BytecodeLoader.java:37)
at org.python.core.BytecodeLoader.makeCode(BytecodeLoader.java:67)
at org.python.core.util.importer.getModuleCode(importer.java:217)
at org.python.core.util.importer.importer_load_module(importer.java:95)
at
org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63)
at
org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown
Source)
at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
at org.python.core.imp.loadFromLoader(imp.java:513)
at org.python.core.imp.find_module(imp.java:467)
at org.python.core.PyModule.impAttr(PyModule.java:100)
at org.python.core.imp.import_next(imp.java:715)
at org.python.core.imp.import_logic(imp.java:777)
at org.python.core.imp.import_name(imp.java:839)
at org.python.core.imp.importName(imp.java:884)
at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
at org.python.core.PyObject.__call__(PyObject.java:357)
at org.python.core.__builtin__.__import__(__builtin__.java:1173)
at org.python.core.imp.importFromAs(imp.java:978)
at org.python.core.imp.importFrom(imp.java:954)
at pygments.lexers.text$py.__init__$25(__pyclasspath__/pygments/lexers/text.py:796)
at pygments.lexers.text$py.call_function(__pyclasspath__/pygments/lexers/text.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
at org.python.core.PyBaseCode.call(PyBaseCode.java:194)
at org.python.core.PyFunction.__call__(PyFunction.java:387)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220)
at org.python.core.PyMethod.__call__(PyMethod.java:211)
at org.python.core.PyMethod.__call__(PyMethod.java:206)
at org.python.core.Deriveds.dispatch__init__(Deriveds.java:19)
at org.python.core.PyObjectDerived.dispatch__init__(PyObjectDerived.java:1057)
at org.python.core.PyType.type___call__(PyType.java:1565)
at org.python.core.PyType$type___call___exposer.__call__(Unknown Source)
at org.python.core.PyMethodDescr.method_descriptor___call__(PyMethodDescr.java:54)
at org.python.core.PyMethodDescr.__call__(PyMethodDescr.java:43)
at org.python.core.PyObject._callextra(PyObject.java:527)
at pygments.lexer$py.__call__$38(__pyclasspath__/pygments/lexer.py:451)
at pygments.lexer$py.call_function(__pyclasspath__/pygments/lexer.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
at org.python.core.PyBaseCode.call(PyBaseCode.java:194)
at org.python.core.PyFunction.__call__(PyFunction.java:387)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220)
at org.python.core.PyMethod.__call__(PyMethod.java:211)
at org.python.core.PyMethod.__call__(PyMethod.java:206)
at org.python.core.PyTypeDerived.__call__(PyTypeDerived.java:951)
at org.python.core.PyObject._callextra(PyObject.java:527)
at
pygments.lexers$py.get_lexer_by_name$4(__pyclasspath__/pygments/lexers/__init__.py:80)
at pygments.lexers$py.call_function(__pyclasspath__/pygments/lexers/__init__.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
at org.python.core.PyFunction.function___call__(PyFunction.java:376)
at org.python.core.PyFunction.__call__(PyFunction.java:371)
at org.python.pycode._pyx16.f$0(<string>:5)
at org.python.pycode._pyx16.call_function(<string>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1261)
at org.python.core.Py.exec(Py.java:1305)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206)
at
org.xwiki.rendering.internal.parser.pygments.PygmentsParser.getLexer(PygmentsParser.java:266)
at
org.xwiki.rendering.internal.parser.pygments.PygmentsParser.highlight(PygmentsParser.java:225)
at
org.xwiki.rendering.internal.parser.pygments.PygmentsParser.highlight(PygmentsParser.java:193)
at org.xwiki.rendering.internal.macro.code.CodeMacro.highlight(CodeMacro.java:155)
at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:118)
at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:51)
at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:141)
at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:53)
at
org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:187)
[...]
My ViM code is 1562 characters long.
Should it Pygments bur or XWiki bug?
Regards,
Arnaud.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users