Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kryops committed May 1, 2021
0 parents commit f15d541
Show file tree
Hide file tree
Showing 68 changed files with 5,751 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
last 2 Chrome versions
last 2 ChromeAndroid versions
last 2 Edge versions
last 2 iOS versions
last 2 Firefox versions
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true
172 changes: 172 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@

# Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,visualstudiocode

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode

###

dist
.snowpack
build
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v15.7.0
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package.json
dist
/config
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"arrowParens": "avoid",
"parser": "babel-ts"
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"svelte.svelte-vscode"
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"typescript.preferences.quoteStyle": "single",
"typescript.tsdk": "node_modules/typescript/lib",
"search.exclude": {
"**/node_modules": true,
"dist": true,
"docs": true
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Michael Strobel

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.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pdfmake-html-renderer

WIP
21 changes: 21 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# TODO

## Rendering

* Paging?

## Features

* Static renderer (Svelte SSR)

## Build

* Rollup build + npm publishing
* GitHub Pages deployment
* GitHub Actions

## Docs

* Usage
* Integration in other frameworks
* Limitations
10 changes: 10 additions & 0 deletions demo/App.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<svelte:options accessors={true} />

<script type="ts">
import PdfmakeHtmlRenderer from '../src/PdfmakeHtmlRenderer.svelte'
import { testDocument } from './test-document'
let document = testDocument
</script>

<PdfmakeHtmlRenderer {document} />
3 changes: 3 additions & 0 deletions demo/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background: #ddd;
}
16 changes: 16 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="pdfmake-html-renderer" />
<link rel="stylesheet" type="text/css" href="./global.css" />
<title>pdfmake-html-renderer</title>
</head>

<body>
<script type="module" src="./index.js"></script>
</body>

</html>
14 changes: 14 additions & 0 deletions demo/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import App from './App.svelte'

let app = new App({
target: document.body,
})

export default app

if (import.meta.hot) {
import.meta.hot.accept()
import.meta.hot.dispose(() => {
app.$destroy()
})
}
33 changes: 33 additions & 0 deletions demo/snowpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const path = require('path');

/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
root: __dirname,
workspaceRoot: path.join(__dirname, '..'),
mount: {
/* ... */
},
plugins: ['@snowpack/plugin-svelte', '@snowpack/plugin-typescript'],
routes: [
/* Enable an SPA Fallback in development: */
// {"match": "routes", "src": ".*", "dest": "/index.html"},
],
optimize: {
bundle: true,
minify: true,
treeshake: true,
splitting: false,
sourcemap: true,
},
packageOptions: {
polyfillNode: true,
knownEntrypoints: ['svelte', 'svelte/store', 'qrcode', 'colornames', 'polished'],
},
devOptions: {
port: 8079,
},
buildOptions: {
baseUrl: './',
sourcemap: true,
},
}
Loading

0 comments on commit f15d541

Please sign in to comment.