视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
elements-and-metadata【文档与办公】Understand and manipulate Unstructured Element classes, metadata, coordinates, data-source metadata, staging conversions, and bundled inspection helpers. Use when inspecting partition output JSON, preserving table metadata or coordinates, or converting element JSON to JSON, NDJSON, Markdown, text, or HTML; route raw document partitioning to partition…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task starts from already-partitioned Unstructured elements or element JSON and needs schema inspection, metadata debugging, coordinate reasoning, or format conversion. Do not use it to partition source documents or compose chunks.
unstructured.documents.elements.Element subclasses such as Title, NarrativeText, ListItem, Table, TableChunk, Image, Formula, CheckBox, CompositeElement, Header, Footer, and Text.type, element_id, text, and metadata; CheckBox also uses checked, while text elements may include embeddings.ElementMetadata is sparse: unset fields are omitted from to_dict() and JSON output. Unknown ad-hoc metadata can exist, but known fields should be preferred for portable workflows.CoordinatesMetadata requires both points and system; one without the other is invalid. Coordinate dictionaries include points, system, layout_width, and layout_height.DataSourceMetadata lives under metadata.data_source and supports source-level fields such as url, version, record_locator, dates, and permissions.See references/element-schema.md for concrete JSON examples and metadata field guidance.
For in-process conversion, prefer unstructured.staging.base:
from unstructured.staging.base import elements_from_json, elements_to_json, elements_to_md
elements = elements_from_json(filename="elements.json")
markdown = elements_to_md(elements, exclude_binary_image_data=True)
json_text = elements_to_json(elements, indent=2)
For command-line use, use the bundled helpers:
python sub-skills/elements-and-metadata/scripts/convert_elements_json.py elements.json --format markdown --output out.md
python sub-skills/elements-and-metadata/scripts/convert_elements_json.py elements.json --format ndjson --output out.ndjson
python sub-skills/elements-and-metadata/scripts/render_elements_html.py elements.json --output rendered.html
See references/staging-formats.md for JSON, NDJSON, Markdown, text, and HTML behavior.
metadata.text_as_html whenever table structure matters; Markdown and HTML conversion can use it for richer table output than plain element.text.metadata.table_as_cells, table_id, chunk_index, and num_carried_over_header_rows when reconstructing or validating split tables.rowspan and colspan.Table and TableChunk elements retain both text and structural metadata.RelativeCoordinateSystem uses width and height 1; PixelSpace is screen-oriented with origin at the upper-left; PointSpace is Cartesian with origin at the lower-left.element.convert_coordinates_to_new_system(new_system, in_place=False) to inspect without mutation.layout_width or layout_height can prevent rehydrating concrete coordinate systems.elements_from_json() or scripts/convert_elements_json.py --inspect to catch malformed JSON early.type; unknown text-like types may be dropped by elements_from_dicts() if they are not mapped.metadata sparsely: missing keys often mean unset fields, not failed serialization.points and system are both present and that layout_width/layout_height match the originating page or image.text, metadata.text_as_html, and metadata.table_as_cells before and after conversion.orig_elements, image payloads, or compressed metadata, watch base64/gzip limits and prefer exclude_binary_image_data=True when rendering.See references/troubleshooting.md for failure modes and fixes.
partitioning sub-skill.CompositeElement, TableChunk composition, and chunk metadata consolidation belong to the chunking sub-skill unless the task is only inspecting existing chunk JSON.