fix: ダンジョン・レイド・討滅戦全209ページのヘッダー・サイドバー構造を大元テンプレート(Seesaaニュートラルグレーiframe共通化)に完全統一
This commit is contained in:
1 parent
a653dcb5a6
commit
6d752556d7
217 files changed
+5958
-2770
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
categories = {}
|
||||
|
||||
for root, dirs, files in os.walk('.'):
|
||||
if '.git' in root or 'node_modules' in root:
|
||||
continue
|
||||
for f in files:
|
||||
if f.endswith('.html'):
|
||||
path = os.path.join(root, f).replace('\\', '/')
|
||||
if path in ['./common/header.html', './common/sidebar.html']:
|
||||
continue
|
||||
with open(path, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
content = fp.read()
|
||||
|
||||
has_iframe = 'wiki-header-frame' in content or 'wiki-sidebar-frame' in content
|
||||
has_container = 'wiki-header-container' in content or 'wiki-sidebar-container' in content
|
||||
|
||||
dir_name = os.path.dirname(path)
|
||||
if dir_name not in categories:
|
||||
categories[dir_name] = {'iframe': 0, 'container': 0, 'other': 0, 'total': 0, 'container_files': [], 'other_files': []}
|
||||
|
||||
categories[dir_name]['total'] += 1
|
||||
if has_iframe:
|
||||
categories[dir_name]['iframe'] += 1
|
||||
elif has_container:
|
||||
categories[dir_name]['container'] += 1
|
||||
categories[dir_name]['container_files'].append(os.path.basename(path))
|
||||
else:
|
||||
categories[dir_name]['other'] += 1
|
||||
categories[dir_name]['other_files'].append(os.path.basename(path))
|
||||
|
||||
print(f"{'Directory':<30} | {'Total':<5} | {'iframe':<6} | {'container':<9} | {'other':<5}")
|
||||
print('-'*65)
|
||||
for d, counts in sorted(categories.items()):
|
||||
print(f"{d:<30} | {counts['total']:<5} | {counts['iframe']:<6} | {counts['container']:<9} | {counts['other']:<5}")
|
||||
@@ -0,0 +1,43 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
with open('tools/test_extract.py', 'r', encoding='utf-8') as fp:
|
||||
code = fp.read()
|
||||
|
||||
# extract_content 関数定義部分をそのまま利用
|
||||
exec(code[:code.find("test_files = [")])
|
||||
|
||||
unknown_files = []
|
||||
success_count = 0
|
||||
|
||||
with open('tools/list_non_conforming_pages.py', 'r', encoding='utf-8') as fp:
|
||||
lines = fp.readlines()
|
||||
|
||||
for root, dirs, files in os.walk('.'):
|
||||
if '.git' in root or 'node_modules' in root:
|
||||
continue
|
||||
for f in files:
|
||||
if f.endswith('.html'):
|
||||
path = os.path.join(root, f).replace('\\', '/')
|
||||
if path in ['./common/header.html', './common/sidebar.html', './common/templates/dungeon_raid_template.html']:
|
||||
continue
|
||||
with open(path, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
content = fp.read()
|
||||
has_iframe_header = 'wiki-header-frame' in content
|
||||
has_iframe_sidebar = 'wiki-sidebar-frame' in content
|
||||
if not (has_iframe_header and has_iframe_sidebar):
|
||||
t, d, c, pattern = extract_content(content)
|
||||
if pattern == "UNKNOWN" or not c:
|
||||
unknown_files.append(path)
|
||||
else:
|
||||
success_count += 1
|
||||
|
||||
print(f"抽出成功ファイル数: {success_count} / {success_count + len(unknown_files)}")
|
||||
print(f"抽出失敗ファイル数: {len(unknown_files)}")
|
||||
if unknown_files:
|
||||
print("失敗ファイル一覧:")
|
||||
for uf in unknown_files:
|
||||
print(uf)
|
||||
@@ -0,0 +1,41 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
iframe_pages = []
|
||||
container_pages = []
|
||||
other_pages = []
|
||||
|
||||
for root, dirs, files in os.walk('.'):
|
||||
if '.git' in root or 'node_modules' in root:
|
||||
continue
|
||||
for f in files:
|
||||
if f.endswith('.html'):
|
||||
path = os.path.join(root, f).replace('\\', '/')
|
||||
# 除外:common/header.html, common/sidebar.html など共通パーツ自身
|
||||
if path in ['./common/header.html', './common/sidebar.html']:
|
||||
continue
|
||||
with open(path, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
content = fp.read()
|
||||
has_iframe = 'wiki-header-frame' in content or 'wiki-sidebar-frame' in content
|
||||
has_container = 'wiki-header-container' in content or 'wiki-sidebar-container' in content
|
||||
|
||||
if has_iframe:
|
||||
iframe_pages.append(path)
|
||||
elif has_container:
|
||||
container_pages.append(path)
|
||||
else:
|
||||
other_pages.append(path)
|
||||
|
||||
print(f"iframe形式のページ数: {len(iframe_pages)}")
|
||||
print(f"container形式のページ数: {len(container_pages)}")
|
||||
print(f"その他のページ数: {len(other_pages)}")
|
||||
|
||||
print("\n--- container形式のサンプル (最大20件) ---")
|
||||
for p in container_pages[:20]:
|
||||
print(p)
|
||||
|
||||
print("\n--- その他のサンプル (全件) ---")
|
||||
for p in other_pages:
|
||||
print(p)
|
||||
@@ -0,0 +1,163 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
def extract_content(html):
|
||||
# 1. titleの抽出
|
||||
title_match = re.search(r'<title>(.*?)</title>', html, re.DOTALL | re.IGNORECASE)
|
||||
title = title_match.group(1).strip() if title_match else "FF14 攻略Wiki"
|
||||
|
||||
# 2. meta descriptionの抽出
|
||||
desc_match = re.search(r'<meta\s+name=["\']description["\']\s+content=["\'](.*?)["\']', html, re.DOTALL | re.IGNORECASE)
|
||||
if not desc_match:
|
||||
desc_match = re.search(r'<meta\s+content=["\'](.*?)["\']\s+name=["\']description["\']', html, re.DOTALL | re.IGNORECASE)
|
||||
meta_desc = f' <meta name="description" content="{desc_match.group(1).strip()}">\n' if desc_match else ""
|
||||
|
||||
# 3. メインコンテンツの抽出
|
||||
# パターンA: <main id="wiki-main"> ... </main>
|
||||
main_match = re.search(r'<main\s+id=["\']wiki-main["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "main#wiki-main"
|
||||
|
||||
# パターンB: <main class=["\']wiki-main["\']>(.*?)</main>
|
||||
main_match = re.search(r'<main\s+class=["\']wiki-main["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "main.wiki-main"
|
||||
|
||||
# パターンC: <main id=["\']wiki-main-container["\']>(.*?)</main>
|
||||
main_match = re.search(r'<main\s+id=["\']wiki-main-container["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "main#wiki-main-container"
|
||||
|
||||
# パターンD: <main id=["\']wiki-content["\']>(.*?)</main>
|
||||
main_match = re.search(r'<main\s+id=["\']wiki-content["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
content = main_match.group(1).strip()
|
||||
content = re.sub(r'<div\s+id=["\']wiki-breadcrumb["\']>\s*</div>', '', content)
|
||||
return title, meta_desc, content.strip(), "main#wiki-content"
|
||||
|
||||
# パターンE: <div class=["\']wiki-content["\']>(.*?)</div>\s*</main>
|
||||
main_match = re.search(r'<div\s+class=["\']wiki-content["\']>(.*?)</div>\s*</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "div.wiki-content"
|
||||
|
||||
return title, meta_desc, None, "UNKNOWN"
|
||||
|
||||
def build_html(filepath, html):
|
||||
title, meta_desc, content, pattern = extract_content(html)
|
||||
if not content:
|
||||
raise ValueError(f"Failed to extract content from {filepath}")
|
||||
|
||||
# パンくずリストの整備
|
||||
has_breadcrumbs = ('wiki-breadcrumbs' in content) or ('wiki-breadcrumb' in content)
|
||||
is_index = os.path.basename(filepath) == 'index.html'
|
||||
|
||||
if not has_breadcrumbs and not is_index:
|
||||
genre = "ダンジョン攻略" if "dungeons" in filepath else ("レイド攻略" if "raids" in filepath else "討滅戦攻略")
|
||||
clean_title = re.sub(r'【.*?】', '', title).replace('完全攻略', '').replace('攻略', '').strip()
|
||||
breadcrumb = f' <div class="wiki-breadcrumbs">\n <a href="../index.html">トップ</a> > <a href="index.html">{genre}</a> > <strong>{clean_title}</strong>\n </div>\n\n'
|
||||
content = breadcrumb + content
|
||||
else:
|
||||
# id="wiki-breadcrumb" を class="wiki-breadcrumbs" に統一
|
||||
content = re.sub(r'<div\s+id=["\']wiki-breadcrumb["\']>', '<div class="wiki-breadcrumbs">', content)
|
||||
# 空のパンくずの場合は置換
|
||||
if re.search(r'<div\s+class=["\']wiki-breadcrumbs["\']>\s*</div>', content):
|
||||
genre = "ダンジョン攻略" if "dungeons" in filepath else ("レイド攻略" if "raids" in filepath else "討滅戦攻略")
|
||||
clean_title = re.sub(r'【.*?】', '', title).replace('完全攻略', '').replace('攻略', '').strip()
|
||||
new_bc = f'<div class="wiki-breadcrumbs">\n <a href="../index.html">トップ</a> > <a href="index.html">{genre}</a> > <strong>{clean_title}</strong>\n </div>'
|
||||
content = re.sub(r'<div\s+class=["\']wiki-breadcrumbs["\']>\s*</div>', new_bc, content)
|
||||
|
||||
template = f'''<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title>{title}</title>
|
||||
{meta_desc} <link rel="stylesheet" href="../common/css/seesaa_neutral_gray.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="wiki-wrapper">
|
||||
|
||||
<!-- 共通ヘッダー&グローバルナビ(iframe共通化) -->
|
||||
<iframe src="../common/header.html" class="wiki-header-frame" frameborder="0" scrolling="no"></iframe>
|
||||
|
||||
<!-- 2カラムコンテンツ -->
|
||||
<div id="wiki-container">
|
||||
|
||||
<!-- 共通左サイドバー(iframe共通化) -->
|
||||
<div id="wiki-sidebar">
|
||||
<iframe src="../common/sidebar.html" class="wiki-sidebar-frame" frameborder="0"></iframe>
|
||||
</div>
|
||||
|
||||
<main id="wiki-main">
|
||||
{content}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- フッター -->
|
||||
<footer id="wiki-footer">
|
||||
<p>© SQUARE ENIX CO., LTD. All Rights Reserved. | FINAL FANTASY XIV</p>
|
||||
<p>FF14 攻略Wiki (Seesaa Wiki ニュートラルグレー テンプレート完全準拠)</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../common/js/wiki_common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
'''
|
||||
return template
|
||||
|
||||
def normalize_text(text):
|
||||
lines = text.splitlines()
|
||||
cleaned = []
|
||||
prev_blank = False
|
||||
for line in lines:
|
||||
stripped = line.rstrip()
|
||||
is_blank = (len(stripped) == 0)
|
||||
if is_blank and prev_blank:
|
||||
continue
|
||||
cleaned.append(stripped)
|
||||
prev_blank = is_blank
|
||||
res = '\r\n'.join(cleaned)
|
||||
if not res.endswith('\r\n'):
|
||||
res += '\r\n'
|
||||
return res
|
||||
|
||||
def process_file(filepath):
|
||||
with open(filepath, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
html = fp.read()
|
||||
|
||||
new_html = build_html(filepath, html)
|
||||
normalized = normalize_text(new_html)
|
||||
|
||||
with open(filepath, 'wb') as fp:
|
||||
fp.write(b'\xef\xbb\xbf')
|
||||
fp.write(normalized.encode('utf-8'))
|
||||
|
||||
def main():
|
||||
target_dirs = ['dungeons', 'raids', 'trials']
|
||||
processed_files = []
|
||||
|
||||
for d in target_dirs:
|
||||
for f in os.listdir(d):
|
||||
if f.endswith('.html'):
|
||||
path = os.path.join(d, f).replace('\\', '/')
|
||||
with open(path, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
content = fp.read()
|
||||
has_iframe_header = 'wiki-header-frame' in content
|
||||
has_iframe_sidebar = 'wiki-sidebar-frame' in content
|
||||
if not (has_iframe_header and has_iframe_sidebar):
|
||||
process_file(path)
|
||||
processed_files.append(path)
|
||||
|
||||
print(f"変換完了ファイル総数: {len(processed_files)}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
non_conforming = []
|
||||
|
||||
for root, dirs, files in os.walk('.'):
|
||||
if '.git' in root or 'node_modules' in root:
|
||||
continue
|
||||
for f in files:
|
||||
if f.endswith('.html'):
|
||||
path = os.path.join(root, f).replace('\\', '/')
|
||||
if path in ['./common/header.html', './common/sidebar.html', './common/templates/dungeon_raid_template.html']:
|
||||
continue
|
||||
with open(path, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
content = fp.read()
|
||||
|
||||
# 正しいiframe形式か判定: wiki-header-frame と wiki-sidebar-frame が両方あるか
|
||||
has_iframe_header = 'wiki-header-frame' in content
|
||||
has_iframe_sidebar = 'wiki-sidebar-frame' in content
|
||||
|
||||
if not (has_iframe_header and has_iframe_sidebar):
|
||||
non_conforming.append(path)
|
||||
|
||||
print(f"非準拠ファイル総数: {len(non_conforming)}")
|
||||
for p in non_conforming:
|
||||
print(p)
|
||||
@@ -0,0 +1,87 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
with open('tools/test_extract.py', 'r', encoding='utf-8') as fp:
|
||||
code = fp.read()
|
||||
exec(code[:code.find("test_files = [")])
|
||||
|
||||
def build_html(filepath, html):
|
||||
title, meta_desc, content, pattern = extract_content(html)
|
||||
|
||||
# パンくずの確認と補完
|
||||
has_breadcrumbs = 'wiki-breadcrumbs' in content or 'wiki-breadcrumb' in content
|
||||
if not has_breadcrumbs:
|
||||
genre = "ダンジョン攻略" if "dungeons" in filepath else ("レイド攻略" if "raids" in filepath else "討滅戦攻略")
|
||||
clean_title = re.sub(r'【.*?】', '', title).replace('完全攻略', '').replace('攻略', '').strip()
|
||||
breadcrumb = f' <div class="wiki-breadcrumbs">\n <a href="../index.html">トップ</a> > <a href="index.html">{genre}</a> > <strong>{clean_title}</strong>\n </div>\n\n'
|
||||
content = breadcrumb + content
|
||||
else:
|
||||
# id="wiki-breadcrumb" を class="wiki-breadcrumbs" に統一
|
||||
content = re.sub(r'<div\s+id=["\']wiki-breadcrumb["\']>', '<div class="wiki-breadcrumbs">', content)
|
||||
# 空のパンくずの場合は置換
|
||||
if '<div class="wiki-breadcrumbs"></div>' in content or '<div class="wiki-breadcrumbs">\s*</div>' in content:
|
||||
genre = "ダンジョン攻略" if "dungeons" in filepath else ("レイド攻略" if "raids" in filepath else "討滅戦攻略")
|
||||
clean_title = re.sub(r'【.*?】', '', title).replace('完全攻略', '').replace('攻略', '').strip()
|
||||
new_bc = f'<div class="wiki-breadcrumbs">\n <a href="../index.html">トップ</a> > <a href="index.html">{genre}</a> > <strong>{clean_title}</strong>\n </div>'
|
||||
content = re.sub(r'<div class="wiki-breadcrumbs">\s*</div>', new_bc, content)
|
||||
|
||||
template = f'''<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title>{title}</title>
|
||||
{meta_desc} <link rel="stylesheet" href="../common/css/seesaa_neutral_gray.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="wiki-wrapper">
|
||||
|
||||
<!-- 共通ヘッダー&グローバルナビ(iframe共通化) -->
|
||||
<iframe src="../common/header.html" class="wiki-header-frame" frameborder="0" scrolling="no"></iframe>
|
||||
|
||||
<!-- 2カラムコンテンツ -->
|
||||
<div id="wiki-container">
|
||||
|
||||
<!-- 共通左サイドバー(iframe共通化) -->
|
||||
<div id="wiki-sidebar">
|
||||
<iframe src="../common/sidebar.html" class="wiki-sidebar-frame" frameborder="0"></iframe>
|
||||
</div>
|
||||
|
||||
<main id="wiki-main">
|
||||
{content}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- フッター -->
|
||||
<footer id="wiki-footer">
|
||||
<p>© SQUARE ENIX CO., LTD. All Rights Reserved. | FINAL FANTASY XIV</p>
|
||||
<p>FF14 攻略Wiki (Seesaa Wiki ニュートラルグレー テンプレート完全準拠)</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../common/js/wiki_common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
'''
|
||||
return template
|
||||
|
||||
for p in ['trials/ultima_weapon.html', 'trials/extreme_hades.html']:
|
||||
with open(p, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
html = fp.read()
|
||||
res = build_html(p, html)
|
||||
lines = res.splitlines()
|
||||
print(f"=== {p} PREVIEW (最初の35行) ===")
|
||||
for l in lines[:35]:
|
||||
print(l)
|
||||
print(f"=== {p} PREVIEW (最後の20行) ===")
|
||||
for l in lines[-20:]:
|
||||
print(l)
|
||||
print("\n" + "="*50 + "\n")
|
||||
@@ -0,0 +1,64 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
def extract_content(html):
|
||||
# 1. titleの抽出
|
||||
title_match = re.search(r'<title>(.*?)</title>', html, re.DOTALL | re.IGNORECASE)
|
||||
title = title_match.group(1).strip() if title_match else "FF14 攻略Wiki"
|
||||
|
||||
# 2. meta descriptionの抽出
|
||||
desc_match = re.search(r'<meta\s+name=["\']description["\']\s+content=["\'](.*?)["\']', html, re.DOTALL | re.IGNORECASE)
|
||||
if not desc_match:
|
||||
desc_match = re.search(r'<meta\s+content=["\'](.*?)["\']\s+name=["\']description["\']', html, re.DOTALL | re.IGNORECASE)
|
||||
meta_desc = f' <meta name="description" content="{desc_match.group(1).strip()}">\n' if desc_match else ""
|
||||
|
||||
# 3. メインコンテンツの抽出
|
||||
# パターンA: <main id="wiki-main"> ... </main>
|
||||
main_match = re.search(r'<main\s+id=["\']wiki-main["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "main#wiki-main"
|
||||
|
||||
# パターンB: <main class=["\']wiki-main["\']>(.*?)</main>
|
||||
main_match = re.search(r'<main\s+class=["\']wiki-main["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "main.wiki-main"
|
||||
|
||||
# パターンC: <main id=["\']wiki-main-container["\']>(.*?)</main>
|
||||
main_match = re.search(r'<main\s+id=["\']wiki-main-container["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "main#wiki-main-container"
|
||||
|
||||
# パターンD: <main id=["\']wiki-content["\']>(.*?)</main>
|
||||
main_match = re.search(r'<main\s+id=["\']wiki-content["\']>(.*?)</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
content = main_match.group(1).strip()
|
||||
# 空のパンくず除外
|
||||
content = re.sub(r'<div id=["\']wiki-breadcrumb["\']>\s*</div>', '', content)
|
||||
return title, meta_desc, content.strip(), "main#wiki-content"
|
||||
|
||||
# パターンE: <div class=["\']wiki-content["\']>(.*?)</div>\s*</main>
|
||||
main_match = re.search(r'<div\s+class=["\']wiki-content["\']>(.*?)</div>\s*</main>', html, re.DOTALL | re.IGNORECASE)
|
||||
if main_match:
|
||||
return title, meta_desc, main_match.group(1).strip(), "div.wiki-content"
|
||||
|
||||
return title, meta_desc, None, "UNKNOWN"
|
||||
|
||||
test_files = [
|
||||
'trials/ultima_weapon.html',
|
||||
'trials/extreme_hades.html',
|
||||
'trials/garuda.html',
|
||||
'dungeons/amdapor_keep_hard.html',
|
||||
'dungeons/aurum_vale.html',
|
||||
'dungeons/index.html',
|
||||
'raids/syrcus_tower.html',
|
||||
'raids/index.html'
|
||||
]
|
||||
|
||||
for p in test_files:
|
||||
with open(p, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
html = fp.read()
|
||||
t, d, c, pattern = extract_content(html)
|
||||
print(f"File: {p:<35} | Pattern: {pattern:<25} | Title: {t[:30]} | Content Length: {len(c) if c else 0}")
|
||||
@@ -0,0 +1,20 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
with open('tools/test_convert_preview.py', 'r', encoding='utf-8') as fp:
|
||||
code = fp.read()
|
||||
target = "for p in ['trials/ultima_weapon.html'"
|
||||
exec(code[:code.find(target)])
|
||||
|
||||
with open('dungeons/index.html', 'r', encoding='utf-8') as fp:
|
||||
html = fp.read()
|
||||
res = build_html('dungeons/index.html', html)
|
||||
lines = res.splitlines()
|
||||
print('=== dungeons/index.html PREVIEW (最初の40行) ===')
|
||||
for l in lines[:40]:
|
||||
print(l)
|
||||
print('=== dungeons/index.html PREVIEW (最後の20行) ===')
|
||||
for l in lines[-20:]:
|
||||
print(l)
|
||||
Reference in new issue
Block a user