rendercv2yamlresume
使用 rendercv2yamlresume 將現有的 RenderCV YAML 檔案轉換為 YAMLResume 格式,包括章節、欄位與詞彙的對應。
rendercv2yamlresume 是一個用於將 RenderCV YAML 檔案轉換為 YAMLResume 格式的命令列工具。
RenderCV 與 YAMLResume 共享相同的理念——履歷就是一個文字檔案——但兩者對資料的建模方式不同。RenderCV 允許每個章節標題是任意字串,並為每個章節推斷一種條目類型;
YAMLResume 則有固定的章節鍵、穩定的欄位名稱,以及針對 degree 這類值的受控詞彙。此工具負責在兩者之間搭起橋樑。
功能
- 章節對應:
experience→work、selected_honors→awards,以及 RenderCV 自帶範例使用的其他名稱 - 欄位對應:
company/position→name/position、journal→publisher、label/details→ 技能的name/keywords等 - 詞彙對應:自由格式的學位(
PhD、BS、M.Sc.)與社群網路(X、StackOverflow)會對應到 YAMLResume 的固定清單 - 日期處理:
start_date/end_date區間會變成startDate/endDate,單一的date會成為區間的起點,而present會被移除,因為空的endDate本來就會顯示為「Present」 - 盡力而為的轉換並附報告:任何 YAMLResume 無法表達的內容都會被列出,而不是默默捨棄
- 驗證:結果在寫入前會先依據 YAMLResume 自身的架構檢查
安裝
npm install -g rendercv2yamlresumepnpm add -g rendercv2yamlresumeyarn global add rendercv2yamlresumebun add -g rendercv2yamlresume使用方法
# Convert and write alongside the input file
rendercv2yamlresume John_Doe_CV.yaml
# Or choose the output path
rendercv2yamlresume John_Doe_CV.yaml resume.yml
# Write even if the result does not validate
rendercv2yamlresume John_Doe_CV.yaml --force省略 output-file 時,結果會以 .yml 副檔名寫在輸入檔案旁邊,因此
John_Doe_CV.yaml 會變成 John_Doe_CV.yml。若輸入檔案本身就以 .yml 結尾,推導出的路徑會與輸入相同,此時請明確指定輸出路徑,或使用 --force 覆寫輸入檔案。
成功時指令會以 0 結束;當輸入無法讀取、沒有 cv 區塊、使用不支援的區域設定、產生的履歷未通過驗證,或在沒有 --force 的情況下會覆寫輸入檔時,則以 1 結束。
--force 允許產生無效輸出以及輸入與輸出路徑相同,但不允許不支援的區域設定。
| 代碼 | 含義 |
|---|---|
0 | 已轉換並寫入(可能附有回報的問題) |
1 | 輸入不存在、無法解析、沒有 cv 區塊、使用不支援的區域設定、驗證失敗,或在沒有 --force 的情況下會覆寫輸入檔 |
範例
輸入:
cv:
name: John Doe
headline: Backend Engineer
email: [email protected]
location: San Francisco, CA
social_networks:
- network: LinkedIn
username: rendercv
sections:
education:
- institution: Princeton University
area: Computer Science
degree: PhD
start_date: 2018-09
end_date: 2023-05
experience:
- company: Nexus AI
position: Co-Founder & CTO
start_date: 2023-06
end_date: present
highlights:
- Built foundation model infrastructure serving 2M+ monthly API requests
selected_honors:
- bullet: Forbes 30 Under 30 in Enterprise Technology (2024)輸出:
---
content:
basics:
name: John Doe
headline: Backend Engineer
email: [email protected]
location:
city: San Francisco
region: CA
profiles:
- network: LinkedIn
username: rendercv
education:
- institution: Princeton University
area: Computer Science
degree: Doctor
startDate: 2018-09
endDate: 2023-05
work:
- name: Nexus AI
position: Co-Founder & CTO
startDate: 2023-06
summary: '- Built foundation model infrastructure serving 2M+ monthly API requests'
awards:
- title: Forbes 30 Under 30 in Enterprise Technology
awarder: Unknown
date: '2024'轉換規則
章節
RenderCV 的章節標題是任意的。符合已知別名的標題會被對應;其他則會被捨棄並回報。底線、重複的空格與全形 Unicode 字元都會被正規化,因此 selected_honors 與
Selected Honors 都能運作。除了下方列出的英文別名之外,YAMLResume 所支援的每一種區域設定中的標準章節標題也會被自動辨識。
| RenderCV 標題 | YAMLResume 鍵 |
|---|---|
education, education_and_training | education |
experience, work, employment, professional_experience, work_experience | work |
projects, personal_projects | projects |
publications | publications |
skills, technical_skills | skills |
languages | languages |
interests | interests |
awards, honors, selected_honors, honors_and_awards | awards |
certificates, certifications | certificates |
volunteer, volunteer_experience | volunteer |
references | references |
如果兩個標題對應到同一個鍵(例如 experience 與 work 皆是),它們的條目會被追加而非覆寫。
條目
| RenderCV 條目 | 行為 |
|---|---|
ExperienceEntry | → 工作或志工條目;company → name/organization,position 保留 |
EducationEntry | → 教育條目;學位會對應到固定清單 |
PublicationEntry | → 出版條目;title → name,journal → publisher |
NormalEntry | → 專案或證書條目;[Name](url) 形式的名稱會拆成 name + url |
OneLineEntry | → 依章節而定,成為技能、語言、興趣或推薦人條目 |
BulletEntry / 字串 | → 在獎項章節中成為獎項條目,否則會被回報 |
值
- 學位會忽略大小寫與標點進行對應:
PhD、Ph.D.、Doctorate→Doctor;BS、BSc、Bachelor of Science→Bachelor;MSc、M.S.、MBA→Master。 - 社群網路會與 YAMLResume 的清單比對:
X→Twitter、StackOverflow→Stack Overflow。沒有對應項的網路(ORCID、ResearchGate、Mastodon)會被捨棄並回報。 - 區域設定會將 RenderCV 的名稱(
english、mandarin_chinese)對應到 YAMLResume 的代碼(en、zh-hans)。如果 YAMLResume 不支援所要求的區域設定,轉換會帶著警告停止,且不會寫出任何輸出檔案。 - 語言與流利程度會忽略大小寫與 YAMLResume 的固定清單比對,並支援
Native、Fluent等別名。不支援的值會被捨棄並回報。 - 日期會原樣保留,唯一的例外是
present會被移除。 - 標題、電子郵件、電話與網站會被直接複製;如果 RenderCV 為電子郵件/電話/網站提供了清單,則使用第一個值,其餘的會被回報。
限制
這是一個遷移輔助工具,而非無損的來回轉換。兩種資料模型並不等價,有些資訊無法跨過這道邊界。任何內容都不會在沒有報告的情況下被捨棄,而每一次捨棄都會指出造成該問題的欄位。
完全無法表達——會連同報告一起捨棄:
- 任意章節。
patents、invited_talks、Things I Did——任何在 YAMLResume 中沒有對應項的章節。 - 逐元素樣式。 整個 RenderCV
design區塊:逐元素的顏色、字型、大小、間距、頁首對齊、照片位置、章節標題樣式,以及 Jinja2 模板覆寫。YAMLResume 在layouts[]下按引擎配置版面。 settings。pdf_title、current_date、bold_keywords與渲染指令選項描述的是一次渲染執行,而非履歷資料。- 個人照片。 YAMLResume 沒有照片欄位。
- 自訂頁首連結。
custom_connections及其 Font Awesome 圖示在 YAMLResume 的頁首中沒有位置。 - 條目地點。 YAMLResume 支援頁首地點,但教育、工作、專案或志工條目上沒有地點欄位。
- Typst 數學與指令。 文字欄位中的
$inline math$與#emph[...]會以字面文字保留,而不是排版後的輸出。
可以表達,但有需要您檢視的損失——每種情況都會回報:
OneLineEntry→ 技能時會遺失熟練等級。 YAMLResume 要求提供等級,因此轉換器會寫入level: Intermediate。請逐一調整每個技能條目。- 純項目符號 → 獎項時會憑空產生頒獎者。 轉換器會寫入
awarder: Unknown,並列出每個獎項,方便您自行填寫。 - 證書會憑空產生發證機構。 轉換後的證書使用
issuer: Unknown,並會被回報以供檢視。 NormalEntry→ 專案需要開始日期。 既沒有start_date也沒有date的條目會被捨棄並回報。- 重點會變成
summary內的 Markdown 項目符號。 RenderCV 將summary與highlights分開保存;YAMLResume 只有一個富文字欄位。 summary有最小長度限制。 合併後摘要短於 16 個字元的條目仍會被轉換,但會被回報,方便您擴充內容。- 出版的
publisher是推導而來。 轉換器依序使用journal、作者清單,最後才是Unknown。若有期刊可用,作者資訊會被捨棄。 - 單一的
date會變成startDate。 YAMLResume 沒有單一日期欄位,因此沒有區間日期的條目會以起點的形式呈現,而非浮動日期。 - 詞彙之外的自由格式學位會被捨棄。
Habilitation、Licentiate等學位在 YAMLResume 的七種學位中沒有對應項。請手動新增該條目,並使用已對應的學位,例如Doctor。 location在 RenderCV 中是單一字串。 轉換器會以逗號切分,當最後一段符合 YAMLResume 的清單時視為國家,否則視為區域。請確認結果是否正確。- 多個電子郵件/電話/網站值。 只會保留第一個值,被捨棄的值會被回報。
設計上不轉換:
- RenderCV 的
locale.phrases、month_names與month_abbreviations。 YAMLResume 為其支援的區域設定自帶翻譯;請改用它的locale區塊。
相關專案
- YAMLResume — 以 YAML 撰寫的履歷即程式碼
- RenderCV — 以 YAML 撰寫 CV,渲染 Typst PDF
- json2yamlresume — 將 JSON Resume 轉換為 YAMLResume
Last updated on