Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting implementation for OpenDocument/ODT output #6710

Closed
3 tasks done
niszet opened this issue Oct 1, 2020 · 4 comments
Closed
3 tasks done

Syntax highlighting implementation for OpenDocument/ODT output #6710

niszet opened this issue Oct 1, 2020 · 4 comments

Comments

@niszet
Copy link
Contributor

niszet commented Oct 1, 2020

Hi,

I would like to use Pandoc's ODT output like a Docx output as much as possible. Syntax highlighting is one of missing feature of ODT output.

From an advice from pandoc-discuss, I update Writer/OpenDocument.hs to implement syntax highlighting for ODT. Its code are based on Docx's one. Thank you for the advice.

I will send a PR and I would appreciate if someone review it.

But, there are several steps to implement syntax highlighting for ODT output. I did only first part of followings.

  • Update Code of Writer/OpenDocument.hs for highlighting
  • Update CodeBlock of Writer/OpenDocument.hs for highlighting (with changing paragraph structure like a docx style)
  • Update Writer/ODT.hs for generating styles into style.xml from skylighting.

ODT's CodeBlock has a different structure from Docx's CodeBlock. For implementing highlighting for CodeBlock, structure of paragraphs should be changed to Docx's structure (CodeBlock will be converted to Codes inside of Para)

Highlighting styles from skylighting should be generated automatically and it should be incorporated into styles.xml. To implement it, Writer/ODT.hs need to have styleToOpenDocument based on Docx's styleToOpenXml.

I will continue implement aboves. Please let me know if you have any opinions.

Thanks,
niszet

@niszet
Copy link
Contributor Author

niszet commented Oct 1, 2020

Pull Request is prepared as #6711 .

@jgm
Copy link
Owner

jgm commented Oct 1, 2020

so far, so good!

@niszet
Copy link
Contributor Author

niszet commented Oct 4, 2020

Thank you for merging! and sorry for bothering you by my PRs...
PR #6717 is for checking a concept of modification (lack of updating of tests). (But now, I notice "Source_Code" should be "Source_20_Code". I should update again.)

Except above styles name issue, objectives of updates are noted in #6717 (comment) .

Because styles will be updated from Writer/ODT.hs, this update does not contain styles file. But my local work (I put style file by my hand.), this code works as similar to docx's CodeBlock as below. (SourceCode paragraph and Code+LineBreak lines and it seems good.)

image

Is this breaking change (to be Code+LineBreak) is acceptable? If the style name is inadequate, I will change back to original (or any other good name)

Please let me know if you have any opinions.

Thanks,
niszet

@jgm
Copy link
Owner

jgm commented Oct 4, 2020

I'm not sure I really understand what you're asking here. Can you explain again?

jgm added a commit that referenced this issue Aug 4, 2023
We still aren't injecting the style, but this will improve things.
See #6710.
jgm added a commit that referenced this issue Aug 4, 2023
Currently only colors are supported, not other text styles.

This change includes a new default opendocumnet template.

See #6710.
@jgm jgm closed this as completed in 0873895 Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants