initial commit
This commit is contained in:
commit
a61bb35644
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules
|
39
cv.tsx
Normal file
39
cv.tsx
Normal file
@ -0,0 +1,39 @@
|
||||
import React from 'react';
|
||||
import { Page, Text, View, Document, StyleSheet } from '@react-pdf/renderer';
|
||||
import ReactPDF from '@react-pdf/renderer';
|
||||
import fs from "fs"
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
page: {
|
||||
flexDirection: 'row',
|
||||
backgroundColor: '#E4E4E4'
|
||||
},
|
||||
section: {
|
||||
margin: 10,
|
||||
padding: 10,
|
||||
flexGrow: 1
|
||||
}
|
||||
});
|
||||
|
||||
const MyDocument = () => (
|
||||
<Document>
|
||||
<Page size="A4" style={styles.page}>
|
||||
<View style={styles.section}>
|
||||
<Text>Section #1</Text>
|
||||
</View>
|
||||
<View style={styles.section}>
|
||||
<Text>Section #2</Text>
|
||||
</View>
|
||||
</Page>
|
||||
</Document>
|
||||
);
|
||||
|
||||
const outDir = process.env.out || "./"
|
||||
const pname = process.env.pname || "cv"
|
||||
|
||||
if (!fs.existsSync(outDir)) {
|
||||
fs.mkdirSync(outDir, { recursive: true })
|
||||
}
|
||||
|
||||
ReactPDF.render(<MyDocument />, `${outDir}/${pname}.pdf`);
|
||||
|
63
flake.lock
Normal file
63
flake.lock
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": [
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1699806023,
|
||||
"narHash": "sha256-RqoU2yh61nzsfbtgjZwIrCMPwyxkUR7Eze+4hjEM6TY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "54da2986be07ad2ffbade0b3cefaf7f0c2553c88",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1680978846,
|
||||
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "x86_64-linux",
|
||||
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "x86_64-linux",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
38
flake.nix
Normal file
38
flake.nix
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
description = "CV template";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
systems.url = "github:nix-systems/x86_64-linux";
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.systems.follows = "systems";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, systems }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pname = "cv";
|
||||
version = "0.0.1";
|
||||
src = ./.;
|
||||
buildInputs = with pkgs; [
|
||||
];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nodejs_20
|
||||
bun
|
||||
];
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
inherit pname buildInputs nativeBuildInputs;
|
||||
};
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
inherit buildInputs nativeBuildInputs pname version src;
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
13
makefile
Normal file
13
makefile
Normal file
@ -0,0 +1,13 @@
|
||||
main = $(pname).tsx
|
||||
|
||||
default: all
|
||||
all:
|
||||
-bun $(main)
|
||||
|
||||
clean:
|
||||
rm -f $(pname)
|
||||
|
||||
install: $(pname)
|
||||
mkdir -p $(out)/bin
|
||||
install $(pname).pdf $(out)/bin/$(pname)
|
||||
|
1
package.json
Normal file
1
package.json
Normal file
@ -0,0 +1 @@
|
||||
{ "dependencies": { "@react-pdf/renderer": "^3.1.14", "@types/node": "^20.9.0", "@types/react": "^18.2.37", "react": "^18.2.0" } }
|
Loading…
Reference in New Issue
Block a user