Templates are helpful in that they automate boilerplate code/structure. Sometimes a project has project specific data that can be pulled and automated into creating the project, like the creation date and the project name.
Placeholders allow developers to specify what data should go where when using a template. For example, typing %DATE% within a file found in the template will, upon usage, swap that placeholder for the date the project was made.
Default placeholders are:
%AUTHOR%, for the user's name
%BLOCK%, for the block's title
%DATE%, for the current date
TEMPLATE, for the block's name
In theory, there could be more placeholders depending on the user's situation. If the user is using this template for a specific course, they could create a placeholder %COURSE%, which would be replaced by a value for course found in the settings.cfg. Or, if the user is a part of an organization, a placeholder %ORG% could be specified to give a place for a value for org found in the legohdl.cfg file.
These user-defined placeholders can exist in settings.cfg as a dictionary called placeholders. Users should not enter placeholders in settings with surrounding %, yet they are referenced with surrounding % in files within a template.
If a user tries to add a user-defined placeholder with same name as one of the defaults, it will be ignored.
Templates are helpful in that they automate boilerplate code/structure. Sometimes a project has project specific data that can be pulled and automated into creating the project, like the creation date and the project name.
Placeholders allow developers to specify what data should go where when using a template. For example, typing
%DATE%
within a file found in the template will, upon usage, swap that placeholder for the date the project was made.Default placeholders are:
%AUTHOR%
, for the user's name%BLOCK%
, for the block's title%DATE%
, for the current dateTEMPLATE
, for the block's nameIn theory, there could be more placeholders depending on the user's situation. If the user is using this template for a specific course, they could create a placeholder
%COURSE%
, which would be replaced by a value forcourse
found in thesettings.cfg
. Or, if the user is a part of an organization, a placeholder%ORG%
could be specified to give a place for a value fororg
found in thelegohdl.cfg
file.These user-defined placeholders can exist in settings.cfg as a dictionary called
placeholders
. Users should not enter placeholders in settings with surrounding%
, yet they are referenced with surrounding%
in files within a template.If a user tries to add a user-defined placeholder with same name as one of the defaults, it will be ignored.