Skip to content

Commit

Permalink
Merge branch 'master' of github.com:resumic/schema
Browse files Browse the repository at this point in the history
  • Loading branch information
stp-ip committed Sep 6, 2019
2 parents e80d0a2 + a810c87 commit 3b688a6
Show file tree
Hide file tree
Showing 26 changed files with 862 additions and 2,488 deletions.
220 changes: 220 additions & 0 deletions .examples/hello.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"core": {
"title": "Software Engineer",
"workArea": "Munich Citycenter + 20kms",
"livingArea": "Germany",
"optionalKey": "foo"
},
"optionalData": {
"one": "two",
"foo": "bar"
},
"optionalData1": {
"one": "two",
"foo": "bar"
},
"optionalData2": {
"one": "two",
"foo": "bar"
},
"personal": {
"name": "John Doe",
"gender": "male",
"image": "example.com/Abcxyz",
"email": "lucas@example.com",
"phone": "912-217-7923",
"url": "http://www.example.com/",
"summary": "The man who sold the world!",
"currentLocation": {
"lat": 35.712758,
"long": 51.392114
},
"permanentLocation": {
"lat": 35.712758,
"long": 51.392114
},
"birthday": "1995-02-14",
"birthPlace": "Munich",
"profiles": [
{
"network": "github",
"username": "john_doe",
"url": "https://github.com/john_doe"
}
],
"relationshipStatus": "married",
"postalAddress": "John Doe, Wittekindshof, Schulstrasse 4, 32547 Bad Oyenhausen, Germany"
},
"work": [
{
"name": "XYZ Inc",
"description": "A social media company",
"position": "Software Engineer",
"location": {
"lat": 35.712758,
"long": 51.392114
},
"url": "http://xyz.example.com",
"startDate": "2017-12-29",
"endDate": "2018-12-29",
"summary": "Developing and maintaining the company website using syna",
"highlights": [
"Worked with mobile team at Twitter to develop remote debugging tools for mobile browsers"
]
}
],
"education": [
{
"institution": "XYZ Institute of Technology",
"location": {
"lat": 35.712758,
"long": 51.392114
},
"area": "Engineering",
"studyType": "Bachelor",
"startDate": "2017-06-28",
"endDate": "2013-06-28",
"score": {
"type": "GPA",
"value": "3.4",
"best": "4",
"worst": "0"
},
"courses": ["CS302 - Introduction to Algorithms"],
"honors": ["Magna Cum Laude"],
"highlights": ["Live abroad within a new culture"]
}
],
"volunteer": [
{
"organization": "Xyz",
"position": "Open Source Contributor",
"location": {
"lat": 35.712758,
"long": 51.392114
},
"url": "http://xyz.example.com",
"startDate": "2014-06-29",
"endDate": "2017-06-29",
"summary": "Frontend developer",
"highlights": ["Invited as a speaker in Xyzcon'17"]
}
],
"publications": [
{
"name": "Deep learning and Artificial Intelligence",
"publisher": "XYZ, Computer Magazine",
"releaseDate": "2015-08-01",
"resources": [
{
"url": "http://www.example.com/my-example-slides/",
"label": "Slides"
}
],
"url": "http://www.computer.org.example.com/csdl/mags/co/2015/10/rx069-abs.html",
"summary": "Discussion of the advent of deep learning and artificial intelligence"
}
],
"legal": [
{
"name": "XYZ's patent on LZW compression, a fundamental part of the widely used GIF graphics format",
"legalType": "Patent, Trademark, Copyright",
"description": "Some legal document!",
"applicationDate": "2015-08-01",
"grantDate": "2016-09-01",
"endDate": "2020-09-03",
"resources": [
{
"url": "http://www.example.com/my-example-slides/",
"label": "Slides"
}
],
"idNumber": "JP2004369746A",
"currentAssignee": "John Doe",
"previousAssignee": "John Doe",
"author": "John Doe",
"coAuthors": "John Doe"
}
],
"skills": [
{
"name": "Web Development",
"proficiency": "advanced",
"keywords": ["HTML"]
}
],
"awards": [
{
"title": "Awarded Software Process Achievement Award",
"date": "2016-06-12",
"awarder": "IEEE",
"summary": "Received for my work in Deep learning and AI"
}
],
"projects": [
{
"name": "File Transfer application",
"location": {
"lat": 35.712758,
"long": 51.392114
},
"description": "Developed a client and server based application",
"highlights": ["used Java AWT and Swing for client side userinterface"],
"keywords": ["Java"],
"startDate": "2016-06-29",
"endDate": "2017-03-02",
"resources": [
{
"url": "http://www.example.com/my-example-slides/",
"label": "Slides"
}
],
"url": "http://www.example.org/csdl/mags/co/1996/10/rx069-abs.html",
"roles": ["Team Lead"],
"entity": "greenpeace",
"type": "volunteering"
}
],
"certificate": [
{
"code": "1Z0-062",
"name": "XYZ Certified Application Specialist (MCAS)",
"website": "http://www.example.org",
"verification": "http://www.example.org",
"grantDate": "2017-06-29",
"score": {
"type": "GPA",
"value": "3.4",
"best": "4",
"worst": "0"
},
"endDate": "2017-06-29",
"doesNotExpire": true
}
],
"references": [
{
"name": "Stephan Mark",
"company": "Xyz",
"position": "Senior Software Engineer",
"reference": "Joe blogs was a great employee, who turned up to work at least once a week. He exceeded my expectations when it came to doing nothing."
}
],
"languages": [
{
"language": "English",
"level": "fluent"
}
],
"interests": [
{
"name": "Machine Learning",
"keywords": ["Neural Networks"]
}
],
"meta": {
"version": "v1.0.0",
"lastModified": "2017-06-29T15:53:01+01:00",
"uuid": "078c39ce-23ee-4970-9637-c07379132dce"
}
}
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ Standardized and generic data schema for your resume/CV
# Resumic
Easily share your machine readable data or export your resume/CV to a great looking website or PDF.

