Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/handsomestWei/patent-disclosure-skill
/ functions
Functions
100 in github.com/handsomestWei/patent-disclosure-skill
⨍
Functions
100
◇
Types & classes
8
↓ 14 callers
Function
_set_run_font
(run, name: str = "宋体", size_pt: float | None = None, bold: bool | None = None)
tools/md_to_docx.py:404
↓ 13 callers
Function
flush_paragraph
()
tools/md_to_docx.py:722
↓ 6 callers
Function
_add_inline_to_paragraph
解析 **粗体**、`行内代码` 与普通文本,写入同一段落。
tools/md_to_docx.py:413
↓ 5 callers
Function
_embed_from_image_ref
按公式 / 框图 / 普通图规则嵌入 PNG(仅公式用小尺寸)。
tools/md_to_docx.py:185
↓ 5 callers
Function
_next_eq_name
(counter: dict[str, int], kind: str)
tools/math_render.py:105
↓ 5 callers
Function
_try_render
( latex: str, png_path: Path, *, dpi: int, fontsize: float, )
tools/math_render.py:113
↓ 5 callers
Function
render_markdown_math
返回 (新 markdown, 成功渲染数, 失败保留原文数)。 PNG 目录:``out_md_path.parent / assets_rel``。
tools/math_render.py:166
↓ 4 callers
Function
_add_rich_content_to_paragraph
同一段内混排文字(**粗体**/`代码`)与公式/插图(含 HTML 注释隐藏引用)。
tools/md_to_docx.py:332
↓ 4 callers
Function
_parse_table_row
(line: str)
tools/md_to_docx.py:598
↓ 4 callers
Function
_print_manual_docx_hint
(out_md: Path, docx_out: Path, base_dir: Path, md_script: Path)
tools/mermaid_render.py:265
↓ 4 callers
Function
_resolve_image_path
(src: str, base_dir: Path | None)
tools/md_to_docx.py:637
↓ 4 callers
Function
_span_overlaps
(spans: list[tuple[int, int]], start: int, end: int)
tools/md_to_docx.py:181
↓ 3 callers
Function
_formula_image_kind
返回 ``block`` / ``inline`` 表示公式图,否则 None(含注释内引用)。
tools/md_to_docx.py:159
↓ 3 callers
Function
hits_to_jsonable
供 JSON 序列化(不含 raw_html 过大字段时可裁剪)。
tools/cnipa_epub_parse.py:243
↓ 3 callers
Function
parse_search_result_html
解析「公布公告」检索结果列表页 HTML。 兼容常见表格行 / 带链接的条目(站点改版时需调整正则或选择器)。
tools/cnipa_epub_parse.py:60
↓ 3 callers
Function
wait_for_epub_home_ready
(page: Page, *, max_wait_sec: float | None = None)
tools/cnipa_epub_crawler.py:85
↓ 2 callers
Function
_abs_url
(href: str)
tools/cnipa_epub_parse.py:52
↓ 2 callers
Function
_add_code_block
(doc: Document, lines: list[str])
tools/md_to_docx.py:477
↓ 2 callers
Function
_add_list_item
( doc: Document, text: str, ordered: bool, base_dir: Path | None, *, image_max_h_in: f
tools/md_to_docx.py:488
↓ 2 callers
Function
_add_math_fallback_block
未渲染成功的 ``$$ ... $$`` 以等宽原文写入 Word。
tools/md_to_docx.py:269
↓ 2 callers
Function
_embed_picture_inline
( paragraph, path: Path, *, max_h_in: float, max_w_in: float | None = None, )
tools/md_to_docx.py:307
↓ 2 callers
Function
_image_pixel_size
读取常见位图宽高(像素),失败返回 None。不依赖 Pillow。
tools/md_to_docx.py:90
↓ 2 callers
Function
_is_table_row
(line: str)
tools/md_to_docx.py:522
↓ 2 callers
Function
_launch_browser
(p: Playwright)
tools/cnipa_epub_crawler.py:190
↓ 2 callers
Function
_line_has_embeddable_images
(line: str)
tools/md_to_docx.py:667
↓ 2 callers
Function
_new_context
(browser: Browser)
tools/cnipa_epub_crawler.py:200
↓ 2 callers
Function
_safe_page_content
(page: Page, *, max_attempts: int = 10)
tools/cnipa_epub_crawler.py:112
↓ 2 callers
Function
render_one
(inner: str, wrapper: str)
tools/math_render.py:142
↓ 2 callers
Function
search_epub_keyword
( keyword: str, *, playwright_factory: Callable[[], Playwright] | None = None, )
tools/cnipa_epub_crawler.py:171
↓ 2 callers
Function
submit_index_search
(page: Page, keyword: str)
tools/cnipa_epub_crawler.py:132
↓ 1 callers
Function
_add_body_paragraph
( doc: Document, text: str, base_dir: Path | None = None, *, image_max_h_in: float = _DEFA
tools/md_to_docx.py:447
↓ 1 callers
Function
_add_heading
level 1–9 对应 Word 标题 1–标题 9;去除行内标记时保留可读文本。
tools/md_to_docx.py:438
↓ 1 callers
Function
_add_horizontal_rule
(doc: Document)
tools/md_to_docx.py:628
↓ 1 callers
Function
_add_paragraph_with_inline_images
段落内混排文字与公式/插图(含 HTML 注释隐藏引用)。
tools/md_to_docx.py:676
↓ 1 callers
Function
_add_table
(doc: Document, rows: list[list[str]], base_dir: Path | None = None)
tools/md_to_docx.py:608
↓ 1 callers
Function
_dedupe_hits
(hits_lists: list)
tools/cnipa_epub_search.py:65
↓ 1 callers
Function
_dump_home_debug
调试:仅拉取首页并保存 WAF 通过后 HTML。
tools/cnipa_epub_crawler.py:208
↓ 1 callers
Function
_embed_picture
( doc: Document, path: Path, *, alt: str, src: str, max_w_in: float, max_h_in: flo
tools/md_to_docx.py:275
↓ 1 callers
Function
_ensure_utf8_stdio
在 Windows 等环境下将 stdout/stderr 设为 UTF-8,避免中文 JSON 在终端乱码导致误判检索失败。
tools/cnipa_epub_search.py:44
↓ 1 callers
Function
_ensure_utf8_stdio
减轻 Windows 终端下 JSON 中文乱码(与 cnipa_epub_search.py 一致)。
tools/cnipa_epub_crawler.py:55
↓ 1 callers
Function
_extension_for_content_type
(content_type: str)
tools/docx_to_md.py:33
↓ 1 callers
Function
_extract_abstract_from_item_html
从单条 ``div.item`` 内 ``dt`` 摘要对应的 ``dd`` 中抽取全文(含折叠 span)。
tools/cnipa_epub_parse.py:39
↓ 1 callers
Function
_find_mmdc_invocation
返回 (argv 前缀, use_shell)。 Windows 上 npx 常为 .ps1,无独立 .exe,需 shell=True 调用 ``npx ...``。 PATH 中的 ``mmdc`` 一般为 npm 全局安装的官方 CLI。
tools/mermaid_render.py:51
↓ 1 callers
Function
_fit_image_display_inches
在不超过 max_w / max_h 的前提下等比缩放,使整图落入版面。
tools/md_to_docx.py:141
↓ 1 callers
Function
_headed
()
tools/cnipa_epub_crawler.py:76
↓ 1 callers
Function
_html_fragment_to_plain
从一小段 HTML 抽取可读纯文本(用于摘要等)。
tools/cnipa_epub_parse.py:29
↓ 1 callers
Function
_is_diagram_image
mermaid 系统框图 / 流程图等(非公式,用全幅插图尺寸)。
tools/md_to_docx.py:170
↓ 1 callers
Function
_is_mermaid_figure_comment
(alt: str, src: str)
tools/mermaid_render.py:159
↓ 1 callers
Function
_is_table_sep
(row: list[str])
tools/md_to_docx.py:602
↓ 1 callers
Function
_local_mmdc
``tools/npm install`` 后可用 ``node_modules/.bin/mmdc``,避免每次 npx 拉包。
tools/mermaid_render.py:39
↓ 1 callers
Function
_max_wait_sec
()
tools/cnipa_epub_crawler.py:72
↓ 1 callers
Function
_maybe_render_math_md
若含 LaTeX 公式则尝试调用 ``math_render``(已注释的 PNG 引用会跳过)。
tools/md_to_docx.py:243
↓ 1 callers
Function
_mmdc_extra_args
传给 mmdc 的分辨率相关参数(-s 为 Puppeteer deviceScaleFactor,显著影响 PNG 清晰度)。
tools/mermaid_render.py:68
↓ 1 callers
Function
_parse_hidden_image_comment
(line: str)
tools/md_to_docx.py:58
↓ 1 callers
Function
_parse_overview_card_layout
新版「公布模式」结果页:无表格行,每条为 ``div.item``,题名在 ``h1.title``, 详情 URL 多在二维码 ``div.qrcode`` 的 ``title="http://epub.../patent/CN…"`` 上; 摘要位于 ``dt`` 为「
tools/cnipa_epub_parse.py:118
↓ 1 callers
Function
_parse_search_result_fallback_links
从结果页中抽取指向公布详情的 <a href>。
tools/cnipa_epub_parse.py:195
↓ 1 callers
Function
_rel_media_path
(out_file: Path, media_file: Path)
tools/pptx_to_md.py:58
↓ 1 callers
Function
_render_one_mermaid
( mermaid_source: str, png_path: Path, mmdc_base: list[str], *, use_shell: bool, scale
tools/mermaid_render.py:85
↓ 1 callers
Function
_replace_inline_math
( text: str, assets_dir: Path, assets_rel: str, counter: dict[str, int], *, dpi: int,
tools/math_render.py:130
↓ 1 callers
Function
_require_mammoth
()
tools/docx_to_md.py:21
↓ 1 callers
Function
_require_pptx
()
tools/pptx_to_md.py:21
↓ 1 callers
Function
_run
( input_docx: Path, output_md: Path, media_dir: Path | None, )
tools/docx_to_md.py:42
↓ 1 callers
Function
_run
(input_pptx: Path, output_md: Path, media_dir: Path | None)
tools/pptx_to_md.py:65
↓ 1 callers
Function
_shape_text
(shape)
tools/pptx_to_md.py:42
↓ 1 callers
Function
_split_table_cells
按列分隔符 ``|`` 拆分表格行,忽略 ``\\(...\\)``、``$...$``、``<!-- -->`` 与 ``\\|`` 内的竖线。
tools/md_to_docx.py:527
↓ 1 callers
Function
_terms_from_argv
从所有 argv 片段中按空白拆分(等价 str.split,连续空格视为一次分隔)。
tools/cnipa_epub_search.py:54
↓ 1 callers
Function
_try_add_image
( doc: Document, line: str, base_dir: Path | None, *, max_w_in: float = _DEFAULT_IMAGE_MAX
tools/md_to_docx.py:644
↓ 1 callers
Function
_try_embed_hidden_comment_line
( doc: Document, line: str, base_dir: Path | None, *, image_max_w_in: float, image_max
tools/md_to_docx.py:65
↓ 1 callers
Function
_usage
()
tools/cnipa_epub_search.py:80
↓ 1 callers
Function
_wait_result_page_settled
(page: Page)
tools/cnipa_epub_crawler.py:100
↓ 1 callers
Function
_walk_shapes
(shapes, MSO_SHAPE_TYPE)
tools/pptx_to_md.py:34
↓ 1 callers
Function
absFloat
(x float64)
examples/example_batch_job_scheduler/knowledge/pkg/scheduler/reorder.go:30
↓ 1 callers
Function
convert_md_to_docx
( md_text: str, base_dir: Path | None, *, image_max_w_in: float = _DEFAULT_IMAGE_MAX_W_IN,
tools/md_to_docx.py:700
↓ 1 callers
Function
default_result_html_path
()
tools/cnipa_epub_crawler.py:80
↓ 1 callers
Function
fetch_epub_result_html
只拉取检索结果页 HTML,不在此函数内做正文解析。 解析请使用 ``cnipa_epub_parse.parse_search_result_html(html)``。
tools/cnipa_epub_crawler.py:148
↓ 1 callers
Function
main
(argv: list[str] | None = None)
tools/math_render.py:342
↓ 1 callers
Function
main
(argv: list[str] | None = None)
tools/md_to_docx.py:948
↓ 1 callers
Function
main
(argv: list[str] | None = None)
tools/mermaid_render.py:341
↓ 1 callers
Function
main
(argv: list[str] | None = None)
tools/cnipa_epub_search.py:89
↓ 1 callers
Function
main
()
tools/docx_to_md.py:106
↓ 1 callers
Function
main
()
tools/iteration_dialog_log.py:21
↓ 1 callers
Function
main
()
tools/pptx_to_md.py:138
↓ 1 callers
Function
main
(argv: list[str] | None = None)
tests/test_cnipa_epub_chain.py:27
↓ 1 callers
Function
normalize_latex_for_mathtext
将常见 LaTeX 命令转为 matplotlib mathtext 可解析形式。
tools/math_render.py:52
↓ 1 callers
Function
render_latex_to_png
用 matplotlib mathtext 将 LaTeX 片段写入 PNG(无坐标轴/网格)。
tools/math_render.py:73
↓ 1 callers
Function
render_markdown_mermaid
返回 (新 markdown 全文, 成功转为 PNG 的块数, 生图失败而保留围栏的块数)。 资源目录为 out_md_path.parent / assets_rel。 失败的块原样写回 `` ```mermaid`` … `` ``` ``,不抛错。 成功的块
tools/mermaid_render.py:167
↓ 1 callers
Function
test_block_and_inline
()
tests/test_math_render.py:26
↓ 1 callers
Function
test_fallback_on_bad_latex
()
tests/test_math_render.py:48
↓ 1 callers
Function
try_write_docx
调用同目录下的 md_to_docx.py。成功返回 True;失败打印警告与手动命令,返回 False。
tools/mermaid_render.py:289
Function
ApplyReorder
ApplyReorder 对队列窗口内任务按匹配分重排(占位:真实实现需结合队首候选与节点集合)。
examples/example_batch_job_scheduler/knowledge/pkg/scheduler/reorder.go:38
Function
IsProbablyDead
IsProbablyDead 判定节点是否假死(示意)。
examples/example_batch_job_scheduler/knowledge/pkg/scheduler/heartbeat.go:18
Function
Score
Score 根据需求向量与节点画像计算匹配分(简化线性加权 + 过载惩罚,示例实现)。
examples/example_batch_job_scheduler/knowledge/pkg/scheduler/scorer.go:6
Function
ShouldReorder
ShouldReorder 是否满足限频重排条件(示例逻辑:间隔 + 变化阈值)。
examples/example_batch_job_scheduler/knowledge/pkg/scheduler/reorder.go:19
Function
repl_dollar
(m: re.Match[str])
tools/math_render.py:153
Function
repl_paren
(m: re.Match[str])
tools/math_render.py:157
Function
save_image
(image)
tools/docx_to_md.py:66
Function
search_epub_keyword_with_page
( page: Page, keyword: str, )
tools/cnipa_epub_crawler.py:180
Function
test_escaped_pipe_outside_math
()
tests/test_md_to_docx_table.py:31
Function
test_latex_norm_pipes_in_cell_stays_one_column
()
tests/test_md_to_docx_table.py:13
Function
test_simple_three_column_row
()
tests/test_md_to_docx_table.py:26