Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ysaito8015
Copy link
Contributor

mdtohtml, mdtodocx それぞれの w-mdtohtml, w-mdtodocx を追加しました
latex の変換は --weblatex オプションから, Google Chart APIで画像に変換しています

@p1ass p1ass self-requested a review October 29, 2019 23:54
@p1ass p1ass added the enhancement New feature or request label Oct 29, 2019
Copy link
Owner

@p1ass p1ass left a comment

Choose a reason for hiding this comment

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

PRありがとう!
2点お願いがあります。

  1. exampleディレクトリにこれらのスクリプトを使って生成されたファイルを追加してほしいです。実際にどのように変換されるか分かった方が良いので。

  2. READMEに使い方を書いてほしいです。 Generate tex file from markdown と同じように書けば大丈夫です。

@ysaito8015
Copy link
Contributor Author

早速レビューありがとう!
追加しました!

Copy link
Owner

@p1ass p1ass left a comment

Choose a reason for hiding this comment

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

exampleを追加してくれてありがとう。
改めて何点かコメントしたので確認お願いします🙇

scripts/mdtodocx Outdated
Comment on lines 3 to 6
FILE="reference.docx"
if [ ! -e $FILE ]; then
pandoc --print-default-data-file reference.docx > /workdir/reference.docx
fi
Copy link
Owner

Choose a reason for hiding this comment

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

見逃していたのですが、これって残しておく必要ありますか?

毎回 reference.docx ファイルが生成されてしまいますが、利用者側はこのファイルは使わないと思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

なるほど...
reference.docx が存在しない場合に生成するにしても, 中途半端でしたね

たしかにこの部分を削ってしまって
デフォルト設定で変換して, 出力後のファイルをいじってもらうほうが良さそうですね

scripts/mdtodocx Outdated
pandoc --print-default-data-file reference.docx > /workdir/reference.docx
fi
pandoc -s -N ${str%.*}.md --webtex -t html \
--metadata pagetitle=${str%.*}.md \
Copy link
Owner

Choose a reason for hiding this comment

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

ページタイトルに .md という文字列を追加する必要ってありますか?
${str%.*} だけのほうがスッキリして良さそうに感じます。

Copy link
Owner

Choose a reason for hiding this comment

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

また、Markdown 上で

---
title: 'PDFの変換例'
---

と書くことでタイトルを変更できるので、ユーザ側が自由にタイトルを設定できるようするために、強制的にファイル名をタイトルにする必要はないかなと感じます。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ありがとうございます!
完全に見落としていました....

scripts/mdtohtml Outdated
#!/bin/bash
str=$1
pandoc -s -N ${str%.*}.md --webtex -o ${str%.*}.html \
--metadata pagetitle=${str%.*}.md \
Copy link
Owner

Choose a reason for hiding this comment

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

ここも上と同様です。

@ysaito8015
Copy link
Contributor Author

指摘部分を修正しました!

scripts/mdtodocx Outdated
@@ -0,0 +1,7 @@
#!/bin/bash
str=$1
FILE="reference.docx"
Copy link
Owner

Choose a reason for hiding this comment

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

この変数宣言消し忘れてますね

Suggested change
FILE="reference.docx"

Copy link
Owner

@p1ass p1ass left a comment

Choose a reason for hiding this comment

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

修正ありがとうございます!
良さそうです 👍

最後にrebaseしてcommitをまとめて、PRのタイトルをしっかりとしたものに変えてもらって良いですか?

@ysaito8015
Copy link
Contributor Author

レビューありがとうございます!! ;)

@ysaito8015 ysaito8015 changed the title Mdtodocx Add support for markdown to docx and html Oct 31, 2019
Copy link
Owner

@p1ass p1ass left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@p1ass p1ass merged commit e530172 into p1ass:master Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants