Skip to content

Add config generator#12

Open
vrana wants to merge 1 commit intonoctud:mainfrom
vrana:generate
Open

Add config generator#12
vrana wants to merge 1 commit intonoctud:mainfrom
vrana:generate

Conversation

@vrana
Copy link
Copy Markdown
Contributor

@vrana vrana commented Sep 26, 2025

This is an example config:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
	<component name="LattePluginSettings">
		<customMacroSettings>
			<list>
				<LatteTagSettings MacroName="normal" />
				<LatteTagSettings MacroType="ATTR_ONLY" MacroName="attrOnly" />
				<LatteTagSettings MacroName="pair" />
			</list>
		</customMacroSettings>
		<customModifierSettings>
			<list>
				<LatteFilterSettings ModifierName="myFilter" ModifierHelp="param" />
			</list>
		</customModifierSettings>
		<customFunctionSettings>
			<list>
				<LatteFunctionSettings FunctionReturnType="bool" FunctionName="myFunction" FunctionHelp="(param)" />
			</list>
		</customFunctionSettings>
	</component>
</project>

Please let me know if it can be improved.

@delacry
Copy link
Copy Markdown
Member

delacry commented Oct 2, 2025

Thank you for contributing, I'll look at it during this or next weekend.

I wonder if we could make it as a single binary script like latte-xml-export.php or without .php (in the root of this repo) that users would just copy to bin folder (where usually the console script is), because I would like to keep the directory structure slim in this repository, and also it would be easier for users - they don't need to clone/download this repo.

With that in mind, it could try to require composer autoload and create nette container (via App\Bootstrap::boot()->createContainer()) or warn user if it could not be created - so user has to change that line or add extensions manually (some commented section in script at the start) when the script is run with no modification.

If the container is created, then we can use Latte\Engine::getExtensions() to retrieve all loaded extensions and generate config based on this, so there would be no additional work by the user, and all latte extensions would be exported to the xml.

@delacry
Copy link
Copy Markdown
Member

delacry commented Oct 10, 2025

@vrana what do you think? I can make it a single PHP script in another PR and use some code from this one if you want, or you could edit this one if you have the time.

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

Successfully merging this pull request may close these issues.

2 participants