Well… it does work but, somehow, docx+styles messes with the lists :
For a simple docx with just one list, unordered here is what I get with -f docx+styles -t dokuwiki :
<HTML><ul></HTML>
<HTML><li></HTML><HTML><p></HTML>Liste 1<HTML></p></HTML>
<HTML></li></HTML>
<HTML><li></HTML><HTML><p></HTML>liste 2<HTML></p></HTML>
<HTML></li></HTML>
<HTML><li></HTML><HTML><p></HTML>liste 3<HTML></p></HTML>

<HTML><ul></HTML>
<HTML><li></HTML><HTML><p></HTML>liste 3a<HTML></p></HTML>
<HTML></li></HTML>
<HTML><li></HTML><HTML><p></HTML>liste 3b<HTML></p></HTML>
<HTML></li></HTML>
<HTML><li></HTML><HTML><p></HTML>liste 3c<HTML></p></HTML>
<HTML></li></HTML><HTML></ul></HTML>
<HTML></li></HTML>
<HTML><li></HTML><HTML><p></HTML>liste 4<HTML></p></HTML>
<HTML></li></HTML><HTML></ul></HTML>

Which is not parsed by dokuwiki.


Without +styles :
  * Liste 1
  * liste 2
  * liste 3
    * liste 3a
    * liste 3b
    * liste 3c
  * liste 4

Which is syntactically correct dokuwiki format.

If I understand it well, Pandoc seems to consider an ordered list badly formatted only when +styles is applied and it spits out some raw html with <p> tags inside <li>s

So what is it ? Bad implementation in Dokuwiki writer ? 
How can I benefit from both +styles, with my lua filter, and lists ? 

--
  Pascal
Le lundi 26 juin 2023 à 16:04:17 UTC+2, Sigismond a écrit :
Thanks a lot Bastien, it works perfectly well.

Le lundi 26 juin 2023 à 15:47:00 UTC+2, Bastien DUMONT a écrit :
With `-f docx+styles`, you can replace the divs with custom styles with this kind of filter:

```
function Div (div)
local custom_style = div.attributes['custom-style']
if custom_style then
local pre = pandoc.RawBlock('dokuwiki', '<WARP "' .. custom_style .. '">')
local post = pandoc.RawBlock('dokuwiki', '</WARP>')
local content = div.content
table.insert(content, 1, pre)
table.insert(content, post)
return content
end
end
```

Le Monday 26 June 2023 à 06:16:48AM, Sigismond a écrit :
> OK, let's try it another way :
>
> I plan to use Pandoc to convert several docx files to dokuwiki format.
> I need to retain custom block styles and convert them to custom tags, something
> like 
>
> <WARP my-custom-block-style>
> my dokuwiki formatted block text
> </WARP>
>
> Do I need to develop a custom dokuwiki writer from scratch to do that or is
> there a way to use lua filters for this purpose.
> Sorry if the answer is obvious but I struggle to find relevant information.
>
> Thanks for any help,
> --
>   Pascal
>
>
> Le mercredi 26 avril 2023 à 16:14:20 UTC+2, pascal Conil-lacoste a écrit :
>
> Hi everybody,
>
> I've been using pandoc for some years to accomplish very straightforward
> conversions.
> Now that what I plan to do is a little more complex, I struggle to find
> relevant information.
>
> I need to convert docx to dokuwiki and retain Word custom styles. I thought
> I could use docx+styles to get custom-styles in dokuwiki files but they
> don't make it to the output and get stripped.
>
> I would be happy with ::: {custom-style="myStyle"} my text here:::
>
> If I could get something along these lines, I would be able to apply some
> other simple transformation to get to the final dokuwiki files and treat
> them with a plugin.
>
> What is the best way to achieve this ? Filters ? Templates ?
>
> Any help welcome!
>
> --
> 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%40googlegroups.com.
>
> References:
>
> [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/bdc377c4-3918-4f0f-a87e-a66f9d128cc2n%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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f0b95670-24a3-4870-842f-fb6e7791a694n%40googlegroups.com.