chaseruskin / legoHDL

An experimental package manager and development tool for Hardware Description Languages (HDL).
https://c-rus.github.io/legoHDL
MIT License
14 stars 2 forks source link

Ability to add more placeholders in settings for template creations #25

Closed chaseruskin closed 2 years ago

chaseruskin commented 3 years ago

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:

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.

chaseruskin commented 3 years ago

This has been added with support currently only in file mode. However, it still needs to be implemented in the GUI mode.

chaseruskin commented 2 years ago

This is supported in file mode and this issue will be closed and wrapped into #53