Skip to content
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

Remove or simplify regex in list-widgets and make-widgets commands #43

Closed
ClmntBcqt opened this issue Jul 19, 2024 · 2 comments
Closed

Comments

@ClmntBcqt
Copy link
Contributor

Try to get the widgets (macros) with jinja engine directly.
Regex are hard to debug and maintain.

@ClmntBcqt
Copy link
Contributor Author

For list-widgets command :

  • Use of jinja2 parser to find all macros in files, list all files and all macros inside.

  • Add a warning for ambiguous macro name (same macro name and filename)

For make-widgets command :

  • Replace the command by a method in Document class, to not create an import file with all macros but directly write the imports before the body content of pages and post. It allow to have macro with same name in different files, and call them with filename.macroname(...).

  • Add doc and an example.

@ClmntBcqt
Copy link
Contributor Author

Merged in #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant