# CodeGen - simple, succint and customizable code generation for your libraries

**URL:** <https://forum.elixirforum.com/t/codegen-simple-succint-and-customizable-code-generation-for-your-libraries/54521>\
**Category:** Announcing\
**Tags:** library, defmacro\
**Created:** [March 12, 2023, 9:51pm UTC](https://forum.elixirforum.com/t/codegen-simple-succint-and-customizable-code-generation-for-your-libraries/54521 "2023-03-12T21:51:22Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![mayel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mayel/32/26431_2.png) [@mayel](https://forum.elixirforum.com/u/mayel)\
**Post date:** [March 13, 2023, 5:11am UTC](https://forum.elixirforum.com/t/codegen-simple-succint-and-customizable-code-generation-for-your-libraries/54521/10 "2023-03-13T05:11:10Z")

</div>

@tmbb makes sense, best of luck!

For anyone else following along, I’ve slightly updated the previously posted code (notably to obtain the last line number of a function definition along with the first so we can copy a entire function’s definition(s) block out of a code file), which means that combined with the `inject_before_final_end` function from `CodeGen` (thanks @tmbb 🙂 how are you planning the library?) we can inject/dump a function from a template module into our code.

[edit] full code here: [module\_extend.ex · GitHub](https://gist.github.com/mayel/e82a73d09ae608fbea3308359bc9c3fe)

---

_[View the full topic](https://forum.elixirforum.com/t/codegen-simple-succint-and-customizable-code-generation-for-your-libraries/54521)._
