Yeah! I did it and it's, but formatting fully working. Thanks!
Now I'm getting some formatting issues, so I'll open a new thread for it.
Thanks!!
El miércoles, 27 de abril de 2016, 19:21:35 (UTC+2), John MacFarlane
escribió:
>
> Well, you could always use python or something instead of
> bash; that would allow you to put arbitrary string values
> in as command line arguments without worrying about escapes
> and quoting.
>
> +++ JDani Jiménez [Apr 27 16 05:00 ]:
> > This solution is not working... The -V $(pandoc...) commands output
> > contains characters that are control characters for bash, so the
> > command cannot be launched like that.
> > Example:
> > $ pandoc --template odt.template main.md -t opendocument -o my.odt -V
> > s1=$( pandoc -t opendocument -f markdown sections/section1.md ) -V
> > s2=$( pandoc -t opendocument -f markdown sections/section2.md ) -V
> > s3=$( pandoc -t opendocument -f markdown sections/section3.md )
> > pandoc: text:style-name="Heading_20_1": openFile: does not exist (No
> > such file or directory)
> > The same, but with the debug enabled:
> > $ set -x
> > $ pandoc --template odt.template main.md -t opendocument -o my.odt -V
> > s1=$( pandoc -t opendocument -f markdown sections/section1.md ) -V
> > s2=$( pandoc -t opendocument -f markdown sections/section2.md ) -V
> > s3=$( pandoc -t opendocument -f markdown sections/section3.md )
> > ++ pandoc -t opendocument -f markdown sections/section1.md
> > ++ pandoc -t opendocument -f markdown sections/section2.md
> > ++ pandoc -t opendocument -f markdown sections/section3.md
> > + pandoc --template odt.template main.md -t opendocument -o my.odt -V
> > 's1= > 'text:outline-level="1">Encabezado' '1' ' > 'text:style-name="Heading_20_2"' 'text:outline-level="2">Encabezado'
> > '2' ' > 'text:outline-level="3">Encabezado' '3' ' > 'text:style-name="L1">' '' ' > 'text:style-name="P1">lista' item '1' ''
> > '' 'lista' item
> > '2' '' '' ' > 'text:style-name="P1">lista' item '3' ''
> > '' -V 's2=Prueba'
> > de texto en 'Negrita' ,
> > 'cursiva,' ' > 'text:style-name="T3">tachado' y ' > 'text:style-name="T4">mezcla > 'text:style-name="T5">' ' > 'text:style-name="T6">de 'text:style-name="T7">'
> > ' > 'text:style-name="T8">negrita > 'text:style-name="T9">' ' > 'text:style-name="T10">y > 'text:style-name="T11">' ' > 'text:style-name="T12">negrita > 'text:style-name="T13">' ' > 'text:style-name="T14">cursiva' -V 's3= > 'text:style-name="Text_20_body">Prueba' de link: ' > 'xlink:type="simple"' 'xlink:href="https://www.google.com"'
> > 'office:name="">I'\''m' an
> > inline-style link with 'title' Prueba de imagen:
> > ' > 'xlink:href="deloitte.jpg"' 'xlink:type="simple"' 'xlink:show="embed"'
> > 'xlink:actuate="onLoad"' '/>' Prueba de 'código'
> > 'Prueba' de 'código'
> > pandoc: text:style-name="Heading_20_1": openFile: does not exist (No
> > such file or directory)
> > I tryed these ways to get
> > * Using quotes and scaping quotes in the output of pandoc variable
> > commands. Like this
> >
> > pandoc \
> > --template odt.template \
> > main.md \
> > -o my.odt \
> > -V s1="$( pandoc -t opendocument -f markdown sections/section1.md |
> > sed 's/"/\\"/g')" \
> > -V s2="$( pandoc -t opendocument -f markdown sections/section2.md |
> > sed 's/"/\\"/g')" \
> > -V s3="$( pandoc -t opendocument -f markdown sections/section3.md |
> > sed 's/"/\\"/g')"
> > Result: Malformed odt. Quotes keep scaped in contet.xml
> > * A three steps procedure
> >
> > * Compose an xml opendocument file, with quotes scaped
> > * Remove backslashes, unscape quotes
> > * Generate the odt
> >
> > $ pandoc \
> > --template odt.template \
> > main.md \
> > -t opendocument \
> > -o my.odt.xml \
> > -V s1="$( pandoc -t opendocument -f markdown sections/section1.md |
> > sed 's/"/\\"/g')" \
> > -V s2="$( pandoc -t opendocument -f markdown sections/section2.md |
> > sed 's/"/\\"/g')" \
> > -V s3="$( pandoc -t opendocument -f markdown sections/section3.md |
> > sed 's/"/\\"/g')"
> > $ sed -i -e 's/\\"/"/g' my.odt.xml
> > $ pandoc --template my.odt.xml main.md -o my.odt
> > Result: Empty .odt file, but elements in content.xml seem ok??¿!
> > * Generating a yaml file in order to make pandoc read vars from it,
> > rather than from the command line and avoid.
> >
> > Result: In progress... I couldn't make pandoc read markdown from yaml.
> > However, I'm in doubt about what main.md is... I'm using a just
> touched
> > file.
> > El martes, 26 de abril de 2016, 23:22:51 (UTC+2), John MacFarlane
> > escribió:
> >
> > There are two things to fiddle with. The --reference-odt,
> > which can help with style (spacing, margins, etc.), and
> > the opendocument template, which is a place to put hooks
> > for content.
> > You can create a custom opendocument template (use
> > 'pandoc -D opendocument' to get the default one).
> > In place of $body$ you might have, for example,
> > $s1$, $s2$, and $s3$, perhaps with some content
> > intervening.
> > You can then use pandoc to fill these variables:
> > pandoc --template mycustom.opendocument [1]main.md -o my.odt \
> > -V s1=$(pandoc -f markdown -t opendocument [2]s1.md)
> > -V s2=$(pandoc -f markdown -t opendocument [3]s2.md)
> > -V s3=$(pandoc -f markdown -t opendocument [4]s3.md)
> >
> > --
> > 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 [5]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org .
> > To post to this group, send email to
> > [6]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org .
> > To view this discussion on the web visit
> > [7]
> https://groups.google.com/d/msgid/pandoc-discuss/59292504-c115-4935-
> > b7e2-004c0c875289%40googlegroups.com.
> > For more options, visit [8]https://groups.google.com/d/optout.
> >
> >References
> >
> > 1. http://main.md/
> > 2.
> http://www.google.com/url?q=http://s1.md&sa=D&sntz=1&usg=AFQjCNFfOk5lY6XBrSOLLvz5QcCpy_EH-w
> > 3. http://s2.md/
> > 4. http://s3.md/
> > 5. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > 6. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > 7.
> https://groups.google.com/d/msgid/pandoc-discuss/59292504-c115-4935-b7e2-004c0c875289-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
> > 8. https://groups.google.com/d/optout
>
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a5ea9be7-5547-4124-a71c-f88481a97649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.