CVBuilder is a modular Swift package designed to represent and render CV (curriculum vitae) data in a structured, reusable way. It provides clean data models, rendering logic for Markdown and plain text, and optional support for HTML rendering using Ignite.
- π Strongly typed data model for CVs: education, experience, skills, contact info, etc.
- π§© Modular architecture: core types are renderer-agnostic.
- ποΈ Renderers for:
- Markdown (via
MarkdownCVRenderer) - Plain text (via
StringCVRenderer) - HTML with Ignite (via
IgniteRendererinCVBuilderIgnite)
- Markdown (via
- π§ͺ Unit-testable and reusable across platforms.
This package includes two main libraries:
Contains all model types and basic rendering:
CV
βββ ContactInfo
βββ Education
βββ WorkExperience
β βββ Company
β βββ Role
β βββ ProjectExperience
β βββ Project
β βββ Tech
βββ Period
Renderers in CVBuilder:
MarkdownCVRendererStringCVRenderer
Provides IgniteRenderer for HTML rendering, using the Ignite static site generator.
π₯ Note: This target depends on
Igniteand is separated to avoid pulling in C dependencies in projects that donβt need HTML rendering.
.package(url: "https://github.com/mihaelamj/cvbuilder.git", branch: "main")Then add the desired product:
.product(name: "CVBuilder", package: "cvbuilder"),
.product(name: "CVBuilderIgnite", package: "cvbuilder") // if using IgniteCurrently, the best way to generate a Markdown CV is through Swift code:
import CVBuilder
let cv = CV.createExampleCV()
let markdown = MarkdownCVRenderer(cv: cv).render()
print(markdown)Or use the utility method to save it:
if let markdownFile = CV.convertTMarkdownAndSave(cv) {
print("Markdown saved to: \(markdownFile)")
}βΉοΈ A command-line interface to generate and export Markdown or HTML versions of your CV is currently in progress.
extension CV {
static func createExampleCV() -> CV {
// Create contact info
let contactInfo = ContactInfo(
email: "[email protected]",
phone: "+1 (555) 123-4567",
linkedIn: URL(string: "https://linkedin.com/in/janedoe"),
github: URL(string: "https://github.com/janedoe"),
website: URL(string: "https://janedoe.dev"),
location: "San Francisco, CA"
)
// Create education
let education = Education(
institution: "Stanford University",
degree: "B.S.",
field: "Computer Science",
period: Period(
start: .init(month: 9, year: 2010),
end: .init(month: 6, year: 2014)
)
)
// Create companies
let appleCompany = Company(name: "Apple Inc.")
let googleCompany = Company(name: "Google")
// Create role types
let juniorIOS = Role(title: "iOS Developer", seniority: .junior)
let midAndroid = Role(title: "Android Developer", seniority: .mid)
let seniorIOS = Role(title: "iOS Developer", seniority: .senior)
let leadIOS = Role(title: "iOS Developer", seniority: .lead)
// Create tech types
let swift = Tech(name: "Swift", category: .language)
let swiftUI = Tech(name: "SwiftUI", category: .framework)
let kotlin = Tech(name: "Kotlin", category: .language)
let restAPI = Tech(name: "REST API", category: .concept)
// Create projects using the builder pattern
let project1 = try! Project.Builder()
.withName("iOS App Redesign")
.withCompany(appleCompany)
.withRole(seniorIOS)
.withPeriod(start: (month: 3, year: 2020), end: (month: 9, year: 2021))
.addDescription("Led a team of 5 developers for a complete redesign of a flagship iOS app")
.addDescription("Implemented SwiftUI components for improved user experience")
.addDescription("Reduced app size by 30% through code optimization")
.withTechs([swift, swiftUI])
.addURL(URL(string: "https://apps.apple.com/example")!)
.build()
let project2 = try! Project.Builder()
.withName("Android Integration Project")
.withCompany(googleCompany)
.withRole(midAndroid)
.withPeriod(start: (month: 6, year: 2018), end: (month: 2, year: 2020))
.addDescription("Developed APIs for cross-platform data sharing")
.addDescription("Implemented secure authentication protocols")
.withTechs([kotlin, restAPI])
.build()
// Create the CV
return CV.create(
name: "Jane Doe",
title: "Senior Mobile Developer",
summary: "Passionate mobile developer with 5+ years experience building apps for iOS and Android platforms. Expert in Swift, SwiftUI, and cross-platform development.",
contactInfo: contactInfo,
education: [education],
projects: [project1, project2]
)
}
}
@Test func testCreatingCV() async throws {
let cv = CV.createExampleCV()
print("Created")
#expect(cv.title == "Senior Mobile Developer")
let markdown = MarkdownCVRenderer(cv: cv).render()
print("Markdown Preview:")
print(markdown)
if let markdownFile = CV.convertTMarkdownAndSave(cv) {
print("Markdown saved to: \(markdownFile)")
}
}Below is a real CV generated using MarkdownCVRenderer:
# Jane Doe
## Senior Mobile Developer
Passionate mobile developer with 5+ years experience building apps for iOS and Android platforms. Expert in Swift, SwiftUI, and cross-platform development.
[email protected]
+1 (555) 123-4567
San Francisco, CA
[LinkedIn](https://linkedin.com/in/janedoe)
[GitHub](https://github.com/janedoe)
[Website](https://janedoe.dev)
Stanford University, B.S. in Computer Science
## EXPERIENCE
### Apple Inc. (Mar 2020 - Sep 2021) β Senior iOS Developer
#### iOS App Redesign
- Led a team of 5 developers for a complete redesign of a flagship iOS app
- Implemented SwiftUI components for improved user experience
- Reduced app size by 30% through code optimization
- [https://apps.apple.com/example](https://apps.apple.com/example)
- | Swift | SwiftUI |
### Google (Jun 2018 - Feb 2020) β Mid Android Developer
#### Android Integration Project
- Developed APIs for cross-platform data sharing
- Implemented secure authentication protocols
- | Kotlin | REST API |
### SKILLS
- | Kotlin | REST API | Swift | SwiftUI |
MIT. See LICENSE file for details.
Built with β€οΈ by Mihaela MihaljeviΔ