josevalim

josevalim

Creator of Elixir

To avoid breaking changes in the future it should definitely be a list of maps. But yes, please open up an issue. We can have it as Mix.Tasks.Xref.calls/0.

4
Post #11
tmbb

tmbb OP

I was thinking about adding the following features.

I’d like to have a special page which shows, for each function all functions that call it. I would like to have something in which when you click a function definition you’d be taken to the corresponding page where you could see all places where the function is called. This would be very useful to get a sense of how the function fits in the whole.

For example, if you have this definitions:

def my_func(x, y), do: ...

when you clicked the my_func name you would be redirected to a page where you can find all functions and modules that call my_func. This is pretty much trivial to implement (I have a function call database that makes it easy), I just have
to make time for it.

I would like to have a function call graph or dependency graph somewhere. I can either embed a static image of the graph, but that’s not very useful. An interactive graph would be better. There are GraphViz implementations in Javascript, so this can be doable.

2
Post #12
OvermindDL1

OvermindDL1

That would be quite awesome I’d say, it’s own page or a pop-in or so unpoly can make another page as an embedded popup as an example). ^.[1]
I would like to have a function call graph or dependency graph somewhere. I can either embed a static image of the graph, but that’s not very useful. An interactive graph would be better. There are GraphViz implementations in Javascript, so this can be doable.
[/quote]

The image like in C++'s Doxygen? That’d be very useful to see the whole generation set. I think xref can already generate those in graphviz so that side should be quite easy.

  1. quote=“tmbb, post:13, topic:9552” ↩︎

0
Post #13
tmbb

tmbb OP

Important: Guaxinim has a serious bug which will probably make it not work for anything that’s not it’s own source. I won’t be able to fix it for a while.
EDIT: In my defense, my guarantee was taht it wouldn’t eat your source, not that it would work properly.

1
Post #14
tmbb

tmbb OP

Exactly like this. Graphviz generates great “static” images, but there are some JS libraries that generate dynamic images. I’m still not sure what I want to use.

1
Post #15
OvermindDL1

OvermindDL1

Make sure it at least displays something useful without javascript. ^.^

0
Post #16
tmbb

tmbb OP

Sure. Guaxinim’s output is independent of Javascript and I intend to keep it like that for the most part. Except for the night mode you’re asking about, that will require JS to switch a CSS class.

1
Post #17
OvermindDL1

OvermindDL1

Actually it ‘technically’ doesn’t… ^.^;
It only needs javascript to ‘persist’ the changes. ^.^

If a checkbox is, say, at the top of <body> with a label right after it (or before, or around, or whatever) then CSS can be written to choose 1 of 2 ‘branches’ basically (depending on it’s checked state) to use different sets of CSS. This is pretty trivial to do with SCSS (and I use this trick a lot) and you can make the checkbox invisible and put the label where-ever you want to. ^.^

0
Post #18
tmbb

tmbb OP

Could you sumbit a PR to the template, please? I’m not a CSS wizard, but I can probably steal a dark theme from another python Sphinx project if you can add a class to the body element with pure CSS.

0
Post #19
OvermindDL1

OvermindDL1

Adding a class takes javascript, instead you’d match on the ::checked attribute of the checkbox followed by +'s or so everything after it. ^.^

Do not have time at the moment, but poke me, hmm, maybe tomorrow and I might? I’m off work tomorrow so I may have free time (or my family will drag me out, one or the other). ^.^;

0
Post #20