-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: Add @param comment syntax in template IDE hints #3
Comments
@JohnathonKoster Adding your comment from Discord for reference:
Edit: added spaces to not at-mention a ton of GitHub usernames on accident -JK (Thank you! MM) |
The final syntax to make this work is: ---
classes: 'flex w-full sm:inline-flex items-center justify-center py-2 px-4 rounded-full border border-transparent text-base font-medium focus:outline-none focus:ring-4 focus:ring-opacity-50'
sizes:
large: 'sm:text-lg sm:py-3 sm:px-5'
types:
primary: 'text-white bg-primary-500 hover:bg-primary-400 focus:ring-primary-600'
secondary: 'text-secondary-900 bg-secondary-100 hover:bg-secondary-50 focus:ring-secondary-200 dark:text-white dark:bg-secondary-800 dark:hover:bg-secondary-700 dark:focus:ring-secondary-900'
disabled: 'text-gray-400 bg-gray-200 dark:text-white dark:bg-secondary-800 dark:opacity-75 cursor-not-allowed'
---
{{#
@name Button
@param bool someBool This is just a normal parameter that'd show up in auto-complete.
@param @front types type The button type.
@param @front sizes size The button size.
#}}
<button type=submit"
class="{{ view }}{{ classes }} {{ sizes[size] }} {{ types[type] }}{{/view}}">...</button> |
It drops the |
I've been experimenting with a convention for props in Antlers partials using the view frontmatter. It would be useful to extend templates IDE hints with a comment syntax like the example below.
{{ partial:button type="primary" size="large" }}
The text was updated successfully, but these errors were encountered: