OVAPortableText 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/CHANGELOG.md +16 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/PKG-INFO +10 -10
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/PROTOCOL.md +242 -22
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/README.md +9 -9
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/PROTOCOL_ALIGNMENT.md +2 -0
- ovaportabletext-0.7.0/docs/PYTHON_V16.md +87 -0
- ovaportabletext-0.7.0/docs/protocol/v1.6-example.json +511 -0
- ovaportabletext-0.7.0/docs/protocol/v1.6-freeze.md +29 -0
- ovaportabletext-0.7.0/docs/protocol/v1.6-implementation.md +56 -0
- ovaportabletext-0.7.0/docs/protocol/v1.6.md +5942 -0
- ovaportabletext-0.7.0/examples/v16_layout_report.py +47 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/pyproject.toml +1 -1
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/__init__.py +5 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/base.py +13 -2
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/block_objects.py +13 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/chart_helpers.py +6 -2
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/content.py +19 -4
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/document.py +20 -5
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/helpers.py +30 -15
- ovaportabletext-0.7.0/src/ova_portable_text/page_layout.py +66 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/protocol_version.py +11 -9
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/registry.py +8 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/resolver.py +14 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/section.py +34 -7
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/text.py +3 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/theme.py +7 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/v14_validation.py +14 -4
- ovaportabletext-0.7.0/src/ova_portable_text/v16_validation.py +191 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/validator.py +3 -1
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/version.py +1 -1
- ovaportabletext-0.7.0/tests/test_v16_layout.py +422 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/.gitignore +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/LICENSE +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/API_REFERENCE.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/EXAMPLES.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/PUBLISHING_CHECKLIST.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/PYTHON_V14.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/PYTHON_V15.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/QUICKSTART.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/REAL_WORLD_RECIPES.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/TEST_MATRIX.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/USER_TESTING_CHECKLIST.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/VALIDATION_AND_RESOLVER.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/native/portable_text_basics.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/test +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.0.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.1.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.2.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.3.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.4-draft-example.json +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.4-draft.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.4-example.json +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.4-freeze.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.4.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.5-example.json +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.5-freeze.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/docs/protocol/v1.5.md +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/builder_numbering_roundtrip_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/extended_registries_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/full_report_workflow_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/grid_table_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/image_sources_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/inline_objects_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/marks_and_lists_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/minimal_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/patent_valuation_style_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/references_and_marks_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/registry_blocks_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/sample_outputs/generate_patent_report_sample_1.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/sample_outputs/patent_report_sample_1.json +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/save_and_load_json_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/v11_layout_and_cell_image_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/v13_charts_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/v14_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/v15_valuation_result.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/validation_context_demo.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/examples/validation_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/chart_features.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/chart_semantics.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/exceptions.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/inline.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/numbering.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/py.typed +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/src/ova_portable_text/valuation.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_blocks_and_registry.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_builder_roundtrip_and_theme.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_content_flow_helpers.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_document_validation_error_rendering.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_examples_smoke.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_extended_registries_and_resolver.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_file_io_roundtrip.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_image_asset_sources.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_inline_objects.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_mark_validation.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_marks_and_lists.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_minimal_report.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_numbering.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_pie_chart_parallel_arrays.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_resolver_debug_summary.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_resolver_semantic_figure_alias.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_roundtrip_and_runtime_version.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_section_batch_helpers.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_strict_ids.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_style_validation.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_table_dataset_validation.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v11_grid_cell_image.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v11_image_block_optional_id.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v11_table_layout.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v11_theme_layout.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v12_section_and_doughnut.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v13_charts.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v14_charts.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v14_malformed_payloads.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_v15_valuation_result.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_validation_context_output.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_validation_failures.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_validation_report_python_alias.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_validation_success.py +0 -0
- {ovaportabletext-0.6.0 → ovaportabletext-0.7.0}/tests/test_validator_extended_rules.py +0 -0
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
**All notable changes to this project will be documented in this file.** ** **本项目的重要变更会记录在此文件中。
|
|
4
4
|
|
|
5
|
+
## [0.7.0] - 2026-10-13
|
|
6
|
+
|
|
7
|
+
### SDK
|
|
8
|
+
|
|
9
|
+
* added opt-in report.v1.6 page, object pagination, table/header alignment and explicit caption models and helpers
|
|
10
|
+
* added version boundaries, mutable-model validation, local caption resolution and two-sided group authoring while keeping report.v1.5 as the default
|
|
11
|
+
* preserved historical theme extensions and legacy caption helpers; added SDK tests, a runnable example and a renderer handoff checklist
|
|
12
|
+
* froze the protocol and Python SDK for release; renderer testing is unavailable and explicitly deferred, with no renderer compatibility claim
|
|
13
|
+
|
|
14
|
+
### Protocol
|
|
15
|
+
|
|
16
|
+
* designed `report.v1.6` pagination, page orientation scopes, table alignment inheritance, and explicit caption binding/placement
|
|
17
|
+
* refined only the new v1.6 contract: independent object before/after pagination, header alignment defaults, two-sided explicit captions, and deferred positional record cell overrides; existing v1.5 behavior and required column widths remain unchanged
|
|
18
|
+
* updated the main protocol and added the complete v1.6 protocol, JSON example, validation requirements, and renderer acceptance matrix
|
|
19
|
+
* retained Python 0.6.0 / report.v1.5 runtime defaults and frozen protocol archives; v1.6 renderer and editor acceptance remain pending
|
|
20
|
+
|
|
5
21
|
## [0.6.0] - 2026-09-27
|
|
6
22
|
|
|
7
23
|
### Protocol and Python SDK
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: OVAPortableText
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Python builder for generating OVAPortableText / Report Profile v1 JSON documents
|
|
5
5
|
Author: FENG QU
|
|
6
6
|
License-Expression: MIT
|
|
@@ -23,10 +23,10 @@ Description-Content-Type: text/markdown
|
|
|
23
23
|
|
|
24
24
|
# OVAPortableText
|
|
25
25
|
|
|
26
|
-
> Python **0.
|
|
26
|
+
> Python **0.7.0** 已实现 [`report.v1.6`](PROTOCOL.md):对象前后分页、页面方向、表格/表头对齐及显式 caption 前后组。默认仍创建 v1.5,新能力显式启用 v1.6。见 [使用指南](docs/PYTHON_V16.md)、[JSON 示例](docs/protocol/v1.6-example.json)和[冻结记录](docs/protocol/v1.6-freeze.md)。本次冻结覆盖协议与 SDK;渲染器当前无法测试,渲染验收延期。
|
|
27
27
|
|
|
28
|
-
**OVAPortableText** is a Python authoring package for building JSON documents that conform to the **OVA Report Profile v1.
|
|
29
|
-
**OVAPortableText** 是一个 Python 端的协议生成包,用于创建符合 **OVA Report Profile v1.
|
|
28
|
+
**OVAPortableText** is a Python authoring package for building JSON documents that conform to the **OVA Report Profile v1.6** protocol.
|
|
29
|
+
**OVAPortableText** 是一个 Python 端的协议生成包,用于创建符合 **OVA Report Profile v1.6** 协议的 JSON 文档。
|
|
30
30
|
|
|
31
31
|
It is **not** a PDF renderer. Its job is to help Python code produce a typed, validated, protocol-aligned document payload that can be handed off to a downstream renderer.
|
|
32
32
|
它**不是** PDF 渲染器。它的职责是帮助 Python 代码以强类型、可校验、可维护的方式生成协议 JSON,再交给下游渲染器处理。
|
|
@@ -73,8 +73,8 @@ The package ends at **structured JSON generation + validation + debugging suppor
|
|
|
73
73
|
|
|
74
74
|
## 3. Current protocol scope implemented by the package / 当前包已实现的协议范围
|
|
75
75
|
|
|
76
|
-
This package
|
|
77
|
-
|
|
76
|
+
This package implements the authoring and validation contracts through Report Profile v1.6; new documents default to v1.5 for compatibility.
|
|
77
|
+
当前包实现到 Report Profile v1.6 的构建与校验合同;为保持兼容,新文档默认 v1.5。以下为基础能力概览,新增能力见 v1.6 使用指南。
|
|
78
78
|
|
|
79
79
|
Currently implemented / 当前已实现:
|
|
80
80
|
|
|
@@ -430,11 +430,11 @@ twine check dist/*
|
|
|
430
430
|
|
|
431
431
|
### 11.3 Release note / 发布说明
|
|
432
432
|
|
|
433
|
-
The current package version is **0.
|
|
434
|
-
当前包版本为 **0.
|
|
433
|
+
The current package version is **0.7.0**.
|
|
434
|
+
当前包版本为 **0.7.0**。
|
|
435
435
|
|
|
436
|
-
This
|
|
437
|
-
|
|
436
|
+
This release supports the frozen Report Profile v1.6 protocol; renderer acceptance remains separate.
|
|
437
|
+
当前版本支持本仓库冻结的 Report Profile v1.6 协议;渲染器验收独立进行。
|
|
438
438
|
|
|
439
439
|
---
|
|
440
440
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# OVA Portable Text v1.
|
|
1
|
+
# OVA Portable Text v1.6 正式协议
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
状态:协议与 Python SDK 正式冻结;冻结日期:2026-10-13。Python 0.7.0 实现 report.v1.6,默认仍创建 v1.5,显式启用 v1.6。按本次发布决定,渲染器当前无法测试,其验收延期;本冻结不声称任何渲染器已通过 v1.6 验收。v1.5 及更早归档保持不变。
|
|
4
|
+
|
|
5
|
+
当前协议归档:[v1.6](docs/protocol/v1.6.md);[冻结记录](docs/protocol/v1.6-freeze.md)。兼容归档:[v1.5](docs/protocol/v1.5.md)。
|
|
4
6
|
|
|
5
7
|
## 1. 文档定位与阅读方式
|
|
6
8
|
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
- 协议维护者
|
|
23
25
|
- 校验器开发者
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
本版新增分页、页面方向、表格对齐及 caption 关联与位置,完整合同见第 23 节;第 21~22 节的 v1.4/v1.5 能力完整继承。第 23 节仅补充新增字段的规则,不改变未使用新增配置的旧内容行为。
|
|
26
28
|
|
|
27
29
|
### 1.1 本文推荐阅读顺序
|
|
28
30
|
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
- `footnotes`
|
|
41
43
|
- `glossary`
|
|
42
44
|
- `sections`
|
|
43
|
-
4.
|
|
45
|
+
4. 阅读第 15~20 章的引用、回退与校验要求,再阅读第 21~23 章的版本扩展合同。
|
|
44
46
|
|
|
45
47
|
### 1.2 协议范围
|
|
46
48
|
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
* `datasets.charts` 中十一种图表的正式结构:`pie / doughnut / bar / line / matrix_bubble / timeline / stage_progress / flow / funnel / range / valuation_result`
|
|
58
60
|
* 第 21 节的数据性质、坐标注释、量表、百分比归一化、圆环中心内容和组合 figure 实例
|
|
59
61
|
* section 级目录参与控制、章节角色、分页提示与展示提示
|
|
62
|
+
* 第 23 节的正文实例分页、页面方向、表格对齐继承及显式 caption 绑定(v1.6)
|
|
60
63
|
* bibliography / footnotes / glossary 的基础条目结构
|
|
61
64
|
* 渲染器最低实现要求与回退规则
|
|
62
65
|
|
|
@@ -64,7 +67,7 @@
|
|
|
64
67
|
|
|
65
68
|
* 第 10.4.3 节十一种正式图型之外的图表结构(包括误差棒、转化漏斗、双轴图)
|
|
66
69
|
* 视觉主题细节
|
|
67
|
-
*
|
|
70
|
+
* 页面级排版算法(但第 23 节定义的显式分页、方向作用域和 caption 边界约束必须遵守)
|
|
68
71
|
* 页眉页脚
|
|
69
72
|
* `manual` numbering 的详细对象结构
|
|
70
73
|
* 标题富文本
|
|
@@ -623,7 +626,7 @@ Portable Text 负责提供通用富文本骨架。
|
|
|
623
626
|
|
|
624
627
|
```json
|
|
625
628
|
{
|
|
626
|
-
"schemaVersion": "report.v1.
|
|
629
|
+
"schemaVersion": "report.v1.6",
|
|
627
630
|
"meta": {},
|
|
628
631
|
"theme": {},
|
|
629
632
|
"assets": {},
|
|
@@ -665,11 +668,11 @@ Portable Text 负责提供通用富文本骨架。
|
|
|
665
668
|
|
|
666
669
|
`schemaVersion` 表示当前文档所遵循的协议版本。渲染器必须按该值分发解析逻辑。
|
|
667
670
|
|
|
668
|
-
|
|
671
|
+
本版协议值: `report.v1.6`;SDK 默认仍创建 `report.v1.5` 以保持兼容,使用新增能力时必须显式选择 v1.6。
|
|
669
672
|
|
|
670
673
|
### 6.3 渲染器要求
|
|
671
674
|
|
|
672
|
-
-
|
|
675
|
+
- 声称支持本版协议的实现必须识别 `report.v1.6`,并按第 23 节校验和处理新增能力
|
|
673
676
|
- 遇到未知版本时,应返回清晰错误,而不是静默按旧版本解析
|
|
674
677
|
|
|
675
678
|
---
|
|
@@ -942,7 +945,7 @@ value 为:
|
|
|
942
945
|
- 颜色系统
|
|
943
946
|
- 字体族
|
|
944
947
|
- 具体字号
|
|
945
|
-
-
|
|
948
|
+
- 页面尺寸(页面方向另见第 23.4 节)
|
|
946
949
|
- 页边距
|
|
947
950
|
- 页眉页脚
|
|
948
951
|
- 通用页面级分页算法
|
|
@@ -952,7 +955,7 @@ value 为:
|
|
|
952
955
|
说明:
|
|
953
956
|
|
|
954
957
|
- v1.2 **正式定义**了 `section.pagination.pageBreakBefore`,但它只表示“该 section 开始前是否显式另起一页”
|
|
955
|
-
-
|
|
958
|
+
- 它并不等同于完整分页算法;v1.6 新增正文实例分页与 caption 边界约束,见第 23 节,仍不定义通用孤行控制算法
|
|
956
959
|
|
|
957
960
|
|
|
958
961
|
---
|
|
@@ -2483,10 +2486,12 @@ v1.4 为 line/bar/range 的数值轴增加 domain 和 ticks,见第 21.1.3 节
|
|
|
2483
2486
|
| `meta` | object | 否 | 附加元信息 | 当前不商定内部字段 |
|
|
2484
2487
|
| `tableType` | string | 是 | 表格模式 | 枚举值:`"record"` ,`"grid"` |
|
|
2485
2488
|
| `rows` | array | 是 | 行数据数组 | 具体结构取决于`tableType` |
|
|
2486
|
-
| `layout` | object | 否 | 表格布局提示 |
|
|
2489
|
+
| `layout` | object | 否 | 表格布局提示 | 列宽及第 23.5 节对齐默认值与覆盖 |
|
|
2487
2490
|
|
|
2488
2491
|
##### 10.5.4.1 caption 与 table 的关系
|
|
2489
2492
|
|
|
2493
|
+
v1.6 可使用第 23.6 节的显式前置/后置绑定;以下相邻后置模式仍可用于无显式绑定的旧内容。
|
|
2494
|
+
|
|
2490
2495
|
当前版本延续统一原则:
|
|
2491
2496
|
|
|
2492
2497
|
* 表题注优先使用相邻正文文本块,例如 `table_caption`
|
|
@@ -2501,6 +2506,8 @@ table_caption
|
|
|
2501
2506
|
|
|
2502
2507
|
##### 10.5.4.2 `layout`
|
|
2503
2508
|
|
|
2509
|
+
v1.6 另增 cellDefaults、headerDefaults 和列级表头对齐,见第 23.5 节;以下为继承的列宽合同。
|
|
2510
|
+
|
|
2504
2511
|
`datasets.tables[]` 可选包含 `layout` 对象(勿与段落 `layout` 字段混淆),用于表达表格级布局提示。
|
|
2505
2512
|
|
|
2506
2513
|
当前版本正式支持的 `layout` 结构:
|
|
@@ -2533,7 +2540,7 @@ table_caption
|
|
|
2533
2540
|
|
|
2534
2541
|
##### 10.5.4.3 `columnSpecs[]`
|
|
2535
2542
|
|
|
2536
|
-
每个 `columnSpecs[]`
|
|
2543
|
+
每个 `columnSpecs[]` 元素描述一列的宽度分配提示;v1.6 还可提供 align、verticalAlign 和 header,见第 23.5 节。
|
|
2537
2544
|
|
|
2538
2545
|
最小结构:
|
|
2539
2546
|
|
|
@@ -2651,9 +2658,8 @@ table_caption
|
|
|
2651
2658
|
* `columns[].key` 在同一张表内必须唯一
|
|
2652
2659
|
* `columns[].header` **允许重复** ,不要求唯一
|
|
2653
2660
|
* 渲染器应以 `columns[].key` 识别列,以 `columns[].header` 展示列标题
|
|
2661
|
+
* 列对齐见第 23.5 节,列宽见第 10.5.4 节;这些配置位于 layout.columnSpecs,不在 columns 中。
|
|
2654
2662
|
* 当前版本不细化:
|
|
2655
|
-
* 列对齐方式
|
|
2656
|
-
* 列宽
|
|
2657
2663
|
* 列类型
|
|
2658
2664
|
* 排序规则
|
|
2659
2665
|
* 合并单元格能力
|
|
@@ -3313,7 +3319,8 @@ table_caption
|
|
|
3313
3319
|
| `anchor` | string | 否 | 章节锚点 | 省略时可回退为`id` |
|
|
3314
3320
|
| `sectionRole` | string | 否 | 章节角色 | 见 14.4.6 |
|
|
3315
3321
|
| `navigation` | object | 否 | 章节导航控制 | 见 14.4.7 |
|
|
3316
|
-
| `pagination` | object | 否 | 章节分页提示 | 见 14.4.8
|
|
3322
|
+
| `pagination` | object | 否 | 章节分页提示 | 见 14.4.8 和 23.3 |
|
|
3323
|
+
| `page` | object | 否 | 章节子树页面方向 | v1.6 新增,见 23.4 |
|
|
3317
3324
|
| `presentation` | object | 否 | section 级展示提示 | 见 14.4.9 |
|
|
3318
3325
|
| `body` | array | 是 | 当前章节内部的 body item 列表 | 见 14.5 |
|
|
3319
3326
|
|
|
@@ -3417,7 +3424,7 @@ table_caption
|
|
|
3417
3424
|
|
|
3418
3425
|
#### 14.4.8 `pagination`
|
|
3419
3426
|
|
|
3420
|
-
`pagination` 用于表达 section 起始前的分页提示。
|
|
3427
|
+
`pagination` 用于表达 section 起始前的分页提示。v1.6 还允许正文 image/chart/table/figure 使用同名字段,见第 23.3 节。
|
|
3421
3428
|
|
|
3422
3429
|
当前版本正式支持的最小结构:
|
|
3423
3430
|
|
|
@@ -4014,6 +4021,8 @@ table_caption
|
|
|
4014
4021
|
|
|
4015
4022
|
#### 14.9.7 caption 的推荐实现
|
|
4016
4023
|
|
|
4024
|
+
v1.6 显式绑定的位置、相邻组与分页规则见第 23.6 节;以下为未显式绑定内容的旧版阅读顺序约定。
|
|
4025
|
+
|
|
4017
4026
|
当前版本推荐 caption 继续优先作为相邻文本块,而不是硬塞进对象字段:
|
|
4018
4027
|
|
|
4019
4028
|
* `image` 后可紧跟 `figure_caption`
|
|
@@ -4171,13 +4180,13 @@ table_caption
|
|
|
4171
4180
|
### 16.1 未知字段
|
|
4172
4181
|
|
|
4173
4182
|
- 未知扩展字段可兼容保留或忽略并给出诊断,不应仅因其存在导致整份文档失败
|
|
4174
|
-
- 第 21 节已定义的字段不得被当作未知字段忽略;出现在错误位置的正式字段必须诊断
|
|
4183
|
+
- 第 21~23 节已定义的字段不得被当作未知字段忽略;出现在错误位置的正式字段必须诊断
|
|
4175
4184
|
|
|
4176
4185
|
### 16.2 未知枚举值
|
|
4177
4186
|
|
|
4178
4187
|
- 应记录兼容日志
|
|
4179
4188
|
- 对旧文本样式等非关键展示枚举,可采用已有安全回退
|
|
4180
|
-
- 对第 21 节正式字段的未知枚举必须报告错误,不能猜测或改成默认值
|
|
4189
|
+
- 对第 21~23 节正式字段的未知枚举必须报告错误,不能猜测或改成默认值
|
|
4181
4190
|
|
|
4182
4191
|
例如:
|
|
4183
4192
|
|
|
@@ -4263,7 +4272,7 @@ table_caption
|
|
|
4263
4272
|
|
|
4264
4273
|
## 18. 渲染器最低实现要求
|
|
4265
4274
|
|
|
4266
|
-
|
|
4275
|
+
以下为继承的 v1.5 最低能力;声称支持 v1.6 时还必须满足第 23.7~23.8 节的校验与分页输出要求:
|
|
4267
4276
|
|
|
4268
4277
|
1. 识别顶层结构并遍历 `sections`
|
|
4269
4278
|
2. 识别 `content` 与 `subsection` 两类 body item
|
|
@@ -4307,7 +4316,7 @@ table_caption
|
|
|
4307
4316
|
- 页边距
|
|
4308
4317
|
- 页眉页脚
|
|
4309
4318
|
- 背景图铺设方式
|
|
4310
|
-
-
|
|
4319
|
+
- 具体分页算法(仍须满足第 23 节的显式约束)
|
|
4311
4320
|
- 复杂公式排版实现
|
|
4312
4321
|
- 视觉主题细节
|
|
4313
4322
|
|
|
@@ -4882,7 +4891,7 @@ stacked 的正数从零向正方向累加,负数从零向负方向独立累加
|
|
|
4882
4891
|
|
|
4883
4892
|
figure 的新增需要同步 BlockElement、正文解析、resolver、编号器、编辑器选择/复制/删除和渲染器;现有代码尚无此能力。必须检查布局中 chartRef/imageRef 的间接依赖,不能只检查正文直接 chartRef。不得用静态截图作为组合图实现验收的替代。
|
|
4884
4893
|
|
|
4885
|
-
|
|
4894
|
+
v1.6 存在显式 caption 绑定时按第 23.6 节处理;无显式绑定时,组合实例的 caption 关联采用最小相邻约定:同一 content.blocks 中紧接 figure 的连续 `style=figure_caption` 文本块,按输入顺序作为它的说明;遇到其他块或 content 结束即终止,不跨 content/section 搜索,也不从文字数字猜测归属。没有紧邻 caption 时组合仍合法,模板可只显示图号。caption 的文字仍独立保存,编号器不改写其 span 内容。新约定仅针对新增 figure,不追溯改变旧 chart/image 的 caption 处理。
|
|
4886
4895
|
|
|
4887
4896
|
编号只按正文阅读顺序遍历实例,不能按 registry 顺序分配;figure 与普通 chart/image 共用 figure 计数,不给 grid 或数据集分配正文图号。复制或移动 figure 时一并处理紧邻 caption;保留布局资源共享关系,除非显式选择独立副本。删除一个实例不隐式删除仍被其他实例使用的资源。
|
|
4888
4897
|
|
|
@@ -5151,7 +5160,7 @@ band 说明区间,不覆盖边界点显式声明的 observed 身份。
|
|
|
5151
5160
|
|
|
5152
5161
|
## 22. v1.5 `valuation_result` 估值结果横幅
|
|
5153
5162
|
|
|
5154
|
-
本节为 v1.5 新增的正式合同。v1.5 完整继承第 21 节的 v1.4 能力;该节的“必须声明 v1.4”对 v1.5 文档解释为“至少具备 v1.4
|
|
5163
|
+
本节为 v1.5 新增的正式合同。v1.5 完整继承第 21 节的 v1.4 能力;该节的“必须声明 v1.4”对 v1.5 文档解释为“至少具备 v1.4 能力的已支持版本”。本节新类型要求 report.v1.5,亦可用于继承该能力的 report.v1.6;不得写入声称 v1.4 的新生成文档。
|
|
5155
5164
|
|
|
5156
5165
|
### 22.1 用途与实例
|
|
5157
5166
|
|
|
@@ -5227,6 +5236,217 @@ Python 0.6.0 默认创建 report.v1.5;显式创建 report.v1.4 继续可用。
|
|
|
5227
5236
|
|
|
5228
5237
|
完整示例见 [v1.5 JSON](docs/protocol/v1.5-example.json),Python 创建与渲染接入说明见 [使用指南](docs/PYTHON_V15.md)。SDK 生成和校验通过,不代表任何现有编辑器或渲染器已经实现横幅。
|
|
5229
5238
|
|
|
5239
|
+
## 23. v1.6 分页、页面方向、表格对齐与 caption
|
|
5240
|
+
|
|
5241
|
+
### 23.1 状态与设计边界
|
|
5242
|
+
|
|
5243
|
+
本节为 2026-10-13 冻结的 v1.6 新增合同;Python 0.7.0 实现见 [实现记录](docs/protocol/v1.6-implementation.md)。渲染器当前无法测试,验收延期,详见 [冻结记录](docs/protocol/v1.6-freeze.md)。完整继承 v1.5。本次新增字段不改变旧字段合同;已有 section.pagination、grid 单元格对齐、必填列宽、文本布局和无显式绑定 caption 的既有语义不变。只有使用新增字段的内容才启用对应新规则;未使用新增配置的内容沿用既有渲染行为。新字段仅用于 `schemaVersion = "report.v1.6"`,不得写入声称 v1.5 或更早版本的新生成文档。第 22 节的 valuation_result 在 v1.6 中继续合法。
|
|
5244
|
+
|
|
5245
|
+
本节定义作者可声明的排版约束,不定义纸张尺寸、页边距、字号、颜色或具体分页算法。页面设置属于文档、章节或正文实例,不属于 chart/table 数据集;共享同一个数据集的实例可以采用不同页面设置。
|
|
5246
|
+
|
|
5247
|
+
### 23.2 字段总览
|
|
5248
|
+
|
|
5249
|
+
所有新增字段均可省略;出现时不得为 null。封闭对象的未知字段和非法枚举是校验错误,不适用“忽略未知字段”的通用回退。
|
|
5250
|
+
|
|
5251
|
+
| 位置 | 新增或扩展字段 | 合同 |
|
|
5252
|
+
| --- | --- | --- |
|
|
5253
|
+
| `theme` | `page` | 文档默认页面方向 |
|
|
5254
|
+
| `section` | `page` | 章节子树的页面方向 |
|
|
5255
|
+
| 正文 `image / chart / table / figure` 实例 | `pagination`、`page` | 实例前后分页、局部页面方向,二者独立 |
|
|
5256
|
+
| `datasets.tables[].layout` | `cellDefaults`、`headerDefaults` | 普通单元格和表头的对齐默认值 |
|
|
5257
|
+
| `datasets.tables[].layout.columnSpecs[]` | `align`、`verticalAlign`、`header` | 列数据及表头对齐默认值;保留必填 width |
|
|
5258
|
+
| `_type="block"` caption 文本块 | `caption` | 显式目标引用和前置/后置位置 |
|
|
5259
|
+
|
|
5260
|
+
`PageSettings = { orientation: "portrait" | "landscape" }`,orientation 必填。
|
|
5261
|
+
`ObjectPagination = { pageBreakBefore?: "auto" | "always", pageBreakAfter?: "auto" | "always" }`,两项分别缺省 auto,空对象合法。仅适用于上述正文对象;已有 SectionPagination 保持只有 pageBreakBefore,不新增 section.pageBreakAfter。
|
|
5262
|
+
`CellAlignment = { align?: "left" | "center" | "right", verticalAlign?: "top" | "middle" | "bottom" }`,空对象表示无覆盖。
|
|
5263
|
+
`CaptionBinding = { targetRef: 非空字符串, position: "before" | "after" }`,两项必填。
|
|
5264
|
+
以上对象均为封闭对象。
|
|
5265
|
+
|
|
5266
|
+
### 23.3 章节和正文实例分页
|
|
5267
|
+
|
|
5268
|
+
保留 `section.pagination.pageBreakBefore` 的既有语义。仅为正文 image/chart/table/figure 实例新增 ObjectPagination:
|
|
5269
|
+
|
|
5270
|
+
```json
|
|
5271
|
+
{
|
|
5272
|
+
"_type": "table",
|
|
5273
|
+
"id": "table-financial-instance",
|
|
5274
|
+
"tableRef": "table-financial-data",
|
|
5275
|
+
"pagination": {
|
|
5276
|
+
"pageBreakBefore": "always",
|
|
5277
|
+
"pageBreakAfter": "always"
|
|
5278
|
+
}
|
|
5279
|
+
}
|
|
5280
|
+
```
|
|
5281
|
+
|
|
5282
|
+
- pageBreakBefore=always:对象组的首个可见内容必须从新页可用内容区域开始;包括显式前置 caption。
|
|
5283
|
+
- pageBreakAfter=always:对象组结束后的下一个可见内容必须从新页开始;包括显式后置 caption 结束后,而不是对象本体结束后。
|
|
5284
|
+
- auto:不提出该边界的强制分页要求,正常溢出仍可分页,方向切换规则仍须执行。
|
|
5285
|
+
- 对象组由对象与其显式前后 caption 组组成;figure 也可包含按既有约定关联的隐式后置 caption。对普通 chart/image/table,不自动推断旧 caption 归属;需要一起分页时显式绑定。
|
|
5286
|
+
- 两项同时 always 才明确请求对象组独占一段页面;只设置 before 时,同方向的后续正文可以使用剩余区域。独占不等于只占一页,长表仍可合法跨页。
|
|
5287
|
+
- 新增对象分页与已有章节起始分页、方向切换产生的同一边界必须合并。目标方向的空白新页可直接使用,文档首部不补空白页;文档末尾的 after 不生成尾页。“空白”指尚无正文,页眉页脚不计入。
|
|
5288
|
+
- 新字段不改变已有空章节处理规则,不给无新增配置的旧内容引入新的分页行为。
|
|
5289
|
+
- 本版不新增通用 page_break 块。普通文本、math_block、callout、content 包装及 registry 条目不能携带上述实例分页字段。
|
|
5290
|
+
- 单元格内部 chart/image 不能设置 pagination 或 page;需要分页或横向时设置外层正文 table/figure 实例。
|
|
5291
|
+
|
|
5292
|
+
### 23.4 页面方向、继承与恢复
|
|
5293
|
+
|
|
5294
|
+
文档默认设置示例:
|
|
5295
|
+
|
|
5296
|
+
```json
|
|
5297
|
+
"theme": { "page": { "orientation": "portrait" } }
|
|
5298
|
+
```
|
|
5299
|
+
|
|
5300
|
+
为保持旧模板兼容,未声明 `theme.page` 时继续使用渲染器模板原有默认方向,不强制将旧内容改成纵向。新增文档建议显式输出上述 portrait 配置,以保证默认纵向;局部 page 退出后恢复章节方向或文档有效默认方向。渲染器在使用局部 page 时必须能确定该有效默认方向,不能自行猜测。portrait 表示物理页高大于页宽,landscape 表示页宽大于页高;渲染器使用同一模板纸张尺寸的长短边切换方向。方形纸张无法满足方向语义时须报告配置错误。本字段不是旋转文字、图片或图表坐标轴。
|
|
5301
|
+
|
|
5302
|
+
**章节范围:**
|
|
5303
|
+
|
|
5304
|
+
1. `section.page` 覆盖父章节方向;未声明则继承父章节,顶层继承 theme。方向按章节树作用域计算,不能沿兄弟章节泄漏。
|
|
5305
|
+
2. 从章节可见标题起,正文和未覆盖方向的子章节均使用该方向,直到退出该章节子树。
|
|
5306
|
+
3. 进入或退出作用域后,如果下一个可见内容所需方向与当前页不同,必须从对应方向的新页开始,即使 pageBreakBefore 为 auto。前页无正文时直接采用所需方向,不保留空白页。
|
|
5307
|
+
4. 相同方向的章节边界不自动分页;若需要新起一页,仍设置 pageBreakBefore=always。
|
|
5308
|
+
5. 退出横向子章节后,父章节后续正文恢复父方向;退出横向顶层章节后,未声明方向的兄弟章节恢复文档默认方向。文档结束时只恢复逻辑状态,不制造尾页。
|
|
5309
|
+
|
|
5310
|
+
**正文实例范围:**
|
|
5311
|
+
|
|
5312
|
+
```json
|
|
5313
|
+
{
|
|
5314
|
+
"_type": "chart",
|
|
5315
|
+
"id": "chart-wide-instance",
|
|
5316
|
+
"chartRef": "chart-wide-data",
|
|
5317
|
+
"page": { "orientation": "landscape" }
|
|
5318
|
+
}
|
|
5319
|
+
```
|
|
5320
|
+
|
|
5321
|
+
实例 page 只覆盖对象组的页面方向,不隐含独占页面。对象组包含第 23.3 节定义的关联 caption;未声明 page 时继承所在章节方向。实例结束后恢复逻辑作用域,由下一个可见内容实际需要的方向决定是否换页。
|
|
5322
|
+
|
|
5323
|
+
- 方向不同,必须从所需方向的新页开始;方向相同,仅声明 page 不产生额外分页。显式写出当前方向与不写的分页效果相同。
|
|
5324
|
+
- 如需同方向对象也独占页面,显式设置 ObjectPagination 的 before/after 均为 always。auto 不能取消实际方向变化所要求的换页。
|
|
5325
|
+
- 相邻两个横向对象组之间没有可见纵向内容时,不生成中间纵向页。若没有显式分页且版面容得下,可以共享横向页;任一侧的边界设置 always 时必须分开。不得跨越可见章节标题、普通段落或未绑定 caption 合并方向范围。
|
|
5326
|
+
- 跨页表格、组合 figure 及其延续页面保持实例方向,直到对象和全部关联 caption 结束。后续普通内容恢复所属章节方向;文档结束只恢复逻辑状态,不制造尾页。
|
|
5327
|
+
- 前一实例 after、后一实例 before、章节起始分页与方向变化按同一阅读边界合并,最多产生一次换页;原有章节分页字段含义不变。
|
|
5328
|
+
- 同一实例内部不允许不同分图各自切换方向。若对象无法合法拆分且超过页面,正式输出须明确报告版面无法容纳,不得裁掉内容或无限添加空页。figure 原有 keepTogether 规则继续生效。
|
|
5329
|
+
|
|
5330
|
+
### 23.5 表格单元格对齐
|
|
5331
|
+
|
|
5332
|
+
grid 继续使用现有 `cells[].align / verticalAlign`;其既有语义不变。本版只新增表级、列级及表头默认值,不改变 record.rows 的业务数据形状,也不改变原有列宽规则。
|
|
5333
|
+
|
|
5334
|
+
```json
|
|
5335
|
+
"layout": {
|
|
5336
|
+
"cellDefaults": { "align": "left", "verticalAlign": "middle" },
|
|
5337
|
+
"headerDefaults": { "align": "center" },
|
|
5338
|
+
"columnSpecs": [
|
|
5339
|
+
{ "width": { "mode": "auto" }, "align": "left" },
|
|
5340
|
+
{
|
|
5341
|
+
"width": { "mode": "weight", "value": 2 },
|
|
5342
|
+
"align": "right",
|
|
5343
|
+
"header": { "align": "center" }
|
|
5344
|
+
}
|
|
5345
|
+
]
|
|
5346
|
+
}
|
|
5347
|
+
```
|
|
5348
|
+
|
|
5349
|
+
- cellDefaults、headerDefaults 和 columnSpecs[].header 均为 CellAlignment;header 中不能包含 width 或嵌套 header。空对象表示不提供覆盖。
|
|
5350
|
+
- cellDefaults 是全表通用默认值,适用于 grid/record;headerDefaults 在表头上覆盖通用默认值。record 表头为 columns[].header;grid 仅以单元格 header=true 判定,不根据第一行或文字内容推断。
|
|
5351
|
+
- columnSpecs[] 新增 align、verticalAlign 作为本列通用默认值,header 作为本列表头专用覆盖。width 仍必填,只需要对齐时使用 `{ "mode": "auto" }`。非空数组长度、逻辑列数和既有宽度算法保持不变。
|
|
5352
|
+
- 普通单元格新增默认值的逐属性优先级:**grid 单元格已有显式值 > 列通用值 > 表通用值 > 原有渲染默认值**。
|
|
5353
|
+
- 表头逐属性优先级:**grid 单元格已有显式值 > 列 header > 表 headerDefaults > 列通用值 > 表 cellDefaults > 原有渲染默认值**。表头专用设置优先于通用设置,保证“标题居中、金额右对齐”可独立表达。
|
|
5354
|
+
- align 与 verticalAlign 分别解析,声明其中一项不重置另一项。新增默认值只填补旧单元格未显式声明的属性;未使用新增字段时,不改变任何旧单元格、文本块或主题的解析行为。
|
|
5355
|
+
- 对 grid 富文本块,不重新规定已有 cell.align、block.layout 和 theme 之间的优先级。新增继承来的 align 仅在没有旧单元格显式 align、文本块显式 textAlign 和对应主题 textAlign 时,作为文本水平对齐的补充默认值;不能覆盖已有文本布局。图片和图表可使用新增默认对齐,但不能改变其坐标轴或数据标签对齐。
|
|
5356
|
+
- 跨列 grid 单元格从起始逻辑列继承新增列默认值;起始列计算计入 rowSpan 占位。已有 colSpan、rowSpan、header、align、verticalAlign 的含义不变。
|
|
5357
|
+
- 暂不纳入前版草案的 record.layout.cellOverrides;该字段不是 v1.5 已有能力,也不是本次修订后的 v1.6 正式字段。需要任意单元格级例外、合并或富文本时使用已有 grid 能力。未来如需 record 单元格覆盖,须另行设计稳定行标识,不能只用易随排序变化的 rowIndex。
|
|
5358
|
+
- 不新增固定行高、百分比高度或隐式数字对齐;满宽图表的水平对齐可能没有可见位移。
|
|
5359
|
+
|
|
5360
|
+
### 23.6 caption 关联、位置与对齐
|
|
5361
|
+
|
|
5362
|
+
caption 继续作为独立 `_type="block"` 文本保存,编号语义归属对象实例。新增可选 caption 对象:
|
|
5363
|
+
|
|
5364
|
+
```json
|
|
5365
|
+
{
|
|
5366
|
+
"_type": "block",
|
|
5367
|
+
"style": "table_caption",
|
|
5368
|
+
"caption": { "targetRef": "table-financial-instance", "position": "before" },
|
|
5369
|
+
"layout": { "textAlign": "center" },
|
|
5370
|
+
"children": [{ "_type": "span", "text": "Financial summary", "marks": [] }],
|
|
5371
|
+
"markDefs": []
|
|
5372
|
+
}
|
|
5373
|
+
```
|
|
5374
|
+
|
|
5375
|
+
**引用及位置约束:**
|
|
5376
|
+
|
|
5377
|
+
1. targetRef 必须引用同一正文 `content.blocks[]` 中 image/chart/table/figure 的实例 id,不接受 registry id、anchor 别名或跨 content/section 目标。被引用实例必须显式提供非空且全局唯一的 id。
|
|
5378
|
+
2. table 的显式 caption 必须使用 table_caption;image/chart/figure 使用 figure_caption。普通 caption、equation_caption、列表项不允许携带本绑定。单元格内部 caption 仍按既有内容顺序渲染,本版不允许携带本绑定。
|
|
5379
|
+
3. position 必填 before 或 after,指阅读顺序中对象之前或之后,不是绝对页面坐标。前置 caption 必须在数组中位于对象前方,后置必须在后方;渲染器不得通过重排来修复错误输入。
|
|
5380
|
+
4. 同一目标可同时拥有 before 和 after 两组显式 caption,每侧最多一个连续组,每组可含多段文本。前组紧邻对象之前,后组紧邻对象之后;各组内不能插入其他对象、无绑定文本或其他目标的 caption。每段只绑定一个目标;同一对象仍只有一个身份和编号。
|
|
5381
|
+
5. 所有显式绑定先校验,再执行旧相邻关联。对存在显式绑定的目标,禁止追加隐式 caption;其他未绑定文本仍正常显示,但不属于该对象。对无显式绑定的 figure,保留 v1.4 的连续后置 figure_caption 约定,遇到任何显式绑定的文本即停止隐式收集。chart/image/table 无显式绑定时不新增自动推断规则,保留旧版阅读顺序行为。
|
|
5382
|
+
6. 复制、移动或删除对象时,编辑器必须将显式 caption 组作为关联内容处理;复制需生成新实例 id 并重写 targetRef,不得更改共享资源 id。取消关联需要显式编辑,不能留下悬空引用。
|
|
5383
|
+
|
|
5384
|
+
**对齐与分页:**
|
|
5385
|
+
|
|
5386
|
+
- caption 对齐复用 `block.layout.textAlign`,支持 left/center/right,也保留既有 justify;全局默认仍来自 `theme.blockStyleDefaults.figure_caption / table_caption`。块级 > 主题 > 模板。不新增平行的 captionAlign 字段。
|
|
5387
|
+
- 对象分页和实例 page 的范围包括显式 caption 组,以及按既有规则关联的 figure 隐式 caption 组。前置 caption 不能遗留在上一页,后置 caption 不能落在恢复方向后的普通正文页。
|
|
5388
|
+
- 以下同页约束只针对新增的显式 caption 绑定,不追溯改变旧隐式 caption 的排版规则。存在新对象分页或方向设置的隐式 figure caption 随对象组应用新页面边界,但不因此获得新的强制逐行同页规则。
|
|
5389
|
+
- 对象与显式前后 caption 整体可放入一个可用页面时,应保持同页;放不下时允许合法拆分。前置组最后一行必须与对象首个有效内容片段同页;后置组第一行必须与末个有效片段同页。
|
|
5390
|
+
- 对有数据行的表格,首个有效片段须包含首个数据行片段(以及适用的表头),末个有效片段须包含最后数据行片段;只放表头或重复表头不算满足约束。record 数据行由 rows 定义;grid 中至少包含一个 header=false 单元格起始或 rowSpan 延续占位的逻辑行视为数据行。允许沿用渲染器原有行拆分策略,本规则不新增行可拆分能力。只有表头或无数据行的表格使用其实际可见表格片段;完全没有可见表格内容时,显式绑定须报告无内容可关联。
|
|
5391
|
+
- 不可拆分图表/图片的有效片段是整个对象;可拆分 figure 按原有合法拆分规则,首尾片段不能只是编号或续图标识。渲染器必须为 caption 边界预留空间;若不可拆对象仍无法满足,报告带实例 id 的排版错误,不得静默丢弃 caption。
|
|
5392
|
+
- 跨页对象的 caption 只出现一次:before 位于首个片段之前,after 位于最后片段之后。续表/续图标识由渲染器生成,不能复制成新的正文 caption 或新编号。
|
|
5393
|
+
- 一个 caption 组中的多个文本块保持输入顺序,各自可设不同对齐。编号器不改写 caption 的 span 文本,也不依据标题文字中的数字建立关联。
|
|
5394
|
+
|
|
5395
|
+
### 23.7 校验、能力声明与版本边界
|
|
5396
|
+
|
|
5397
|
+
正式 v1.6 实现至少应执行以下结构与语义检查,并提供明确的 JSON 字段路径。结构校验通过不代表给定纸张、字体和边距下排版可行;尺寸、有效内容片段、caption 同页及溢出检查在渲染阶段完成,并提供实例 id 与具体原因:
|
|
5398
|
+
|
|
5399
|
+
| 错误类别 | 必须拒绝的输入 |
|
|
5400
|
+
| --- | --- |
|
|
5401
|
+
| 版本 | 向旧版本作者模型写入新字段;把未知版本当成 v1.5 解析 |
|
|
5402
|
+
| 页面 | orientation 为 horizontal、vertical、null 或其他非法值;page 缺失 orientation |
|
|
5403
|
+
| 位置 | 将 page/pagination 放在 dataset、单元格对象或普通文本上 |
|
|
5404
|
+
| 对齐 | 非法 align/verticalAlign;columnSpecs 缺 width 或长度错误;headerDefaults/header 结构错误;使用已撤回的 layout.cellOverrides |
|
|
5405
|
+
| 对象分页 | 非法 before/after 枚举;在 section.pagination 中写入 pageBreakAfter |
|
|
5406
|
+
| caption 引用 | 目标不存在、不是合法正文对象、id 重复、跨内容流、引用数据集 |
|
|
5407
|
+
| caption 顺序 | position 与数组顺序矛盾、任一侧组不连续、跨目标穿插;同一目标前后各一组合法 |
|
|
5408
|
+
| caption 类型 | style 与目标不匹配、列表 caption、单元格内显式绑定 |
|
|
5409
|
+
|
|
5410
|
+
页面与 caption 字段即使位于允许扩展的 theme/meta 等对象中,放错位置也不能获得正式语义。theme.page 是正式字段,不能当成任意字典跳过校验。
|
|
5411
|
+
|
|
5412
|
+
未知扩展保留策略不等于支持新能力。未实现新字段的渲染器必须在能力预检或正式分页输出时明确失败,不得静默忽略分页、方向、对齐或 caption 关联后声称支持 v1.6。无分页的 Web 预览可以按原阅读顺序显示内容并明确提示页面约束未预览,但不能据此通过 PDF 排版验收。
|
|
5413
|
+
|
|
5414
|
+
旧版文档仍按原版合同读取,不隐式升级或重解释历史扩展字段。升级必须显式选择 v1.6 并重新校验;旧 figure 的后置 caption 无须改写即可继续工作。降级必须移除或转换新能力并告知损失,不能只改 schemaVersion。
|
|
5415
|
+
|
|
5416
|
+
Python 0.7.0 已实现本节 SDK 模型、构建、校验和显式引用解析,默认仍创建 v1.5,显式选择 v1.6 才启用新合同。完整示例已作为新 SDK 测试输入。编辑器已有实现仍以 v1.3 为基线;PDF 排版和编辑器操作未验收,不因 SDK 校验通过而宣称已支持。见 [Python 指南](docs/PYTHON_V16.md) 与 [实现及联调记录](docs/protocol/v1.6-implementation.md)。
|
|
5417
|
+
|
|
5418
|
+
### 23.8 验收矩阵与示例
|
|
5419
|
+
|
|
5420
|
+
| 场景 | 必须验证的结果 |
|
|
5421
|
+
| --- | --- |
|
|
5422
|
+
| 文档首部、连续章节和实例 always | 从页首开始,无多余空白页 |
|
|
5423
|
+
| 普通纵向章节中的横向子章节 | 子章节及后代横向;退出后父正文恢复纵向 |
|
|
5424
|
+
| 文档默认横向,子章节显式纵向 | 双向覆盖均成立,无纵向硬编码 |
|
|
5425
|
+
| 同方向章节 page、同方向实例 page | 单独声明方向均不额外分页;旧章节 before 语义不变 |
|
|
5426
|
+
| 对象 before/after 同时 always | 前置 caption、对象、后置 caption 独占页面段;与方向字段独立 |
|
|
5427
|
+
| 相邻横向对象及交叠分页请求 | 无强制分页时可同页;after/before/方向边界合并,无中间纵向空页 |
|
|
5428
|
+
| 横向 table 跨页 | 全部表格页横向,结束后恢复,只有一个表号 |
|
|
5429
|
+
| 横向 figure + 显式前置 caption | caption 同在横向页,对象及标题顺序、图号正确 |
|
|
5430
|
+
| 实例位于章节末尾或文档末尾 | 下一可见内容决定恢复方向,无恢复空页 |
|
|
5431
|
+
| 同一对象 before 与 after 均有多段 caption | 每侧连续、共同应用页面范围、只产生一个对象编号 |
|
|
5432
|
+
| 跨页表格的显式 caption | 前标题不只跟表头、后说明不只跟重复表头;原有行拆分规则不变 |
|
|
5433
|
+
| 前置 caption 后的实例 always | 在 caption 前分页,不在 caption 与对象间分页 |
|
|
5434
|
+
| grid 合并单元格 | 按逻辑起始列继承,对齐不受 cells 数组位置误导 |
|
|
5435
|
+
| record 表级/列级/表头默认值 | 标题居中、数字右对齐,两属性独立继承,业务值不变 |
|
|
5436
|
+
| grid 内已有文本与主题布局 | 新默认值不覆盖已有 cell/block/theme 设置,未用新字段结果不变 |
|
|
5437
|
+
| 旧版兼容基线 | v1.5 档案、SDK、章节分页、列宽及无绑定 caption 无变化 |
|
|
5438
|
+
| 旧 figure 隐式 caption 与新显式绑定相邻 | 不重复归属,不跨显式绑定收集 |
|
|
5439
|
+
| 不可拆对象过大、无效引用、不支持的能力 | 有路径或实例 id 的明确诊断,无丢失或伪成功 |
|
|
5440
|
+
|
|
5441
|
+
完整 JSON 示例见 [v1.6 示例](docs/protocol/v1.6-example.json)。本次冻结范围为协议合同及 Python SDK;SDK 模型、helper、版本边界、引用解析和往返测试已完成。按发布决定,渲染器当前无法测试,caption 编辑操作与分页渲染截图验收另行完成;未完成前不得声称相应编辑器或渲染器已通过本节验收。验收矩阵仍是下游实现的要求,不因本次冻结而取消。
|
|
5442
|
+
|
|
5443
|
+
## v1.6 更新说明(相对于 v1.5)
|
|
5444
|
+
|
|
5445
|
+
- 新增正文对象前后分页及文档/章节/实例页面方向,方向与独占分页独立表达。
|
|
5446
|
+
- 新增表级、列级和表头对齐默认值,保留旧单元格及列宽规则;暂缓 record 单元格覆盖。
|
|
5447
|
+
- 新增 caption 显式目标,允许前后各一组,复用文本对齐;有效内容片段约束仅用于新显式绑定。
|
|
5448
|
+
- 保留 v1.5 归档及 SDK 默认版本;Python 0.7.0 实现 v1.6 SDK;协议与 SDK 已冻结,渲染及编辑器验收延期且独立记录。
|
|
5449
|
+
|
|
5230
5450
|
## v1.5 更新说明(相对于 v1.4)
|
|
5231
5451
|
|
|
5232
5452
|
- 新增 valuation_result 原生结果横幅,支持点估值和区间估值、明确的币种单位、显示倍率、估值口径及基准日。
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# OVAPortableText
|
|
2
2
|
|
|
3
|
-
> Python **0.
|
|
3
|
+
> Python **0.7.0** 已实现 [`report.v1.6`](PROTOCOL.md):对象前后分页、页面方向、表格/表头对齐及显式 caption 前后组。默认仍创建 v1.5,新能力显式启用 v1.6。见 [使用指南](docs/PYTHON_V16.md)、[JSON 示例](docs/protocol/v1.6-example.json)和[冻结记录](docs/protocol/v1.6-freeze.md)。本次冻结覆盖协议与 SDK;渲染器当前无法测试,渲染验收延期。
|
|
4
4
|
|
|
5
|
-
**OVAPortableText** is a Python authoring package for building JSON documents that conform to the **OVA Report Profile v1.
|
|
6
|
-
**OVAPortableText** 是一个 Python 端的协议生成包,用于创建符合 **OVA Report Profile v1.
|
|
5
|
+
**OVAPortableText** is a Python authoring package for building JSON documents that conform to the **OVA Report Profile v1.6** protocol.
|
|
6
|
+
**OVAPortableText** 是一个 Python 端的协议生成包,用于创建符合 **OVA Report Profile v1.6** 协议的 JSON 文档。
|
|
7
7
|
|
|
8
8
|
It is **not** a PDF renderer. Its job is to help Python code produce a typed, validated, protocol-aligned document payload that can be handed off to a downstream renderer.
|
|
9
9
|
它**不是** PDF 渲染器。它的职责是帮助 Python 代码以强类型、可校验、可维护的方式生成协议 JSON,再交给下游渲染器处理。
|
|
@@ -50,8 +50,8 @@ The package ends at **structured JSON generation + validation + debugging suppor
|
|
|
50
50
|
|
|
51
51
|
## 3. Current protocol scope implemented by the package / 当前包已实现的协议范围
|
|
52
52
|
|
|
53
|
-
This package
|
|
54
|
-
|
|
53
|
+
This package implements the authoring and validation contracts through Report Profile v1.6; new documents default to v1.5 for compatibility.
|
|
54
|
+
当前包实现到 Report Profile v1.6 的构建与校验合同;为保持兼容,新文档默认 v1.5。以下为基础能力概览,新增能力见 v1.6 使用指南。
|
|
55
55
|
|
|
56
56
|
Currently implemented / 当前已实现:
|
|
57
57
|
|
|
@@ -407,11 +407,11 @@ twine check dist/*
|
|
|
407
407
|
|
|
408
408
|
### 11.3 Release note / 发布说明
|
|
409
409
|
|
|
410
|
-
The current package version is **0.
|
|
411
|
-
当前包版本为 **0.
|
|
410
|
+
The current package version is **0.7.0**.
|
|
411
|
+
当前包版本为 **0.7.0**。
|
|
412
412
|
|
|
413
|
-
This
|
|
414
|
-
|
|
413
|
+
This release supports the frozen Report Profile v1.6 protocol; renderer acceptance remains separate.
|
|
414
|
+
当前版本支持本仓库冻结的 Report Profile v1.6 协议;渲染器验收独立进行。
|
|
415
415
|
|
|
416
416
|
---
|
|
417
417
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Protocol Alignment / 协议对齐说明
|
|
2
2
|
|
|
3
|
+
Python 0.7.0 已实现 [v1.6 正式协议](protocol/v1.6.md)的 SDK 部分,见 [v1.6 指南](PYTHON_V16.md) 和 [冻结记录](protocol/v1.6-freeze.md)。新版本默认仍创建 v1.5;下列既有能力说明与 v1.5 相容。渲染器当前无法测试,渲染与编辑器验收另行记录。
|
|
4
|
+
|
|
3
5
|
This page describes OVAPortableText 0.6.0, aligned to Report Profile v1.5.
|
|
4
6
|
本文档说明 Python 包 0.6.0 的协议能力。新增图表、共享语义和 figure 的生成、读取与校验已实现;新建文档默认 report.v1.5,读取旧版本保留原版本。估值横幅见 [v1.5 使用指南](PYTHON_V15.md),其余图表见 [v1.4 指南](PYTHON_V14.md)。渲染端独立验收。
|
|
5
7
|
|