Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library to create code outline [closed]

Is there a python or ruby library to create a code outline for the given code? The library should support multiple languages.

I am looking for something like outline view in Eclipse. I don't need the UI, and i can write my own. But I am looking for a library which parses the given language and creates an outline datastructure.

like image 535
18bytes Avatar asked Jul 15 '26 19:07

18bytes


1 Answers

As far as I know there is no such library. You could create it yourself though.

A pragmatic way would be to follow the indentation levels in Python. For other languages, you could either follow the indentation level, or use regular expression matching and a stack to keep track your outline.

like image 55
Hans Then Avatar answered Jul 17 '26 19:07

Hans Then