无穷级数点7:重写完成并按知识点拆成三册(08 / 08b / 08c)
原有 7.1—7.3 只有骨架(公式 + 一句结论),看不懂;这一轮按 「从哪来 → 公式 → 走一遍 → 怎么不写错」逐节展开,单文件达 2.7 万字符, 超 1.3 万上限一倍,故按三个知识点拆册(知识点编号与题号不变): - 08-点7-傅里叶级数.md(10184):7.1 系数公式,6 个小节 (泰勒对照 → 三角函数系正交性 → 系数即投影 → x^2 走一遍 → 区间换算两齿轮 → 分部积分流水线与六个失分点),题 1 - 08b-点7-狄利克雷定理与和函数.md(8311):7.2,6 个小节 (f/~f/S 三对象 → 左右极限平均 → 狄利克雷条件 → 方波六点 → 取点三步法 → 只有三类点要查),题 2、题 3 - 08c-点7-正弦与余弦级数.md(10567):7.3,7 个小节 (为何非延拓 → 两套系数与因子 2 → 选延拓 → 偶部/奇部与情形 A/B/C → 端点行为 → 凑数项级数四步 → 四条失分点),题 4、题 5 gen_crosslinks.py:点文件匹配改为 `NN[x]-点`,题号标签从文件名取点号 (原先按排序推点号,插入 08b/08c 后 09-点8 会被标成"点 10")。 同步:讲 README 文件清单拆三行 + 版本记录;总览 26→27 个知识点、 注明点 7 分三册;两处模拟卷考点手册的 §7.2 链接改指 08b。 校验:check_md_links 245 条 0 异常(两处模拟卷各 102 条 0 异常); fix_gitea_math 修 52 处收尾缺空格后归零;19 处「加粗以公式收尾」改句式 (脚本补空格反而让星号外露)、3 个含公式的标题改为纯文字。
This commit is contained in:
@@ -87,8 +87,9 @@ def scan_quick(kp_path):
|
||||
|
||||
def build(d, check_only=False):
|
||||
# 点文件:`NN-点K-*.md`(兼容 02..09 老讲次与 10 以上的新讲次)
|
||||
# 也兼容 `08b-点7-*.md` 这类"同一知识点拆多册"的命名(超 1.3 万字符时的拆法)
|
||||
point_files = sorted(fn for fn in os.listdir(d)
|
||||
if re.match(r'^\d{2}-点', fn) and fn.endswith('.md'))
|
||||
if re.match(r'^\d{2}[a-z]?-点', fn) and fn.endswith('.md'))
|
||||
inv = os.path.join(d, '01-知识点盘点.md')
|
||||
if not os.path.exists(inv):
|
||||
cand = [fn for fn in sorted(os.listdir(d))
|
||||
@@ -108,9 +109,12 @@ def build(d, check_only=False):
|
||||
index = {} # (file, no) -> item
|
||||
by_kp = {} # kp -> [item] 按 (文件名, 题号) 排序
|
||||
for order, fn in enumerate(point_files):
|
||||
m = re.match(r'^\d{2}[a-z]?-点(\d+)', fn)
|
||||
pno = int(m.group(1)) if m else order + 1
|
||||
for it in scan_point_file(os.path.join(d, fn)):
|
||||
it['file'] = fn
|
||||
it['order'] = order
|
||||
it['point'] = pno
|
||||
it['anchor'] = anchor(it['heading'])
|
||||
index[(fn, it['no'])] = it
|
||||
by_kp.setdefault(it['kp'], []).append(it)
|
||||
@@ -164,7 +168,7 @@ def build(d, check_only=False):
|
||||
if not items:
|
||||
return '—'
|
||||
return '、'.join('[点 %d 题 %d](%s#user-content-%s)' % (
|
||||
it2['order'] + 1, it2['no'], it2['file'], it2['anchor'])
|
||||
it2['point'], it2['no'], it2['file'], it2['anchor'])
|
||||
for it2 in items)
|
||||
|
||||
if kp in kp_quick:
|
||||
@@ -207,7 +211,7 @@ def build(d, check_only=False):
|
||||
items = by_kp.get(kp, [])
|
||||
if items:
|
||||
cell = '、'.join('[点 %d 题 %d](%s#user-content-%s)' % (
|
||||
it['order'] + 1, it['no'], it['file'], it['anchor']) for it in items)
|
||||
it['point'], it['no'], it['file'], it['anchor']) for it in items)
|
||||
else:
|
||||
cell = '(本讲未单独配题)'
|
||||
rows.append('| §%s %s | %s |' % (kp, kp_names[kp], cell))
|
||||
@@ -243,7 +247,7 @@ def build(d, check_only=False):
|
||||
items.sort(key=lambda x: (x['order'], x['no']))
|
||||
if items:
|
||||
cell = '、'.join('[点 %d 题 %d](%s#user-content-%s)' % (
|
||||
it['order'] + 1, it['no'], it['file'], it['anchor'])
|
||||
it['point'], it['no'], it['file'], it['anchor'])
|
||||
for it in items)
|
||||
rows.append('| %s | %s |' % (cur, cell))
|
||||
tbl = '\n'.join(rows)
|
||||
|
||||
Reference in New Issue
Block a user