This paper presents a general approach to automatically compile e-learning models to planning, allowing us to easily generate plans, in the form of learning designs, by using existing domain-independent planners. The idea is to compile, first, a course defined in a standard e-learning language into a planning domain, and, second, a file containing students learning information into a planning problem. We provide a common compilation and extend it to three particular approaches that cover a full spectrum of planning paradigms, which increases the possibilities of using current planners: (i) hierarchical, (ii) including PDDL (Planning Domain Definition Language) actions with conditional effects and (iii) including PDDL durative actions. The learning designs are automatically generated from the plans and can be uploaded, and subsequently executed, by learning management platforms. We also provide an extensive analysis of the e-learning metadata specification required for planning, and the pros and cons on the knowledge engineering procedures used in each of the three compilations. Finally, we include some qualitative and quantitative experimentation of the compilations in several domain-independent planners to measure its scalability and applicability.