feat: ダンジョン「武装聖域 ワンダラーパレス (Hard)」完全攻略ページの追加と一覧リンク更新
This commit is contained in:
1 parent
69a86891f9
commit
204bd3b075
4 files changed
+297
-2
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
def normalize_file(filepath):
|
||||
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
||||
content = f.read()
|
||||
|
||||
lines = content.splitlines()
|
||||
cleaned_lines = []
|
||||
prev_blank = False
|
||||
for line in lines:
|
||||
stripped = line.rstrip()
|
||||
is_blank = (len(stripped) == 0)
|
||||
if is_blank and prev_blank:
|
||||
continue
|
||||
cleaned_lines.append(stripped)
|
||||
prev_blank = is_blank
|
||||
|
||||
normalized_text = '\r\n'.join(cleaned_lines)
|
||||
if not normalized_text.endswith('\r\n'):
|
||||
normalized_text += '\r\n'
|
||||
|
||||
with open(filepath, 'wb') as f:
|
||||
f.write(b'\xef\xbb\xbf')
|
||||
f.write(normalized_text.encode('utf-8'))
|
||||
print(f"Normalized: {filepath}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
for path in sys.argv[1:]:
|
||||
if os.path.exists(path):
|
||||
normalize_file(path)
|
||||
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
|
||||
with open('dungeons/index.html', 'r', encoding='utf-8') as f:
|
||||
text = f.read()
|
||||
|
||||
target = ''' <tr>
|
||||
<td><strong>ワンダラーパレス (Hard)</strong></td>
|
||||
<td>Lv50 (IL90〜)</td>
|
||||
<td>非対応</td>
|
||||
<td>マムージャ族占領。死の宣告呪具解除、光鱗のモラージャラジャ。</td>
|
||||
<td>準備中</td>
|
||||
</tr>'''
|
||||
|
||||
replacement = ''' <tr>
|
||||
<td><strong>ワンダラーパレス (Hard)</strong></td>
|
||||
<td>Lv50 (IL90〜)</td>
|
||||
<td>非対応</td>
|
||||
<td>マムージャ族占領。死の宣告呪具解除、光鱗のモラージャラジャ。</td>
|
||||
<td><a href="wanderers_palace_hard.html">攻略を見る ➜</a></td>
|
||||
</tr>'''
|
||||
|
||||
if target in text:
|
||||
text = text.replace(target, replacement)
|
||||
with open('dungeons/index.html', 'w', encoding='utf-8') as f:
|
||||
f.write(text)
|
||||
print("Updated wanderers_palace_hard in dungeons/index.html")
|
||||
else:
|
||||
print("Target not found!")
|
||||
sys.exit(1)
|
||||
Reference in new issue
Block a user