幻跡百科:技術/資訊欄
出自幻跡百科
更多操作
本頁整理幻跡百科資訊欄的資料轉換與渲染架構。
資料流
Entity data
↓
Adapter
↓
Infobox Schema
↓
normalized model
↓
Infobox Renderer
↓
Capiunto
Adapter
領域 Adapter 負責取得資料並轉換成通用資訊欄模型。
目前:
Adapter 可以處理:
- 正式模板參數
- SMW subobject
- 領域資料轉換
- collection 建立
Infobox Schema
Presentation Schema 描述:
- title
- image
- section
- row
- collection
- order
- bodyClass
目前:
Provider
模組:Infobox/Provider/SMWDeferred 提供需要延後執行的 SMW query。
主要用途是讓頁面儲存後第一次解析時即可取得最新的 subobject 資料。
Renderer
模組:Infobox 接收 normalized model,依 order 排序後交由 Capiunto 渲染。
Renderer 保持領域中立,因此同一套核心可以服務不同類型的 Entity。
Collection
Collection 用於重複資料,例如:
- 平台帳號
- 自訂資訊
Collection 可以定義自己的:
- label
- key
- interaction
- collapse behavior
樣式
共通資訊欄樣式:
創作者專用樣式: