Skip to content

mihaelamj/cvbuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CVBuilder

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.


✨ Features

  • πŸ“„ 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 IgniteRenderer in CVBuilderIgnite)
  • πŸ§ͺ Unit-testable and reusable across platforms.

🧱 Package Structure

This package includes two main libraries:

1. CVBuilder (core)

Contains all model types and basic rendering:

CV
β”œβ”€β”€ ContactInfo
β”œβ”€β”€ Education
β”œβ”€β”€ WorkExperience
β”‚   β”œβ”€β”€ Company
β”‚   β”œβ”€β”€ Role
β”‚   └── ProjectExperience
β”‚       β”œβ”€β”€ Project
β”‚       └── Tech
└── Period

Renderers in CVBuilder:

  • MarkdownCVRenderer
  • StringCVRenderer

2. CVBuilderIgnite (optional)

Provides IgniteRenderer for HTML rendering, using the Ignite static site generator.

πŸ”₯ Note: This target depends on Ignite and is separated to avoid pulling in C dependencies in projects that don’t need HTML rendering.


πŸ“¦ Usage

Add to your Package.swift (using branch until Ignite is tagged):

.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 Ignite

πŸ›  How to Generate a Markdown CV

Currently, 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.


πŸ§ͺ Full Test Example

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)")
    }
}

πŸ“„ Sample Markdown Output

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 |

πŸ“„ License

MIT. See LICENSE file for details.


πŸ‘©β€πŸ’» Author

Built with ❀️ by Mihaela MihaljeviΔ‡

About

Generic CV builder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages