Executing Dynamic Templates

Run dynamic templates during creation


Once you have defined your dynamic template with comment markers, files, and folders associated with specific features from the placecode.json file, you can execute the dynamic template using the placecode run command. This allows you to test the template on the go and see how the selected features impact your project.

Executing Command

By running the command placecode run, the dynamic template will be processed based on the enabled features specified in the placecode.json file. The command will make the necessary changes to your project, ensuring that only the code blocks, files, and folders related to the selected features are included, while the code blocks related to unselected features are temporarily commented out and and files or folders will be moved to a temporary folder inside the .placecode directory.

Feature Selection

To select or unselect features, you need to manually change the boolean value of the enabled field in the features section of the placecode.json file. Setting enabled: true will include the feature in the dynamic template, while setting enabled: false will exclude the feature from the template.

Reverting Changes

To revert the changes made by the placecode run command and return your project to its original state, you can use the command placecode re. This command will undo the modifications made during the dynamic template execution process, ensuring that all code blocks, files, and folders are restored to their initial positions.

With the placecode run and placecode re commands, you can easily test dynamic features in your project without having to manually modify code blocks and files. This facilitates a seamless development experience, allowing you to focus on building the functionalities that matter most to your project.