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

feat: Add facility to convert documents with pandoc #10

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

fghaas
Copy link
Contributor

@fghaas fghaas commented Mar 14, 2022

Add a facility to, with relative ease, create OpenDocument Text and Word documents from the original Markdown. To use, run

tox -e to-odt -- -o output.odt input1.md input2.md input3.md

or

tox -e to-docx -- -o output.docx input1.md input2.md input3.md

To achieve this, a simple script concatenates the input files, processes them against mkdocs.yml using the Jinja2 CLI, and feeds the result to pandoc with appropriate command-line options.

For branding, reference.docx and reference.odt files can be placed into the pandoc subdirectory.

Also, add bashate testing for the script itself.

@fghaas fghaas requested a review from evrardjp March 14, 2022 14:08
Copy link
Contributor

@evrardjp evrardjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add the bashate test to .github/workflows/tox.yml

tox.ini Show resolved Hide resolved
Add a facility to, with relative ease, create OpenDocument Text and
Word documents from the original Markdown. To use, run

tox -e to-odt -- -o output.odt input1.md input2.md input3.md

or

tox -e to-docx -- -o output.docx input1.md input2.md input3.md

To achieve this, a simple script concatenates the input files, processes
them against mkdocs.yml using the Jinja2 CLI, and feeds the result to
pandoc with appropriate command-line options.

For branding, reference.docx and reference.odt files can be placed
into the pandoc subdirectory.

Also, add bashate testing for the script itself.
There are several issue with admonitions, or rather with the way they
are being rendered in the context of Material for MKDocs:

* Their font is smaller than the text body font, which is
  counterproductive for a piece of information that is meant to be
  emphasised.

* They use their own colour scheme, which is hard to align with
  branding.

* They use their own syntax which involves indentation, and thus
  hijacks what's otherwise meant for preformatted text.

* That specific meaning is lost on pandoc, which will render the
  admonitions as preformatted text in the process of converting to
  other formats.

Thus, remove the admonitions. Convert them to regular paragraphs when
appropriate; turn them into blockquotes when they do require
additional emphasis.
@fghaas
Copy link
Contributor Author

fghaas commented Mar 14, 2022

Please also add the bashate test to .github/workflows/tox.yml

Yup, done.

Copy link
Contributor

@evrardjp evrardjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to merge those 2 commits inside this PR?

The first one isn't linked to the ability to convert documents with pandoc.

refactor: Remove Markdown admonitions

@evrardjp
Copy link
Contributor

Please also add the bashate test to .github/workflows/tox.yml

Yup, done.

Thanks, the code looks good now.

@fghaas
Copy link
Contributor Author

fghaas commented Mar 15, 2022

Do we need to merge those 2 commits inside this PR?

The first one isn't linked to the ability to convert documents with pandoc.

Yes it is, as its commit message states:

  • That specific meaning is lost on pandoc, which will render the admonitions as preformatted text in the process of converting to other formats.

@evrardjp
Copy link
Contributor

Ha, I guess I misread it, cause I looked at the commit message. LGTM then.

@fghaas
Copy link
Contributor Author

fghaas commented Mar 15, 2022

Ha, I guess I misread it, cause I looked at the commit message. LGTM then.

Ack, can you change your review to "Approved" please?

@evrardjp evrardjp merged commit a602992 into citynetwork:main Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants