Export Script Variable Substitution

@jonathan I saw that you are using substitution variables from the regular templates.

Does this mean we can use all variables that are supported in the included template in resources when returning modified template syntax? Hence, is the returned HTML run thought the regular substitution again? I wondered because the name has already been substituted at this point…

The script itself is performing the substitutions based on items provided in the export_info_json_path file, just for the insert_at_head_start variable.

See lines ~187-196:

		# read export_info.json file
		export_info_file = open(args.export_info_json_path)
		export_info = json.loads(export_info_file.read())
		# add in clickTag, width/height into insert_at_head_start variable
		global insert_at_head_start
		template = string.Template(insert_at_head_start)

		insert_at_head_start = template.substitute({'width' : export_info['main_container_width'], 'height' : export_info['main_container_height'] })

(I realize the clicktag comment is now wrong, and will fix that)

Of course you can do anything you want with your own export scripts, but that's just how this one currently works.

Thanks, I totally overlooked that. I use a home brew substitution, so I wondered if there would be a short cut.

1 Like

It might be interesting to expand the magic variables in Hype (like adding ${mainContainerWidth} alongside ${resourcesFolderName}), though this would be substituted before it hits the export script.