-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change project to hexagonal * Add params.yml * Add sorting * add yaml adapter * add compiler * modify CI to use compiler * Change base img for quicker start * Add section removal in case of pageOverflow * Change service to builder pattern * Add Sections name translation * Add threshold * Add log to md parser * Add info flag * Update Readme
- Loading branch information
1 parent
4014157
commit 12f75a7
Showing
33 changed files
with
1,978 additions
and
899 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 HAFSAOUI Theo | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
|
||
run: | ||
echo "Not yet complete" | ||
|
||
run-docker: | ||
sudo docker run -v $(realpath ./assets/latex/output):/app/assets/latex/output anemon:latest | ||
|
||
clean: | ||
sudo rm ./assets/latex/output/* | ||
|
||
build: | ||
go build | ||
|
||
lint: | ||
golangci-lint run ./... | ||
|
||
fmt: | ||
gofmt -s -w . | ||
|
||
tidy: | ||
go mod tidy | ||
|
||
test: | ||
go test ./... | ||
go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,139 +1,46 @@ | ||
This project is a simple tool written in Go that generates customized CVs from a directory of Markdown files. The CVs are generated based on a provided `output.yml` file, which specifies different skill sets or features (e.g., "foo" or "bar"). The generated CVs are output in LaTeX format and can be compiled locally or using GitHub Actions. | ||
![Anemon Project](https://github.com/user-attachments/assets/1399b964-5dfc-4dd5-b9ed-f333a3f768fe) | ||
|
||
## Project Overview | ||
--- | ||
|
||
Given a directory structure containing Markdown files for different sections of a CV (e.g., education, projects, work experience), this tool will: | ||
### Description | ||
|
||
1. Parse the directory structure and extract relevant sections for both English and French CVs. | ||
2. Use the provided `output.yml` configuration to determine which features or skills to prioritize in different versions of the CV. | ||
3. For each type (e.g., "foo", "bar") specified in `output.yml`, search the corresponding sections for matching lines. These lines will be moved higher in the CV and emphasized (e.g., through formatting) to draw attention to them. | ||
4. Generate CVs for each type specified in the `output.yml`. The number of CVs generated will depend on the number of types defined. For instance, if there are two types (e.g., "foo" and "bar"), four CVs will be generated (Foo in English, Foo in French, Bar in English, Bar in French). If there are more types, the number of CVs will increase accordingly. | ||
5. The generated CVs are first output in LaTeX format, which can then be compiled into a final PDF. | ||
![Preview Image](https://github.com/user-attachments/assets/845cbda0-89ee-4603-8374-0414a9c50a4a) | ||
|
||
## Example `output.yml` | ||
### Getting Started | ||
#### GitHub (Recommended) | ||
To create your CV: | ||
1. **Fork** this repository. | ||
2. Update the `params.yaml` file with your information. | ||
3. Once updated, the CI/CD pipeline will compile the CVs and publish them as artifacts on GitHub. | ||
- Navigate to the **Actions** tab (next to the Pull Requests tab). | ||
- Select the **Compile LaTeX Document** workflow. | ||
- Inside the workflow, click on the job corresponding to your desired CV and download the `compiled-pdf.zip` file from the artifacts section. | ||
|
||
Below is an example of an `output.yml` configuration file: | ||
![Action Tab](https://github.com/user-attachments/assets/f15c7c71-022b-4bf2-b79d-2e5ef5f1e65e) | ||
|
||
```yaml | ||
info: | ||
name:aNemoN | ||
first_anem:NoName | ||
phone_number:+33.... | ||
ect.. | ||
foo: | ||
- FooFeature1 | ||
- FooFeature2 | ||
- FooFeature3 | ||
#### Local | ||
You can run Anemon locally using one of the following methods: | ||
|
||
bar: | ||
- BarFeature1 | ||
- BarFeature2 | ||
- BarFeature3 | ||
``` | ||
1. **Using Docker** | ||
Build the Docker image and run it using the provided `Makefile`. This setup creates a volume to simplify PDF extraction. | ||
|
||
This configuration file indicates that for each "foo" and "bar" type CV, the tool will search the relevant sections for "FooFeature1", "FooFeature2", "FooFeature3" (and similarly for "Bar"). Any line containing these features will be moved higher in the CV and emphasized (e.g., bolded or italicized) in the LaTeX output. The number of CVs generated depends on the number of types (e.g., "foo" and "bar") specified. | ||
```bash | ||
docker build -t anemon . | ||
make run-docker | ||
``` | ||
|
||
## Example Directory Structure | ||
2. **Running Natively** | ||
Alternatively, build and run Anemon natively using the `Makefile`: | ||
|
||
Here’s an example of a canonical directory structure for the CV content: | ||
```bash | ||
./anemon -g | ||
``` | ||
|
||
``` | ||
cv/ | ||
├── eng | ||
│ ├── education.md | ||
│ ├── project.md | ||
│ └── work.md | ||
└── fr | ||
├── education.md | ||
├── project.md | ||
└── work.md | ||
``` | ||
This approach requires a local installation of LaTeX and its necessary packages. Refer to the `Dockerfile` for the list of required dependencies and install their equivalents for your system. | ||
|
||
The structure includes separate directories for English (`eng`) and French (`fr`) versions of the CV. Each directory contains Markdown files for different sections of the CV, such as `education.md`, `project.md`, and `work.md`. | ||
### Personalization | ||
You may want to customize the templates to fit your needs. You’re free to modify or create new templates, but ensure the `%something%` placeholders remain intact, as these serve as anchors for Anemon. | ||
|
||
## Workflow | ||
|
||
### Conceptual Flow | ||
|
||
The following sequence diagram outlines the process flow of the tool: | ||
|
||
```mermaid | ||
sequenceDiagram | ||
CV->>+DirectoryReader: Ask to read the output.yml | ||
DirectoryReader-->>-CV: Return the Output | ||
CV->>+DirectoryReader: Ask to read the CV directory tree | ||
DirectoryReader-->>-CV: Return the Sections | ||
CV->>CV: Search for features and prioritize them | ||
CV->>CV: Create the LaTeX CV variants | ||
CV -->>System: Launch the compilation of the CVs | ||
``` | ||
|
||
### Class Design | ||
|
||
The following class diagram illustrates the key components of the system: | ||
|
||
```mermaid | ||
classDiagram | ||
direction RL | ||
CV -- ProjectSection | ||
CV -- SkillsSection | ||
CV -- EducationSection | ||
CV -- DirectoryReader | ||
CV -- Output | ||
CV -- ProfessionalSection | ||
class CV{ | ||
Section sections | ||
generateLatexCV() | ||
compileLatexCV() | ||
} | ||
class Output{ | ||
map[string]string Target | ||
} | ||
class DirectoryReader{ | ||
Array<Section> getSections() | ||
Output getOutput() | ||
} | ||
namespace Section { | ||
class ProjectSection { | ||
String Title | ||
String Description | ||
String Skill | ||
String Link | ||
void SortFor(output) | ||
} | ||
class ProfessionalSection { | ||
String Title | ||
String Description | ||
String Skill | ||
String Link | ||
void SortFor(output) | ||
} | ||
class SkillsSection { | ||
Array<String> Skill | ||
void SortFor(output) | ||
} | ||
class EducationSection { | ||
String Title | ||
String Description | ||
String Link | ||
void SortFor(output) | ||
} | ||
} | ||
``` | ||
|
||
## How to Use | ||
|
||
1. **Clone the Repository**: Clone this repository to your local machine. | ||
2. **Prepare Your Directory**: Structure your directory with Markdown files as shown in the example above. | ||
3. **Create Your `output.yml`**: Define your CV variations and the features to prioritize in an `output.yml` file. | ||
4. **Run the Tool**: Execute the Golang program to generate LaTeX files, where specified features are prioritized and emphasized. | ||
5. **Compile the LaTeX Files**: Compile the generated LaTeX files to produce your final CV PDFs. This can be done locally or using GitHub Actions. | ||
### Contribute | ||
Anemon has room for improvement and expansion. Contributions to enhance functionality or fix issues are welcome. Many parts of the project are currently implemented with workaround solutions that could be improved. | ||
Feel free to propose changes that add value to the project! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.