That's really not the answer I'd have hoped to hear...

Do you know if a PR fixing this might be getting accepted?
It's really limiting when perfectly valid yaml can't be used as template input.

Thanks a lot though.

Am Montag, 2. September 2019 19:28:41 UTC+2 schrieb John MacFarlane:

In pandoc's templating system:

Variable names must begin with a letter and can contain letters,
numbers, _, -, and ..

No spaces.

One approach would be to use a lua filter to dynamically rename
the metadata fields, converting spaces to _.
You could then use _ in the template.


Frederik Hartmann <hec...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Yes, I tried this as well.
>
> $if(dependencies.external.hardware."Dependency On")$\textbf{Dependency:} &
> $dependencies.external.hardware.dependency$ \\ $endif$
>
> Causes the following error:
>
> unexpected "\""
> expecting letter
>
> In comparison, an unquoted regular blank causes this error:
>
> unexpected " "
> expecting "." or ")$"
>
>
>
>
>
> Am Montag, 2. September 2019 11:37:45 UTC+2 schrieb James:
>>
>> Hi
>>
>> Have you tried enclosing the content containing spaces within quotation
>> marks?
>>
>> Sent from my iPhone
>>
>> On 2 Sep 2019, at 10:10, Frederik Hartmann <hec...@gmail.com <javascript:>>
>> wrote:
>>
>> Hi!
>>
>> We are using rather complicated templates to display certain information
>> about dependencies.
>> These information can be exported in yaml files and looks like the
>> following:
>>
>> ---
>> dependencies:
>>   external:
>>     hardware:
>>     - Description: Text here....
>>       Dependency On: Text here....
>>       Date Required: Text here....
>>       Dependency Owner: Text here....
>>       Color: Text here....
>>       Status: Text here....
>>       Last Updated: Text here....
>>       State: Text here....
>> ...
>>
>> This is a perfectly valid and well-formed yaml document.
>>
>> Now, the best thing would be if I could simply loop over these attributes
>> without having to specify them directly.
>> The next best thing would be if I could access them via the usual method:
>>
>> $for(dependencies.external.hardware)$
>> $if(dependencies.external.hardware.Description)$\textbf{Description:} &
>> $dependencies.external.hardware.Description$ \\ $endif$
>> $endfor$
>>
>>
>> The issue are with the keys that contain spaces. I can't find a way to
>> access them at all.
>>
>> I tried it the following ways:
>> $if(dependencies.external.hardware.Dependency On)$
>> $if(dependencies.external.hardware.Dependency\ On)$
>>
>> Any suggestion?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/92055fd0-049b-4943-a51a-2eb0905b59ca%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/92055fd0-049b-4943-a51a-2eb0905b59ca%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/68fbd484-0729-4ee2-a7a2-0846cd0bbd28%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7c15c170-1b08-4274-b24e-280b4585c0c6%40googlegroups.com.