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}")
|
||||
Reference in new issue
Block a user