## Using Resumic
Take a look at our full [documentation](/docs).

## Support
For detailed information on support options see our [support guide](/SUPPORT.md).

Expand Down
16 changes: 10 additions & 6 deletions cmd/generate_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import (
"github.com/spf13/cobra"
)

// Flag to specify output. Default value is "resume_example.json"
var outputFileName string

func generateExampleRun(cmd *cobra.Command, args []string) error {
examplePath := args[0]
example, err := schema.GenerateExample()
if err != nil {
return fmt.Errorf("Couldn't generate the example: %s", err)
Expand All @@ -19,21 +21,23 @@ func generateExampleRun(cmd *cobra.Command, args []string) error {
if err != nil {
return fmt.Errorf("Couldn't marshal the example to json: %s", err)
}
err = ioutil.WriteFile(examplePath, exampleJSON, 0600)
err = ioutil.WriteFile(outputFileName, exampleJSON, 0600)

if err != nil {
return fmt.Errorf("Couldn't write the example to %s: %s", examplePath, err)
return fmt.Errorf("Couldn't write the example to %s: %s", outputFileName, err)
}
fmt.Printf("Example file created successfully at %s\n", examplePath)
fmt.Printf("Example file created successfully at %s\n", outputFileName)
return nil
}

var generateExampleCmd = &cobra.Command{
Use: "example PATH",
Use: "example",
Short: "Generate an example json resume",
Args: cobra.ExactArgs(1),
Args: cobra.MaximumNArgs(1),
RunE: generateExampleRun,
}

func init() {
generateExampleCmd.Flags().StringVarP(&outputFileName, "output", "o", "resume_example.json", "Specify a custom output file for example resume data.")
generateCmd.AddCommand(generateExampleCmd)
}
2 changes: 1 addition & 1 deletion cmd/generate_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestGenerateExampleRunValid(t *testing.T) {
if err != nil {
t.Fatalf("Could not generate temp file: %s", err)
}
err = Execute([]string{"generate", "example", tempFile.Name()})
err = Execute([]string{"generate", "example", "-o", tempFile.Name()})
if err != nil {
t.Fatalf("Could not generate example, %s", err)
}
Expand Down
8 changes: 5 additions & 3 deletions cmd/generate_jsonschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
"go.resumic.org/schema/schema"
)

var schemaPath string

func generateJSONSchemaRun(cmd *cobra.Command, args []string) error {
schemaPath := args[0]
schema, err := schema.GenerateJSONSchema()
if err != nil {
return fmt.Errorf("Couldn't generate JSON schema: %s", err)
Expand All @@ -23,12 +24,13 @@ func generateJSONSchemaRun(cmd *cobra.Command, args []string) error {
}

var generateJSONSchemaCmd = &cobra.Command{
Use: "jsonschema PATH",
Use: "jsonschema",
Short: "Generate the jsonschema for the resumic schema",
Args: cobra.ExactArgs(1),
Args: cobra.MaximumNArgs(1),
RunE: generateJSONSchemaRun,
}

func init() {
generateJSONSchemaCmd.Flags().StringVarP(&schemaPath, "output", "o", "resume.json", "Specify an output file for the resume data")
generateCmd.AddCommand(generateJSONSchemaCmd)
}
2 changes: 1 addition & 1 deletion cmd/generate_jsonschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestGenerateJSONSchemaRunValid(t *testing.T) {
if err != nil {
t.Fatalf("Could not generate temp file: %s", err)
}
err = Execute([]string{"generate", "jsonschema", tempFile.Name()})
err = Execute([]string{"generate", "jsonschema", "-o", tempFile.Name()})
if err != nil {
t.Fatalf("Could not generate schema, %s", err)
}
Expand Down
14 changes: 8 additions & 6 deletions cmd/generate_uischema.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@ import (
"go.resumic.org/schema/schema"
)

var uiSchemaPath string

func generateUISchemaRun(cmd *cobra.Command, args []string) error {
schemaPath := args[0]
schema, err := schema.GenerateUISchema()
if err != nil {
return fmt.Errorf("Couldn't generate UI schema: %s", err)
}
err = ioutil.WriteFile(schemaPath, schema, 0600)
err = ioutil.WriteFile(uiSchemaPath, schema, 0600)
if err != nil {
return fmt.Errorf("Couldn't write the schema to %s: %s", schemaPath, err)
return fmt.Errorf("Couldn't write the schema to %s: %s", uiSchemaPath, err)
}
fmt.Printf("UI schema file created successfully at %s\n", schemaPath)
fmt.Printf("UI schema file created successfully at %s\n", uiSchemaPath)
return nil
}

var generateUISchemaCmd = &cobra.Command{
Use: "uischema PATH",
Use: "uischema",
Short: "Generate the uischema for the resumic schema",
Args: cobra.ExactArgs(1),
Args: cobra.MaximumNArgs(1),
RunE: generateUISchemaRun,
}

func init() {
generateUISchemaCmd.Flags().StringVarP(&uiSchemaPath, "output", "o", "resume.json", "Specify an output file for the resume data")
generateCmd.AddCommand(generateUISchemaCmd)
}
2 changes: 1 addition & 1 deletion cmd/generate_uischema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestGenerateUISchemaRunValid(t *testing.T) {
if err != nil {
t.Fatalf("Could not generate temp file: %s", err)
}
err = Execute([]string{"generate", "uischema", tempFile.Name()})
err = Execute([]string{"generate", "uischema", "-o", tempFile.Name()})
if err != nil {
t.Fatalf("Could not generate schema, %s", err)
}
Expand Down
Loading

0 comments on commit 3b688a6

Please sign in to comment.