Overview of supported languages for the code macro

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Overview of supported languages for the code macro

rhierlmeier

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


Richard
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

vmassol
Administrator
Hi Richard,

On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Arnaud bourree-2
2013/1/21 Vincent Massol <[hidden email]>:

> Hi Richard,
>
> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Thomas Mortagne
Administrator
On Tue, Jan 22, 2013 at 9:19 AM, Arnaud bourree
<[hidden email]> wrote:

> 2013/1/21 Vincent Massol <[hidden email]>:
>> Hi Richard,
>>
>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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?

That would only reflect what is supported in xwiki.org instance.

>
> 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?

The error looks like a Pygmets bug but it could be caused by Jython
more than Pygments itself.

You can probably test it on http://pygments.org/ to see if at least
Pygments is supposed to support it well. If it works properly it's
probably around XWiki/Jython.

In all cases it's always a good idea to create an issue with details
on how to reproduce it on http://jira.xwiki.org, even if it's a
Pygments bug it will still require something to do on our side which
is to upgrade Pygments.

>
> Regards,
>
> Arnaud.
>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Thomas Mortagne
Administrator
In reply to this post by rhierlmeier
On Mon, Jan 21, 2013 at 9:10 PM, Richard Hierlmeier
<[hidden email]> wrote:
>
> Hi XWiki users,
>
> I could not find in the XWiki documentation a hint of the supported
> languages for the code macro.

Well you have a link to http://pygments.org/languages/ on
http://extensions.xwiki.org/xwiki/bin/view/Extension/Code+Macro but
its not always perfectly up to date.

>
> 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

That's indeed very useful. Especially getting the exact identifier of
the language which is not very clear on
http://pygments.org/languages/.

>
>
> Richard
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Thomas Mortagne
Administrator
On Tue, Jan 22, 2013 at 9:31 AM, Thomas Mortagne
<[hidden email]> wrote:

> On Mon, Jan 21, 2013 at 9:10 PM, Richard Hierlmeier
> <[hidden email]> wrote:
>>
>> Hi XWiki users,
>>
>> I could not find in the XWiki documentation a hint of the supported
>> languages for the code macro.
>
> Well you have a link to http://pygments.org/languages/ on
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Code+Macro but
> its not always perfectly up to date.
>
>>
>> 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
>
> That's indeed very useful. Especially getting the exact identifier of
> the language which is not very clear on
> http://pygments.org/languages/.

By the way it would probably be easier to directly use the python
macro instead of the groovy one ;)

>
>>
>>
>> Richard
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>
>
>
> --
> Thomas Mortagne



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Arnaud bourree-2
In reply to this post by Thomas Mortagne
2013/1/22 Thomas Mortagne <[hidden email]>:

> On Tue, Jan 22, 2013 at 9:19 AM, Arnaud bourree
> <[hidden email]> wrote:
>> 2013/1/21 Vincent Massol <[hidden email]>:
>>> Hi Richard,
>>>
>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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?
>
> That would only reflect what is supported in xwiki.org instance.
>
>>
>> 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?
>
> The error looks like a Pygmets bug but it could be caused by Jython
> more than Pygments itself.
>
> You can probably test it on http://pygments.org/ to see if at least
> Pygments is supposed to support it well. If it works properly it's
> probably around XWiki/Jython.
>
> In all cases it's always a good idea to create an issue with details
> on how to reproduce it on http://jira.xwiki.org, even if it's a
> Pygments bug it will still require something to do on our side which
> is to upgrade Pygments.
>

issue XRENDERING-277 created in Jira

>>
>> Regards,
>>
>> Arnaud.
>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>
>
>
> --
> Thomas Mortagne
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Thomas Mortagne
Administrator
Thanks, I commented on the issue.

On Tue, Jan 22, 2013 at 10:46 AM, Arnaud bourree
<[hidden email]> wrote:

