sakura-editor / sakura-editor.github.io

SAKURA Editor portal site
https://sakura-editor.github.io
11 stars 12 forks source link

sakura リポジトリの HTML のヘルプ (help\sakura\_RESOURCE) を help に取り込む #47

Closed m-tmatma closed 4 years ago

m-tmatma commented 5 years ago

sakura リポジトリの HTML のヘルプ (help\sakura\res) を help に取り込む

sakura リポジトリの HTML のヘルプと web サイトのヘルプに相違があるので 最新版を取り込む。

ただし、sakura editor の 2.4.0.0 のリリースのタイミングまでmaster には入れないほうがよさそう。

例えば develop 用のブランチを作ってそこに PR をマージして 2.4.0.0 が リリースされたらmaster にマージするなどの運用が考えられる。

現状以下の違いがある。

このリポジトリのデータ

1.

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  1. HTML の文字コードが UTF-8
  2. index.html が存在する
  3. help/dsk_sakura.css の文字コードが UTF-8

sakura リポジトリ

1.

<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
  1. HTML の文字コードが Shift-JIS
  2. index.html が存在しない
  3. help/dsk_sakura.css の文字コードが Shift-JIS
berryzplus commented 5 years ago

すぐPRする話ではないんですね :smile:

repository version charset index memo
github.io/help ver 2.3.2.0 UTF-8 ある
sakura/help/sakura ver 2.4.0 (開発版) Shift_JIS ない 追加ファイルあり

ぼくはドキュメントの内容は、本体の正常化が済んでからでもいいと思ってました。 差分眺めてみたんですけど、結構しょーもない誤変換してますね。 ver1系の内部コードがUTF-8になってて「げっ!」と思いました。 (Shift_JISを一括置換したあと、雑なチェックで公開したんですね…。)

差分を見て見たら「サクッと通る」とは限らん気がしてきました。 こればっかりは、ブランチ切って先行でレビューするのがよいかもです。

ところで、helpのソースはUTF-8化しなくていいんでしたっけ? HTML Help Workshopが対応してない? ・・・そんなまさか!?

m-tmatma commented 5 years ago

HTML Help Workshopが対応してない? ・・・そんなまさか!?

そのページは過去に見てたので無理だと思ってましたが、 本文に関してはいけるのかもしれない。

m-tmatma commented 5 years ago

カレントディレクトリ以下の html の文字コード変換のスクリプトを作成

convert.zip

import codecs
import glob
import os
import re

def convert(input):
    output = input + ".tmp"
    lineno = 0
    with codecs.open(input, "r", "cp932") as fin:
        with codecs.open(output, "w", "utf-8") as fout:
            for line in fin:
                match = re.search(r'META', line)
                if match:
                    line = re.sub('charset=Shift_JIS', 'charset=UTF-8', line)
                fout.write(line)
                lineno = lineno + 1

    os.unlink(input)
    os.rename(output, input)

def process_files(topdir):
    pattern = os.path.join(topdir, "*.html")
    files = glob.glob(pattern)

    for file in files:
        print (file)
        convert(file)

process_files(".")
m-tmatma commented 5 years ago

そのページは過去に見てたので無理だと思ってましたが、 本文に関してはいけるのかもしれない。

https://github.com/sakura-editor/sakura/pull/807 で sakura 本体リポジトリの HTML HELP を UTF-8 に変換する PR を投げました。

berryzplus commented 5 years ago

本文に関してはいけるのかも

了解です。イケるはずのものとして、ローカルビルド確認と差分内容のレビューをしてみようと思います。

HTML Help workshop がaccess violationで落ちてるのは謎ですね。

appveyorのOS言語を日本語に変えてないのが影響してる?通る時と通らない時の違いは何だろう…

m-tmatma commented 5 years ago

sakura-editor/sakura#807 で sakura 本体リポジトリの HTML HELP を UTF-8 に変換する PR を投げました。

https://github.com/sakura-editor/sakura/pull/921 によって状況は改善する見込み。 https://github.com/sakura-editor/sakura/pull/921 マージ後に新しい PR で対応予定。

m-tmatma commented 5 years ago

https://github.com/sakura-editor/sakura/pull/937 のマージによって 準備が整った。

m-tmatma commented 5 years ago

https://github.com/sakura-editor/sakura/pull/939 を追加

m-tmatma commented 5 years ago

https://github.com/sakura-editor/sakura/pull/940https://github.com/sakura-editor/sakura/pull/937https://github.com/sakura-editor/sakura/pull/939 を revert

m-tmatma commented 4 years ago

https://github.com/sakura-editor/sakura/pull/940 を revert 後に対処予定

m-tmatma commented 4 years ago

https://github.com/sakura-editor/sakura/pull/1117 (← beta3 ブランチに対する PR) 取り込み後に develop ブランチに取り込み予定

m-tmatma commented 4 years ago

sakura-editor/sakura#1117 (← beta3 ブランチに対する PR) 取り込み後に develop ブランチに取り込み予定

Beta 3 を取り込み (https://github.com/sakura-editor/sakura-editor.github.io/pull/57)

m-tmatma commented 4 years ago

https://github.com/sakura-editor/sakura-editor.github.io/pull/62 で master に適用済み