视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
calibre-write-xpath【文档与办公】Write, explain, and validate XPath expressions for Calibre conversion and ebook internals, including XHTML chapter detection, page-break and TOC rules, EPUB OPF manifest/spine queries, EPUB 3 nav documents, EPUB 2 NCX, SVG, and MathML. Use when the user asks for XPath, chapter selectors, level1/2/3 TOC expressions, start-reading selectors, namespace-…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Author XPath against the actual document and target engine. For Calibre conversion, assume XPath
1.0 plus Calibre/lxml extensions such as re:test(). Internally Calibre represents content as
XHTML, so use the h: prefix for XHTML elements.
--chapter, --page-breaks-before, --start-reading-at,
--level1-toc, --level2-toc, --level3-toc, or a raw OPF/nav/NCX query.scripts/validate_xpath.py under calibre-debug.ebook-convert ... --debug-pipeline <dir> when the
selector affects splitting or TOC generation.calibre-debug -e "<skill-dir>\scripts\validate_xpath.py" -- `
--file "chapter.xhtml" `
--xpath "//h:h1 | //h:h2" `
--require-elements
For package metadata:
calibre-debug -e "<skill-dir>\scripts\validate_xpath.py" -- `
--file "content.opf" `
--xpath "//opf:spine/opf:itemref/@idref"
The validator predefines h, epub, opf, dc, ncx, re, svg, and m namespaces. Add a
custom mapping with repeated --ns prefix=URI arguments.
//h1 against namespaced XHTML; it normally matches nothing.contains(concat(' ', normalize-space(@class), ' '), ' chapter '), not contains(@class, 'chapter') when false positives matter.matches(), lower-case(), ends-with(), or tokenize().re:test(., 'pattern', 'i') for regex/case-insensitive text matching./ to disable Calibre chapter or page-break detection only when that is the user's intent.ebook-convert.Read references/xpath-recipes.md for namespace mappings, Calibre option examples, OPF/nav/NCX selectors, and failure diagnostics. Adapt recipes to observed markup; never recommend a selector solely because it looks conventional.
Return the XPath in a code block, its target option/engine, namespace assumptions, representative matches and non-matches, validation evidence, and a safer fallback if markup varies across files.