File diff 34b71baaf7af → b41a7a99af17
CODE.rst
Show inline comments
...
 
@@ -42,25 +42,25 @@ Class method ``can_handle(source_file)``
 
Class attribute ``TEMPLATE_KEY``
 
  A string with the full key to load the corresponding template from the user's configuration (e.g., ``'template patreon income'``).
 

	
 
Hooks
 
~~~~~
 

	
 
Hooks make arbitrary transformations to entry data dicts.  Every entry data dict generated by an importer is run through every hook before being output.
 

	
 
``__init__(config)``
 
  Initializes the hook with the user's configuration.
 

	
 
``run(entry_data)``
 
  This method makes the hook's transformations to the entry data dict, if any.  If this method clears the entry data dict, that entry will not be output.
 
  This method makes the hook's transformations to the entry data dict, if any.  If this method sets ``entry_data['_hook_cancel']`` to a truthy value, that entry will not be output.
 

	
 
Templates
 
~~~~~~~~~
 

	
 
Templates receive entry data dicts and format them into final output entries.
 

	
 
``__init__(template_str)``
 
  Initializes the template from a single string, as read from the user's configuration.
 

	
 
``render(entry_data)``
 
  Returns a string with the output entry, using the given entry data.