syntax highlighting problem

62 views
Skip to first unread message

gne...@gmail.com

unread,
Feb 10, 2014, 6:53:52 AM2/10/14
to klaus...@googlegroups.com
Hi,

First, thanks for the pure python OSS package. I have a couple of issues I wanted to share about klaus though.
    - I saw that it uses pygments for highlighting but although matlab is supposed to be supported since pygments 0.1, I don't have proper highlighting for it (not even the comments). I guess this has something to do with:
utils.pygmentize
as there is a call to markup before that might catch the .m file before pygments

- I wanted to add support for automatic rst integration (github style for the main README file) and saw that it's already somewhat there but that it depends on docutils.
I think this dependency (although optional) should be made explicit in the documentation (i.e. something like: "recommended: codutils")

- I'd like to try including some graphs (like git log --stat and for branches) with matplotlib if someone is interested (and could give a hand with the html integration part).

Best,

Gnewbee

Jonas H.

unread,
Feb 10, 2014, 8:01:53 AM2/10/14
to klaus...@googlegroups.com
Hi!

On 10.02.2014, at 12:53, gne...@gmail.com wrote:
> - I saw that it uses pygments for highlighting but although matlab is supposed to be supported since pygments 0.1, I don't have proper highlighting for it (not even the comments). I guess this has something to do with:
> utils.pygmentize
> as there is a call to markup before that might catch the .m file before pygments

Have you tried using Pygments directly, i.e. can Pygments cope with your Matlab file at all? You can try that out online here: http://pygments.org/demo/

If it does indeed work there but not using klaus, could you give an example file or repository where I can debug this further?


>
> - I wanted to add support for automatic rst integration (github style for the main README file) and saw that it's already somewhat there but that it depends on docutils.
> I think this dependency (although optional) should be made explicit in the documentation (i.e. something like: "recommended: codutils“)

You’re right. Will do. https://github.com/jonashaag/klaus/issues/85

>
> - I'd like to try including some graphs (like git log --stat and for branches) with matplotlib if someone is interested (and could give a hand with the html integration part).

This request has been raised before. Maybe we can move the discussion there: https://github.com/jonashaag/klaus/issues/84

Jonas

gne...@gmail.com

unread,
Feb 11, 2014, 5:42:33 AM2/11/14
to klaus...@googlegroups.com
Hi Jonas,

thanks for your reply.
Regarding pygments, it works fine in the browser demo with following code. In klaus even the comments are not recognised.

function printtcp()
% A matlab tcp server function to display a string received through the socket
    t = tcpip('192.168.1.1', 11111, 'NetworkRole', 'server');
    fopen(t);
    data = fread(t, t.BytesAvailable);
    disp(data)
end


If you want to debbug, just call it anything.m

Regarding docutils (not codutils like in my previous post), thanks for taking care of that.

Finally regarding the graphs, I could actually be interested in implementing the graphing. I've seen examples online to include matplotlib graphs in flask so I could try. I would just like to avoid fighting with html that I don't realy enjoy though if someone is better versed in it.

Best,

Gnewbee

Jonas H.

unread,
Feb 21, 2014, 3:38:30 PM2/21/14
to klaus...@googlegroups.com
Just fixed the syntax highlighting issue. https://github.com/jonashaag/klaus/compare/0.4.3...0.4.4

gne...@gmail.com

unread,
Mar 25, 2014, 3:43:01 PM3/25/14
to klaus...@googlegroups.com


Hi Jonas,
Sorry for the late answer, too much to do to look into that before.
Thanks a lot for the work.
On my side I played with graphs for Klaus. I have some working code but I got stuck at extracting stats from the files in the repo to finish what I had in mind.
I'm working on the server only so with a bare repository. I can't seem to be able to list/access the files in there since there is no working directory although you do it to display the files.
Unfortunatelly, the doc for dulwich is pretty limited.
Also, I think one very simple and yet important addition would be a download button for people who could use the code but are not (yet) converted to git. Currently, if they try downloading, they'll just get html.

Bset,

Gnewbee

Jonas H.

unread,
Mar 26, 2014, 7:29:56 AM3/26/14
to klaus...@googlegroups.com
On 25.03.2014, at 20:43, gne...@gmail.com wrote:

> Hi Jonas,
> Sorry for the late answer, too much to do to look into that before.
> Thanks a lot for the work.
> On my side I played with graphs for Klaus. I have some working code but I got stuck at extracting stats from the files in the repo to finish what I had in mind.
> I'm working on the server only so with a bare repository. I can't seem to be able to list/access the files in there since there is no working directory although you do it to display the files.
> Unfortunatelly, the doc for dulwich is pretty limited.

What stats exactly are you talking about? Maybe I can help you out with that.


> Also, I think one very simple and yet important addition would be a download button for people who could use the code but are not (yet) converted to git. Currently, if they try downloading, they'll just get html.

Would you mind opening a feature request on GitHub for this?

gne...@gmail.com

unread,
Apr 14, 2014, 8:34:58 AM4/14/14
to klaus...@googlegroups.com
Hi,

I just added the feature request.
Re the graphs, what I had in mind is something similar to github for language usage stats. I had other ideas as well but I'm always stuck at getting the info about the repo so one working example should help me for all of them.
I joined an example code file that would work if I could read the repo and it's rather limited in terms of dependencies. To try it just run the test function.

Best,

Gnewbee
graphLanguageUse.py

Jonas H.

unread,
May 2, 2014, 6:44:57 AM5/2/14
to klaus...@googlegroups.com
On 14.04.2014, at 14:34, gne...@gmail.com wrote:
> Re the graphs, what I had in mind is something similar to github for language usage stats. I had other ideas as well but I'm always stuck at getting the info about the repo so one working example should help me for all of them.

I don’t think this will make it into the project, sorry. The reason is that I don’t think it’s very useful for a private Git host targetted at single users or very small teams. Plus it’s non-trivial to implement this in a way that doesn’t hurt performance. You’d have to introduce background/asynchronous jobs etc.
Reply all
Reply to author
Forward
0 new messages