{%- macro inventory(compare, compareWith) -%}
{%- set ns = namespace(has_inventory=false) -%}
{%- for item in documents.inventory -%}
	{%- if (item[compare]) -%}
	{%- if (item[compare].capitalize() | slugify) == (compareWith.capitalize() | slugify) -%}
		{%- set ns.has_inventory = true -%}

	{%- endif -%}
	{%- endif -%}
{%- endfor -%}

{%- if ns.has_inventory -%}
	<table>
		<thead>
			<tr>
				<th>Name</th>
				<th>Value</th>
				<th>type</th>
				<th>Where</th>
				<th>When</th>
			</tr>
		</thead>
		<tbody>
			{%- for item in documents.inventory -%}
				{%- if (item[compare])  -%}
					{%- if (item[compare].capitalize() | slugify)== compareWith  -%}
						<tr>
							<td>{{item.Name}}</td>
							<td>{{item.Value}}</td>

							<td><a href="/components/{{item.type | slugify}}.html">{{item.type}}</a></td>

							<td><a href="/devices/{{item.Where | slugify}}.html">{{item.Where}}</a></td>
							<td>{{item.Date}}</td>
						</tr>
					{%- endif -%}
					{%- else -%}
					other {{compare}} {{item}}
				{%- endif -%}
			{%- endfor -%}

		</tbody>
	</table>

{%- else -%}
	No components were identified yet {{compare}} {{compareWith}}
{%- endif -%}
{%- endmacro -%}