Fork me on GitHub
#rewrite-clj
<
2022-04-06
>
olaf02:04:35

Hi, what is the best way to edit code with rewrite-clj dynamically? What I mean is that I’ve a source code string (that can change), and sometimes I need to modify it programmatically, like adding a new list or rewrite the content of a specific list. How I can get the position of each list inside the source code? Like index, parent, etc so I can use rewrite-clj to find it using the zipper and modify it? Is there a way to extract a representation of the entire source code?

lread03:04:49

@eliascotto94 a good place to get the basics is the https://cljdoc.org/d/rewrite-clj/rewrite-clj/1.0.767-alpha/doc/user-guide. If you have some more specific questions after that we are here to help!

👍 1