Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b28a440
init
t-lohse Dec 30, 2023
df3bdce
init CI
t-lohse Dec 30, 2023
f65e29f
mv directories
t-lohse Dec 30, 2023
e1c32a5
init CI
t-lohse Dec 30, 2023
5fd3b0e
upd ud
t-lohse Dec 30, 2023
d96e90f
upd ci
t-lohse Dec 30, 2023
1752bf6
upd ci
t-lohse Dec 30, 2023
efa5d9d
upd ci
t-lohse Dec 30, 2023
46594e2
upd ci
t-lohse Dec 30, 2023
f335cae
upd ci
t-lohse Dec 30, 2023
097e13c
upd ci
t-lohse Dec 30, 2023
afef452
upd ci
t-lohse Dec 30, 2023
cdba851
upd ci
t-lohse Dec 30, 2023
3059416
upd ci
t-lohse Dec 30, 2023
5006fcb
upd ci
t-lohse Dec 30, 2023
ad3430a
upd ci
t-lohse Dec 30, 2023
7b07437
upd ci
t-lohse Dec 30, 2023
bf5d931
upd ci
t-lohse Dec 30, 2023
777962b
upd ci
t-lohse Dec 30, 2023
7435afb
upd ci
t-lohse Dec 30, 2023
bb7c3b6
upd ci
t-lohse Dec 31, 2023
a8624c6
upd ci
t-lohse Dec 31, 2023
f483fa0
upd ci
t-lohse Dec 31, 2023
f2f391d
upd ci
t-lohse Dec 31, 2023
7d8ef91
upd ci
t-lohse Dec 31, 2023
ac8d287
upd ci
t-lohse Dec 31, 2023
8ec45a4
upd ci
t-lohse Dec 31, 2023
dd79b24
upd ci
t-lohse Dec 31, 2023
216ef32
upd ci
t-lohse Dec 31, 2023
628cc27
upd ci
t-lohse Dec 31, 2023
7f616e7
upd ci
t-lohse Dec 31, 2023
8486f7e
upd ci
t-lohse Dec 31, 2023
9092a5b
upd ci
t-lohse Dec 31, 2023
7db1f3c
upd ci
t-lohse Dec 31, 2023
919e372
upd ci
t-lohse Dec 31, 2023
04c3709
upd ci
t-lohse Dec 31, 2023
339f900
upd ci
t-lohse Dec 31, 2023
cbfcc51
upd ci
t-lohse Dec 31, 2023
1cf12f3
upd ci
t-lohse Dec 31, 2023
55a80a1
upd ci
t-lohse Dec 31, 2023
9cf9cfc
upd example
t-lohse Feb 29, 2024
1a92548
something
t-lohse Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Release"

on:
workflow_run:
workflows: ["Haskell CI"]
types: [completed]
branches: "main"

jobs:
#release:
on-success:
name: "Release"
runs-on: "ubuntu-latest"
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: ${{ github.event_name == 'pull_request' }}
title: "Development Build"
files: "*.pdf"

92 changes: 92 additions & 0 deletions .github/workflows/haskell_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Haskell CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

#permissions:
# contents: read


jobs:
build-and-test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
cabal: ["3.6"]
ghc: ["9.2.8"]
#ghc: ["9.2.8", "9.4.7", "9.6.3", "9.8.1"]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Install dependencies
run: |
cabal install
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all

format-and-lint:
strategy:
matrix:
cabal: ["3.6"]
ghc: ["9.2.8"]
#ghc: ["9.2.8", "9.4.7", "9.6.3", "9.8.1"]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Install dependencies
run: |
cabal install
cabal update
cabal install hlint hindent
- name: Fmt
run: |
hindent --validate **/*.hs
- name: Lint
run: |
hlint **/*.hs --cross -q

on-success:
name: "Release"

