Comments (18)
@miminari
PRがマージされ、npmパッケージも公開いただきましたので、
- en ブランチの更新
- master ブランチへマージ
が終わり次第、このissueはクローズしますね 😄
from core-handbook.
こちらのコメントに書いた通り自分も気になっていまして、翻訳する時にトリムすれば良いものなのかなと思ってたのですが、本来はコンバータ通した時点でトリムされるということですよね 🤔
from core-handbook.
了解しました!
自分も調べてみます😀
from core-handbook.
やりますよー👍
「不要な箇所のエスケープ処理」というのはどの辺りの箇所ですか?
from core-handbook.
Wayback Machineを使って2~3年前のソースと比較してみたのですが、glossary周りのタグ構造は変わってないので、おそらく strong
タグで囲まれた場合にトリムできていないのかな?と思います。
(通常の本文内のglossaryはちゃんとトリムされてるっぽいです)
ちょっとそのあたりを調べてみます。
@t-hamano 上でリンクしてるPRの部分ですー!
cli.jsの92行目あたり
マークダウンに変換されるときに、不要な「\」が追加されてるという意味かと思ったのですが、合ってますか?
例えばこういう箇所です
もしここの箇所の事であれば、バックスラッシュのエスケープ処理なので問題無いのかなと思っています
from core-handbook.
@miminari
とりいそぎ、ローカルで手を加えたwp-handbook-converterを使って、コアハンドブックとプラグインハンドブックをアップデートしてました。
差分を比較するためのダミーPRを作成しましたので、よろしければプラグインハンドブックの方で、こんな風に変わるよ~というのをお手すきの際に見ていただければ助かります🙏
(コアハンドブックの方は自分でチェックしてみます)
from core-handbook.
@miminari
ありがとうございます!
コードマークダウンの言語については、パースしたpreタグに言語を表すクラス名が入っていたので、それを ``` の後に付与するようにしてみました。
https://github.com/t-hamano/wp-handbook-converter/blob/d23c4372be2c45e4c0af5085af7e1c9d39035fba/cli.js#L95-L101
では、一度 wp-handbook-converter の方にPR送ってみますね😊
from core-handbook.
@t-hamano mirucon/wp-handbook-converter#22
で私がやっつけで対応した部分なのですが、多分、仕様が変わっちゃってると思われます。
from core-handbook.
@t-hamano あ、やられます?じゃあお任せしようかな。
PR、上記の経緯があったので、横入りコメントしてしまいました🙏🏻あしからず
from core-handbook.
@t-hamano 上でリンクしてるPRの部分ですー!
cli.jsの92行目あたり
from core-handbook.
@t-hamano ありがとうございますー。そうだと思います、たぶん、例外処理がうまく出来てない気配。
不要な箇所のエスケープ処理
の話でしたね、すみません、勘違いしてました。
coreの方にはもしかしたら該当箇所がないかもしれない(ただのエスケープ処理で問題ない)のですが、
プラグインハンドブックのほうで以下のページのように、preタグ内での処理がちょっとおかしいんですよね。
https://github.com/jawordpressorg/plugin-handbook/blob/main/plugins/schema.md
あと今日翻訳した箇所のバックスラッシュも別に無くていいので外したいなーと思っていて。
from core-handbook.
@miminari
了解しました!
そのあたりを調査してPR送ってみますね。
from core-handbook.
対応メモ
wp-handbook-converterのマークダウン変換処理について、以下を修正したPRを送る
- glossaryが一部除去出来ていない。(おそらく、
strong
タグで囲まれた部分) -
pre
タグが除去され、コード例が正しく表示されない。pre
タグ → 「```」 に変換すべき? -
pre
タグのコード例の中で、記号(*_[]
)の前に不要なバッククオートが入る。
from core-handbook.
@t-hamano ありがとうございますー。
調査途中なのですが、たぶん、glossary以外の対応については、turndown側のaddRuleオプションをイジってあげると出来るような気もします。
from core-handbook.
ハンドブックをより適切にパースするために、wp-handbook-converter について以下の対応を行った
https://github.com/t-hamano/wp-handbook-converter/blob/update/improve-turndown/cli.js
- 一部glossaryが除去出来ていなかった点を改善
dt
タグをsrong
タグに変換(dtタグはマークダウンでは使えないため、strong
タグで代用する)- コードに該当する箇所を、「```」を使ってマークダウンに変換する
- コード内のエスケープ文字をアンエスケープ
- クラス名から言語を読み取り、マークダウンにもその言語を付与する(例:```php)
- 一部不正なpタグがどうしても除去出来なかったので、翻訳時に削除する必要があるかも?
- テーブルタグのサポート(
thead
が無いテーブルは、この問題によりHTMLのままマークダウンファイルにも反映されてしまう) - CLIの引数
team
を 必須から任意に変更(ここが必須だと、正しいエンドポイントを指定出来ないハンドブックが存在したため)
from core-handbook.
@t-hamano 対応ありがとうございますー!
良い感じかと!Turndown、クラス名でフィルタリング出来るんですね。お利口さんだー。
from core-handbook.
PR: mirucon/wp-handbook-converter#43
from core-handbook.
#56 にて対応完了
from core-handbook.
Related Issues (20)
- 翻訳: /best-practices/backporting-commits.md
- 翻訳: /about/release-cycle/block-editor-release-process-for-major-releases.md
- 翻訳: /about/release-cycle/preparing-the-about-page.md
- 翻訳: /about/getting-started-at-a-contributor-day.md
- 翻訳: /about/release-cycle/hosting-release-parties.md
- 翻訳: /tutorials/leading-bug-scrubs.md
- 翻訳: /tutorials/getting-started.md
- 翻訳: /about/release-cycle/wordpress-release-team-and-focus-leads.md
- 翻訳: /testing/automated-testing/phpunit.md
- 翻訳: /testing/automated-testing/writing-phpunit-tests.md
- 翻訳: /testing/bug-gardening.md
- 翻訳: /testing/reporting-security-vulnerabilities.md
- 翻訳: /best-practices/spelling.md
- 翻訳: /best-practices/core-apis.md
- 翻訳: /tutorials/navigating-the-community.md
- 翻訳: /tutorials/faq-for-new-contributors.md
- 翻訳: /glossary.md
- 翻訳: /best-practices/commit-messages.md
- コアハンドブック 公開タスクリスト HOT 3
- 原文の更新とハンドブックページへの反映
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core-handbook.