> 2013/1/22 Thomas Mortagne <[hidden email]>:
>> On Tue, Jan 22, 2013 at 9:19 AM, Arnaud bourree
>> <[hidden email]> wrote:
>>> 2013/1/21 Vincent Massol <[hidden email]>:
>>>> Hi Richard,
>>>>
>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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?
>>
>> That would only reflect what is supported in xwiki.org instance.
>>
>>>
>>> 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?
>>
>> The error looks like a Pygmets bug but it could be caused by Jython
>> more than Pygments itself.
>>
>> You can probably test it on http://pygments.org/ to see if at least
>> Pygments is supposed to support it well. If it works properly it's
>> probably around XWiki/Jython.
>>
>> In all cases it's always a good idea to create an issue with details
>> on how to reproduce it on http://jira.xwiki.org, even if it's a
>> Pygments bug it will still require something to do on our side which
>> is to upgrade Pygments.
>>
>
> issue XRENDERING-277 created in Jira
>
>>>
>>> Regards,
>>>
>>> Arnaud.
>>>
>>>> _______________________________________________
>>>> users mailing list
>>>> [hidden email]
>>>> http://lists.xwiki.org/mailman/listinfo/users
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Thomas Mortagne
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Arnaud bourree-2
2013/1/22 Thomas Mortagne <[hidden email]>:
> Thanks, I commented on the issue.

You comment is true, it is more a Java/Jython/Pygments integration issue

Arnaud.

>
> On Tue, Jan 22, 2013 at 10:46 AM, Arnaud bourree
> <[hidden email]> wrote:
>> 2013/1/22 Thomas Mortagne <[hidden email]>:
>>> On Tue, Jan 22, 2013 at 9:19 AM, Arnaud bourree
>>> <[hidden email]> wrote:
>>>> 2013/1/21 Vincent Massol <[hidden email]>:
>>>>> Hi Richard,
>>>>>
>>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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?
>>>
>>> That would only reflect what is supported in xwiki.org instance.
>>>
>>>>
>>>> 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?
>>>
>>> The error looks like a Pygmets bug but it could be caused by Jython
>>> more than Pygments itself.
>>>
>>> You can probably test it on http://pygments.org/ to see if at least
>>> Pygments is supposed to support it well. If it works properly it's
>>> probably around XWiki/Jython.
>>>
>>> In all cases it's always a good idea to create an issue with details
>>> on how to reproduce it on http://jira.xwiki.org, even if it's a
>>> Pygments bug it will still require something to do on our side which
>>> is to upgrade Pygments.
>>>
>>
>> issue XRENDERING-277 created in Jira
>>
>>>>
>>>> Regards,
>>>>
>>>> Arnaud.
>>>>
>>>>> _______________________________________________
>>>>> users mailing list
>>>>> [hidden email]
>>>>> http://lists.xwiki.org/mailman/listinfo/users
>>>> _______________________________________________
>>>> users mailing list
>>>> [hidden email]
>>>> http://lists.xwiki.org/mailman/listinfo/users
>>>
>>>
>>>
>>> --
>>> Thomas Mortagne
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>
>
>
> --
> Thomas Mortagne
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

Thomas Mortagne
Administrator
On Tue, Jan 22, 2013 at 2:37 PM, Arnaud bourree
<[hidden email]> wrote:
> 2013/1/22 Thomas Mortagne <[hidden email]>:
>> Thanks, I commented on the issue.
>
> You comment is true, it is more a Java/Jython/Pygments integration issue

Yea, I will try to find some time to test various version of the JVM
with Jython 2.7a2 to see if I can find a working couple. Unless
Pygments guys decide to be nice with us poor Java users ;)

>
> Arnaud.
>
>>
>> On Tue, Jan 22, 2013 at 10:46 AM, Arnaud bourree
>> <[hidden email]> wrote:
>>> 2013/1/22 Thomas Mortagne <[hidden email]>:
>>>> On Tue, Jan 22, 2013 at 9:19 AM, Arnaud bourree
>>>> <[hidden email]> wrote:
>>>>> 2013/1/21 Vincent Massol <[hidden email]>:
>>>>>> Hi Richard,
>>>>>>
>>>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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?
>>>>
>>>> That would only reflect what is supported in xwiki.org instance.
>>>>
>>>>>
>>>>> 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?
>>>>
>>>> The error looks like a Pygmets bug but it could be caused by Jython
>>>> more than Pygments itself.
>>>>
>>>> You can probably test it on http://pygments.org/ to see if at least
>>>> Pygments is supposed to support it well. If it works properly it's
>>>> probably around XWiki/Jython.
>>>>
>>>> In all cases it's always a good idea to create an issue with details
>>>> on how to reproduce it on http://jira.xwiki.org, even if it's a
>>>> Pygments bug it will still require something to do on our side which
>>>> is to upgrade Pygments.
>>>>
>>>
>>> issue XRENDERING-277 created in Jira
>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Arnaud.
>>>>>
>>>>>> _______________________________________________
>>>>>> users mailing list
>>>>>> [hidden email]
>>>>>> http://lists.xwiki.org/mailman/listinfo/users
>>>>> _______________________________________________
>>>>> users mailing list
>>>>> [hidden email]
>>>>> http://lists.xwiki.org/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>> --
>>>> Thomas Mortagne
>>>> _______________________________________________
>>>> users mailing list
>>>> [hidden email]
>>>> http://lists.xwiki.org/mailman/listinfo/users
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Thomas Mortagne
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

rhierlmeier
In reply to this post by vmassol
Am 21.01.2013 21:37, schrieb Vincent Massol:

> Hi Richard,
>
> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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 ! :)

I added the following page:

http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro

Richard


>
> Thanks
> -Vincent
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

vmassol
Administrator

On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier <[hidden email]> wrote:

> Am 21.01.2013 21:37, schrieb Vincent Massol:
>> Hi Richard,
>>
>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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 ! :)
>
> I added the following page:
>
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro

Thanks but this is not correct…

What you need to do is contribute an extension of type "snippet".

Go to http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome and in the "contribute extension" field type "Supported Languages in Code Macro" and click submit… :)

Thanks
-Vincent

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

rhierlmeier
Am 22.01.2013 18:04, schrieb Vincent Massol:

>
> On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier <[hidden email]> wrote:
>
>> Am 21.01.2013 21:37, schrieb Vincent Massol:
>>> Hi Richard,
>>>
>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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 ! :)
>>
>> I added the following page:
>>
>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro
>
> Thanks but this is not correct…
>
> What you need to do is contribute an extension of type "snippet".
>
> Go to http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome and in the "contribute extension" field type "Supported Languages in Code Macro" and click submit… :)
>

Sorry for that,

I added a extension is the described way:

http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages

Vincent can you delete the incorrect page.

Richard


> Thanks
> -Vincent
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

vmassol
Administrator
In reply to this post by rhierlmeier

On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier <[hidden email]> wrote:

> Am 21.01.2013 21:37, schrieb Vincent Massol:
>> Hi Richard,
>>
>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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 ! :)
>
> I added the following page:
>
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro
>
> Richard

Thanks! I've removed the page.

-Vincent
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

rhierlmeier
In reply to this post by Thomas Mortagne
Am 22.01.2013 09:33, schrieb Thomas Mortagne:

> On Tue, Jan 22, 2013 at 9:31 AM, Thomas Mortagne
> <[hidden email]> wrote:
>> On Mon, Jan 21, 2013 at 9:10 PM, Richard Hierlmeier
>> <[hidden email]> wrote:
>>>
>>> Hi XWiki users,
>>>
>>> I could not find in the XWiki documentation a hint of the supported
>>> languages for the code macro.
>>
>> Well you have a link to http://pygments.org/languages/ on
>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Code+Macro but
>> its not always perfectly up to date.
>>
>>>
>>> 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
>>
>> That's indeed very useful. Especially getting the exact identifier of
>> the language which is not very clear on
>> http://pygments.org/languages/.
>
> By the way it would probably be easier to directly use the python
> macro instead of the groovy one ;)

A stick-in-the-mud will try nothing new (:.
I implemented it in python and it is indeed much shorter.

Thank you

Richard

>
>>
>>>
>>>
>>> Richard
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Thomas Mortagne
>
>
>
> --
> Thomas Mortagne
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

xrichard
In reply to this post by rhierlmeier
Hello,

I've tried to document this Macro on http://platform.xwiki.org by
running/displaying somewhere the macro results, but I failed :
- I'm not allowed to create a new page (I was thinking of creating a page
containing Richard's macro)
- I'm not allowed to modify syntax page
http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax (I was thinking of
adding a footnote with link to the extension)
- thus I've checked if I was allowed to add a comment on the page
http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax and I succeed with a
dummy comment but now I can not change/remove this comment ;-(.

2 requests:
First : please delete my dummy comment here :
http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax . That's in advance to
Wiki admins
Second : what is the best way to "promote" Richard's macro and to let users know
what are / how they can check the available languages in Code macro ?

regards,

Le 23/01/2013 08:10, Richard Hierlmeier a écrit :

> Am 22.01.2013 18:04, schrieb Vincent Massol:
>>
>> On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier <[hidden email]>
>> wrote:
>>
>>> Am 21.01.2013 21:37, schrieb Vincent Massol:
>>>> Hi Richard,
>>>>
>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier
>>>> <[hidden email]> 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 ! :)
>>>
>>> I added the following page:
>>>
>>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro 
>>>
>>
>> Thanks but this is not correct…
>>
>> What you need to do is contribute an extension of type "snippet".
>>
>> Go to http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome and in the
>> "contribute extension" field type "Supported Languages in Code Macro" and
>> click submit… :)
>>
>
> Sorry for that,
>
> I added a extension is the described way:
>
> http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages
>
> Vincent can you delete the incorrect page.
>
> Richard
>
>
>> Thanks
>> -Vincent
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

vmassol
Administrator
Hi,

On Jan 24, 2013, at 7:29 AM, Ldm Public <[hidden email]> wrote:

> Hello,
>
> I've tried to document this Macro on http://platform.xwiki.org by running/displaying somewhere the macro results, but I failed :
> - I'm not allowed to create a new page (I was thinking of creating a page containing Richard's macro)

Anyone registered can create pages normally so that's strange. However this doesn't look like the place to document the code macro. That is already done here:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Code+Macro

Not sure what is Richard's macro but if Richard contributed a new macro it should be contributed on extensions.xwiki.org and thus documented in that page there.

> - I'm not allowed to modify syntax page http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax (I was thinking of adding a footnote with link to the extension)

This one is normal. There's a special page acess right set on it because this page is generated, see
http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax?viewer=code

The reason is that this page is packaged in the default XWiki XAR and we didn't want duplication.

> - thus I've checked if I was allowed to add a comment on the page http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax and I succeed with a dummy comment but now I can not change/remove this comment ;-(.

I don't remember what rights we ask for removing comments.

> 2 requests:
> First : please delete my dummy comment here : http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax . That's in advance to Wiki admins

Done

> Second : what is the best way to "promote" Richard's macro and to let users know what are / how they can check the available languages in Code macro ?

It's already promoted here:
http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages

But it's not a macro, it's a code snippet.

Thanks
-Vincent

> regards,
>
> Le 23/01/2013 08:10, Richard Hierlmeier a écrit :
>> Am 22.01.2013 18:04, schrieb Vincent Massol:
>>>
>>> On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier <[hidden email]> wrote:
>>>
>>>> Am 21.01.2013 21:37, schrieb Vincent Massol:
>>>>> Hi Richard,
>>>>>
>>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier <[hidden email]> 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 ! :)
>>>>
>>>> I added the following page:
>>>>
>>>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro 
>>>
>>> Thanks but this is not correct…
>>>
>>> What you need to do is contribute an extension of type "snippet".
>>>
>>> Go to http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome and in the "contribute extension" field type "Supported Languages in Code Macro" and click submit… :)
>>>
>>
>> Sorry for that,
>>
>> I added a extension is the described way:
>>
>> http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages
>>
>> Vincent can you delete the incorrect page.
>>
>> Richard
>>
>>
>>> Thanks
>>> -Vincent
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

rhierlmeier
In reply to this post by xrichard
Am 24.01.2013 07:29, schrieb Ldm Public:

> Hello,
>
> I've tried to document this Macro on http://platform.xwiki.org by
> running/displaying somewhere the macro results, but I failed :
> - I'm not allowed to create a new page (I was thinking of creating a
> page containing Richard's macro)
> - I'm not allowed to modify syntax page
> http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax (I was
> thinking of adding a footnote with link to the extension)
> - thus I've checked if I was allowed to add a comment on the page
> http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax and I succeed
> with a dummy comment but now I can not change/remove this comment ;-(.

I also tried to run the python script in the

http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages

page. But it is not possible because my user account has no programming
rights on extensions.xwiki.org.

Someone of the XWiki team with programming rights can do it ;:.

Richard


>
> 2 requests:
> First : please delete my dummy comment here :
> http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax . That's in
> advance to Wiki admins
> Second : what is the best way to "promote" Richard's macro and to let
> users know what are / how they can check the available languages in Code
> macro ?
>
> regards,
>
> Le 23/01/2013 08:10, Richard Hierlmeier a écrit :
>> Am 22.01.2013 18:04, schrieb Vincent Massol:
>>>
>>> On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier
>>> <[hidden email]> wrote:
>>>
>>>> Am 21.01.2013 21:37, schrieb Vincent Massol:
>>>>> Hi Richard,
>>>>>
>>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier
>>>>> <[hidden email]> 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 ! :)
>>>>
>>>> I added the following page:
>>>>
>>>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro
>>>>
>>>
>>> Thanks but this is not correct…
>>>
>>> What you need to do is contribute an extension of type "snippet".
>>>
>>> Go to http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome and in
>>> the "contribute extension" field type "Supported Languages in Code
>>> Macro" and click submit… :)
>>>
>>
>> Sorry for that,
>>
>> I added a extension is the described way:
>>
>> http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages
>>
>> Vincent can you delete the incorrect page.
>>
>> Richard
>>
>>
>>> Thanks
>>> -Vincent
>>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/users
>>>
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Overview of supported languages for the code macro

vmassol
Administrator
Hi,

On Jan 24, 2013, at 8:34 AM, Richard Hierlmeier <[hidden email]> wrote:

> Am 24.01.2013 07:29, schrieb Ldm Public:
>> Hello,
>>
>> I've tried to document this Macro on http://platform.xwiki.org by
>> running/displaying somewhere the macro results, but I failed :
>> - I'm not allowed to create a new page (I was thinking of creating a
>> page containing Richard's macro)
>> - I'm not allowed to modify syntax page
>> http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax (I was
>> thinking of adding a footnote with link to the extension)
>> - thus I've checked if I was allowed to add a comment on the page
>> http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax and I succeed
>> with a dummy comment but now I can not change/remove this comment ;-(.
>
> I also tried to run the python script in the
>
> http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages
>
> page. But it is not possible because my user account has no programming rights on extensions.xwiki.org.
>
> Someone of the XWiki team with programming rights can do it ;:.

Actually our practice is not execute scripts on extensions.xwiki.org since that takes CPU/memory and is potentially dangerous for the stability of the platform. It's also more maintenance intensive.

In addition the result only represent the result on the XWiki version installed there. Thus our practice is to attach screenshots instead.

Thanks
-Vincent

> Richard
>
>
>>
>> 2 requests:
>> First : please delete my dummy comment here :
>> http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax . That's in
>> advance to Wiki admins
>> Second : what is the best way to "promote" Richard's macro and to let
>> users know what are / how they can check the available languages in Code
>> macro ?
>>
>> regards,
>>
>> Le 23/01/2013 08:10, Richard Hierlmeier a écrit :
>>> Am 22.01.2013 18:04, schrieb Vincent Massol:
>>>>
>>>> On Jan 22, 2013, at 5:51 PM, Richard Hierlmeier
>>>> <[hidden email]> wrote:
>>>>
>>>>> Am 21.01.2013 21:37, schrieb Vincent Massol:
>>>>>> Hi Richard,
>>>>>>
>>>>>> On Jan 21, 2013, at 9:10 PM, Richard Hierlmeier
>>>>>> <[hidden email]> 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 ! :)
>>>>>
>>>>> I added the following page:
>>>>>
>>>>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Supported+Languages+in+CodeMacro
>>>>>
>>>>
>>>> Thanks but this is not correct…
>>>>
>>>> What you need to do is contribute an extension of type "snippet".
>>>>
>>>> Go to http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome and in
>>>> the "contribute extension" field type "Supported Languages in Code
>>>> Macro" and click submit… :)
>>>>
>>>
>>> Sorry for that,
>>>
>>> I added a extension is the described way:
>>>
>>> http://extensions.xwiki.org/xwiki/bin/view/Extension/CodeMacro+Languages
>>>
>>> Vincent can you delete the incorrect page.
>>>
>>> Richard
>>>
>>>
>>>> Thanks
>>>> -Vincent
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users