Skip to content

Commit

Permalink
chore: cleanup files, js import/export
Browse files Browse the repository at this point in the history
  • Loading branch information
jraleman committed May 10, 2024
1 parent 436489b commit e7a4b26
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 150 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@
Started as a fork from [Elipapa's markdown-cv](https://github.com/elipapa/markdown-cv/).
This is a curriculum vitae maintained in markdown and rendered to HTML and PDF using CSS.

For more details, take a look at [the instructions](instructions.md),
or [go here](http://elipapa.github.io/markdown-cv/).
## Usage

### Build it locally and print a PDF

1. To [install jekyll](https://jekyllrb.com/docs/installation/), run `gem install bundler jekyll` from the command line.
3. [Clone](https://help.github.com/en/articles/cloning-a-repository) your fork of markdown-cv to your local machine.
3. Type `jekyll serve` to render your CV at http://localhost:4000.
4. You can edit the `index.md` file and see the changes live in your browser.
5. Now print the page, and save it as PDF.

### Styling

To change the default style, simply change the variable in the
`_config.yml` file.

## Demo

Expand Down
4 changes: 2 additions & 2 deletions _layouts/cv.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
<pre id="raw"></pre>
</div>
</body>
<script type="text/javascript" src="media/js/handle-keys.js"></script>
<script type="text/javascript" src="media/js/handle-print.js"></script>
<script type="module" src="media/js/handle-keys.js"></script>
<script type="module" src="media/js/handle-print.js"></script>
</html>
27 changes: 0 additions & 27 deletions generate-resume.sh

This file was deleted.

4 changes: 2 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ _Contractor - (Remote) Palo Alto, California (3 months)_
> - Technical Leadership and Guidance: Provide technical leadership and guidance to other team members, helping to resolve complex problems and promoting a culture of innovation and continuous improvement.
### Founder | Enterprise Architect and A.I. Engineer {#raisga_2023}
### Founder | A.I. Engineer {#raisga_2023}

![raisga](media/images/raisga.png)
[__Raisga__](https://www.raisga.com/){:target="_blank"}
`May 2023 - Present`
_Self-Employed - Atlanta, Georgia (1 year)_
_Business Owner - Atlanta, Georgia (1 year)_

> - Coming up with innovative business ideas and validating their potential through research and testing.
Expand Down
55 changes: 0 additions & 55 deletions instructions.md

This file was deleted.

23 changes: 20 additions & 3 deletions media/js/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
const CV_COMPLETE = {
export const CHEAT_CODE = [
// konami code
'ArrowUp',
'ArrowUp',
'ArrowDown',
'ArrowDown',
'ArrowLeft',
'ArrowRight',
'ArrowLeft',
'ArrowRight',
'b',
'a'
];

export const URL = 'https://raw.githubusercontent.com/jraleman/cv/master/index.md';
export const HOME_URL = 'https://jraleman.com';

export const CV_COMPLETE = {
titleSectionsIds: [
'experience',
'education',
Expand Down Expand Up @@ -26,7 +43,7 @@ const CV_COMPLETE = {
]
};

const FRONTEND_resume = {
export const FRONTEND_CV = {
titleSectionsIds: [
'experience',
'education',
Expand All @@ -41,4 +58,4 @@ const FRONTEND_resume = {
skillsIds: [
'skills_tech',
]
}
}
43 changes: 6 additions & 37 deletions media/js/handle-keys.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,18 @@
var code = [
// konami code
'ArrowUp',
'ArrowUp',
'ArrowDown',
'ArrowDown',
'ArrowLeft',
'ArrowRight',
'ArrowLeft',
'ArrowRight',
'b',
'a'
];
var count = 0;
var url = 'https://raw.githubusercontent.com/jraleman/cv/master/index.md';
var homeUrl = 'https://jraleman.com';
import { triggerAction } from "./utils.js";
import { URL, HOME_URL, CHEAT_CODE } from './constants.js'

function renderRaw(raw) {
var homePage = document.createElement('a');
homePage.setAttribute('href', homeUrl);
homePage.innerText = '<< Return to home page\n\n';
var content = document.getElementById('content');
content.style.display = 'none';
var rawContent = document.getElementById("raw");
rawContent.innerHTML += raw;
rawContent.insertBefore(homePage, rawContent.childNodes[0])
}
let count = 0;
const code = CHEAT_CODE;

function triggerAction() {
fetch(url).then(function(res) {
res.text().then(function(raw) {
renderRaw(raw);
window.scrollTo(0, 0);
});
});
}

var keyHandler = function(e) {
const keyHandler = function(e) {
if (code.indexOf(e.key) < 0 || e.key !== code[count]) {
count = 0;
return;
}
count += 1;
if (code.length === count) {
count = 0;
triggerAction();
triggerAction(URL, HOME_URL);
}
};

Expand Down
23 changes: 1 addition & 22 deletions media/js/handle-print.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
function nextElement(e) {
do {
e = e.nextSibling;
} while (e && e.nodeType !== 1);
return e;
}

function hideSection(id, delim) {
var element = document.getElementById(id);
element.style.display = 'none';
while (true) {
var e = nextElement(element);
if (!e || !e.nodeName || e.nodeName === delim) {
if (e && e.nodeName === delim) {
e.style.display = 'none';
}
break;
}
e.style.display = 'none';
element = e;
}
}
import { hideSection } from './utils.js';

var handlePrint = function (e) {
window.alert('Remember to change email and phone values! :)')
Expand Down
42 changes: 42 additions & 0 deletions media/js/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export function nextElement(e) {
do {
e = e.nextSibling;
} while (e && e.nodeType !== 1);
return e;
}

export function hideSection(id, delim) {
let element = document.getElementById(id);
element.style.display = "none";
while (true) {
const e = nextElement(element);
if (!e || !e.nodeName || e.nodeName === delim) {
if (e && e.nodeName === delim) {
e.style.display = "none";
}
break;
}
e.style.display = "none";
element = e;
}
}

export function renderRaw(raw, homeUrl) {
const homePage = document.createElement('a');
homePage.setAttribute('href', homeUrl);
homePage.innerText = '<< Return to home page\n\n';
const content = document.getElementById('content');
content.style.display = 'none';
const rawContent = document.getElementById("raw");
rawContent.innerHTML += raw;
rawContent.insertBefore(homePage, rawContent.childNodes[0])
}

export function triggerAction(url, homeUrl) {
fetch(url).then(function(res) {
res.text().then(function(raw) {
renderRaw(raw, homeUrl);
window.scrollTo(0, 0);
});
});
}

0 comments on commit e7a4b26

Please sign in to comment.