permissions: write-all
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Install dependencies
run: |
cabal install
cabal update
sudo apt install texlive-full
- name: Compile PDFs
run: cabal run reshume -- example/cv_en.tex example/conf.json
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: ${{ github.event_name == 'pull_request' }}
title: "Development Build"
files: |
*.pdf

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/*.out
build/*.log
build/*.aux
dist-newstyle
6 changes: 6 additions & 0 deletions .hindent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
indent-size: 4
line-length: 100
force-trailing-newline: true
sort-imports: true
line-breaks: []
extensions: []
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Revision history for reshume

## 0.1.0.0 -- YYYY-mm-dd

* First version. Released on an unsuspecting world.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2023 Thomas Lohse

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.
59 changes: 59 additions & 0 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module Main where

import Control.Applicative
import Data.List
import Reshume
import System.Directory
import System.Environment
import System.IO
import System.Process

testPhrase = "hejsa du er mega #!First1 og jeg synes du er #!Hvad"

main :: IO ()
main = do
args <- getArgs
(a, b) <- parseArgs args
let conf = parseJson b
print conf
Just (w, f) <- return $ findPhrase testPhrase "#!"
putStrLn w
putStrLn $ f "erstat"
Nothing <- return $ findPhrase "hejsa du er mega #! cringe" "##!"
print $ replaceKeys (lines testPhrase) "#!" conf
let pruned = unlines $ replaceKeys (lines a) "@!" conf
putStrLn "replaced file"
putStrLn pruned
withCreateProcess (proc "pdflatex" ["-interaction=nonstopmode"]) {std_in = CreatePipe} $ \(Just stdin) _ _ ph -- TODO: ARGS (output and others)
-> do
hPutStr stdin pruned
hFlush stdin
waitForProcess ph
putStrLn "done"

-- TODO: Prettify with CLI tool (args and such)
parseArgs :: [String] -> IO (String, String)
parseArgs [template, content] = do
--t <- getTemplates template
t <- getConfiguration template
e <- getConfiguration content
return (t, e)
parseArgs _ = error "Wrong amount of arguments, try again (stupid bitch)"

getConfiguration :: String -> IO String
getConfiguration path = readFile path <|> error ("Invalid file path: " ++ path)

getTemplates :: String -> IO [String]
getTemplates path =
do
files <- getDirectoryContents path
contents $ filter (not . isPrefixOf ".") files -- TODO: Directory not quite working
<|> pure <$> readFile path
<|> error ("Invalid file path: " ++ path)
where
contents (x:xs) = do
xs' <- contents xs
putStrLn x
x' <- readFile x
return (x' : xs')
contents [] = return []
Binary file removed build/cv_da.pdf
Binary file not shown.
Binary file removed build/cv_en.pdf
Binary file not shown.
File renamed without changes
38 changes: 38 additions & 0 deletions example/conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"InfoText": "I am a Software Engineering Master's student at Aalborg University (AAU) with a fervor for backend and system development. Since the age of 16, my journey in programming has been marked by a commitment to independent learning, particularly in the realms of software development theory. I specialize in backend development, with practical experience in firmware development and task automation using shell-scripts. Beyond this, my passion extends to exploring various programming languages and their intricacies. This blend of theoretical knowledge and hands-on skills positions me to excel in the intricate landscape of software engineering.",
"TechSec": "Technical Competencies",
"SkillMain": ["Software Development", "Git", "Project Development"],
"SkillMainTime": ["Since 2016", "Since 2017", "Since 2017"],
"KnownLangTitle": "Known Programming Languages:",
"KnownLangList": [
"Rust (Since 2021)",
"C\\# (Since 2016)",
"C (Since 2020)",
"Bash (Since 2020)",
"Haskell (Since 2023)"
],
"KnownToolTitle": "Known Tools:",
"KnownToolList": [
"GitHub (Since 2017)",
"Cargo (Since 2021)",
"Docker (Since 2021)",
".NET (Since 2017)",
"Unity (Since 2017)",
"QMK (Since 2020)"
],
"EduSec": "Education",
"EduStart1": ["2017"],
"EduEnd1": ["2020"],
"EduPlace1": ["High School"],
"EduDesc1": [
"High school attendee for three years at Aalborg Techcollege (AATG), and recieved the Higher Techincal Exam (HTX), with a specialised Study Area in \\textit{Communication \\& IT} A,\\textit{Programming} B, and tecnical study in \\textit{Technical Science} A."
],
"EduStart": ["2017", "2020", "2023"],
"EduEnd": ["2020", "2023", "Now"],
"EduPlace": ["High School", "University (Bachelor)", "University (Master)"],
"EduDesc": [
"High school attendee for three years at Aalborg Techcollege (AATG), and recieved the Higher Techincal Exam (HTX), with a specialised Study Area in \\textit{Communication \\& IT} A,\\textit{Programming} B, and tecnical study in \\textit{Technical Science} A.",
"Attendee at Aalborg University, studying Software, Bachelor. \\begin{itemize} \\item[] \\textbf{1st Semester --- } Developed a workscheduling system for the production teams at Siemens Gamesa (Developed in C). \\item[] \\textbf{2nd Semester --- } Implemented the Signal Protocol in an IoT environment (Developed in JavaScript). \\item[] \\textbf{3rd Semester --- } Developed a program for better handling of Siemens Gamesas turbine blades' location and production (Developed in C\\#).\\item[] \\textbf{4th Semester --- } Developed a programming language as a replacement to the shell scripting language Bash (Developed in C\\#). \\item[] \\textbf{5th Semester --- } A multiproject, where six groups collaborated on the same code base, written in Rust. \\item[] \\textbf{6th Semester (Bachelor project) --- } Developed a model learning tool to reverse engineer the codebase from PLCs in ladder programming (Written in Java and C\\#).\\end{itemize}",
"Attendee at Aalborg University, studying Software Engineer, Master. \\begin{itemize} \\item[] \\textbf{1st Semester (Current) --- } Engineered an online learning platform for introductionary programming, with multiple services and Docker Swarm deployment (Developed in TypeScript). \\end{itemize}"
]
}
26 changes: 26 additions & 0 deletions example/cv_da.aux
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\gdef \LT@i {\LT@entry
{1}{57.40015pt}\LT@entry
{1}{400.10751pt}}
\providecommand \oddpage@label [2]{}
\gdef \LT@ii {\LT@entry
{1}{66.76125pt}\LT@entry
{1}{390.74641pt}}
\gdef \LT@iii {\LT@entry
{1}{66.76125pt}\LT@entry
{1}{390.74641pt}}
\gdef \@abspage@last{3}
Loading