Is it possible to automatically export a .m package when I save my .nb as can be done using the option "AutoGeneratedPackage->Automatic" see https://mathematica.stackexchange.com/a/31323/45020 but presrving the section headings and text cells? (Still excluding non-initialization cells.) Unfortunately the AutoGeneratePackage does not include headings by default.
It was pointed out to me by Jason B. that the default export using Save As Package does preserve the headings as I would like. Can we get this behavior also in some automated method (ideally exporting every time I save the .nb).
About my edit: Originally I did not know that Save As Package does preserve the headings. I assumed that the behavior of "AutoGeneratedPackage->Automatic" was the default. While Save As does offer a solution I would much prefer an automatically exporting one.
File->Save As->and select Package from the dropdown menu. Just be aware that any code you want to save to the package must be in aCodecell. – Jason B. Jun 11 '21 at 14:21Codecells. – Kvothe Jun 11 '21 at 14:27"AutoGeneratedPackage->Automatic"(see https://mathematica.stackexchange.com/a/31323/45020). This automatic method does not preserve text cells and headings. I will edit my question to ask the better question of how to automatically generate a package that preserves these. – Kvothe Jun 11 '21 at 14:51