Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Add an html repr for ASTs nodes. #9

Open
Carreau opened this issue Sep 12, 2017 · 5 comments
Open

Add an html repr for ASTs nodes. #9

Carreau opened this issue Sep 12, 2017 · 5 comments

Comments

@Carreau
Copy link
Member

Carreau commented Sep 12, 2017

No description provided.

@rgbkrk
Copy link
Member

rgbkrk commented Sep 12, 2017

🤔

@Carreau
Copy link
Member Author

Carreau commented Sep 12, 2017

Yeah, the following is not helpful:

screen shot 2017-09-12 at 14 44 03

Would be nice if you could collapse/expand...

@rgbkrk
Copy link
Member

rgbkrk commented Sep 12, 2017

Yeah, are you thinking a nested

details / summary tag That expands to show more nodes?

or something more like graphviz representation

@Carreau
Copy link
Member Author

Carreau commented Sep 12, 2017

Yeah, are you thinking a nested

details / summary tag

Yes.

Dag is interesting... but ast will be a tree anyway, so likely easier to represent explicitely.

@takluyver
Copy link
Member

+1

For an easier starting point, maybe add a text repr that pretty prints it? I use an ast pretty printer which I stole off someone's blog:

https://bitbucket.org/takluyver/greentreesnakes/src/96d6e70210789c0b743eabbbb57d9282b7e41d8c/astpp.py?at=default
http://alexleone.blogspot.co.uk/2010/01/python-ast-pretty-printer.html

It doesn't have an explicit license, so we'd need to contact the author to clarify that before using it in IPython.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants