Skip to content

Commit

Permalink
p3x-robot sunday release 2017-7-1 13:16:48
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Jul 1, 2017
1 parent 8763409 commit fc37887
Show file tree
Hide file tree
Showing 23 changed files with 741 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
.idea/workspace.xml
.idea/tasks.xml

/release
9 changes: 9 additions & 0 deletions .idea/html-pdf.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
*.log
/corifeus-boot.json

/release
5 changes: 3 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ filter:
- docs/*

build:
environment:
node: 8.1.0

dependencies:
before:
- export LATEST=$(nvm ls-remote | tail -1)
- nvm install $LATEST
# - nvm use $LATEST
- npm install -g grunt-cli

tests:
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

[![NPM](https://nodei.co/npm/p3x-html-pdf.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/p3x-html-pdf/)
---


# Generates PDF from HTML with custom headers and footers with wkhtmltopdf

Expand All @@ -17,7 +18,7 @@ This is an open source project. Just code.

### Built on Node
```
v8.1.2
v8.1.3
```

The ```async``` and ```await``` keywords are required.
Expand All @@ -36,18 +37,19 @@ Generates PDF from HTML with custom headers and footers with wkhtmltopdf
# First version
Since, the basic installation, we need scripts to startup the library:
```bash
sudo apt install wkhtmltopdf
yarn install p3x-html-pdf
```



Soon, it will work with Windows and OSX as well.

[//]: #@corifeus-footer

---
[**P3X-HTML-PDF**](https://pages.corifeus.tk/html-pdf) Build v1.0.4-3

[Corifeus](http://www.corifeus.tk) by [Patrik Laszlo](http://patrikx3.tk)
[**P3X-HTML-PDF**](https://pages.corifeus.tk/html-pdf) Build v1.0.33-38

[Corifeus](http://www.corifeus.tk) by [Patrik Laszlo](http://patrikx3.tk)

[//]: #@corifeus-footer:end
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "p3x-html-pdf",
"version": "1.0.4-3",
"version": "1.0.33-38",
"corifeus": {
"prefix": "p3x-",
"publish": true,
"type": "p3x",
"code": "Direct"
"code": "WwkHtmlTox"
},
"license": "MIT",
"description": "Generates PDF from HTML with custom headers and footers with wkhtmltopdf",
Expand All @@ -14,27 +14,34 @@
"test": "test"
},
"scripts": {
"test": "grunt"
"test": "grunt",
"install": "node src/package/install.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/patrikx3/html-pdf.git"
},
"keywords": [
"freenom",
"promise",
"api"
"html",
"pdf",
"async",
"header",
"custom",
"footer"
],
"author": "Patrik Laszlo <alabard@gmail.com>",
"bugs": {
"url": "https://github.com/patrikx3/html-pdf/issues"
},
"homepage": "https://pages.corifeus.tk/html-pdf",
"devDependencies": {
"corifeus-builder": "^1.7.669-24"
"corifeus-builder": "^1.7.685-33"
},
"dependencies": {
"corifeus-utils": "^1.1.338-32"
"cheerio": "^1.0.0-rc.1",
"corifeus-utils": "^1.1.346-40",
"fs-extra": "^3.0.1",
"progress": "^2.0.0"
},
"engines": {
"node": ">=7.8.0"
Expand Down
16 changes: 16 additions & 0 deletions src/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<base href="${base}">
<link rel="stylesheet" href="${css}">
<style type="text/css">
.ngivr-template-page-break {
height: 0px;
border-top-style: none;
}
</style>
</head>
<body>
${settings.html}
</body>
</html>
46 changes: 46 additions & 0 deletions src/header-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<base href="${base}">
<link rel="stylesheet" href="${css}">
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
var items = ${settings.html};

// qr-hack //

var vars = {};
var query_strings_from_url = document.location.search.substring(1).split('&');
for (var query_string in query_strings_from_url) {
if (query_strings_from_url.hasOwnProperty(query_string)) {
var temp_var = query_strings_from_url[query_string].split('=', 2);
vars[temp_var[0]] = decodeURI(temp_var[1]);
}
}
var varNames = ['page', 'frompage', 'topage', 'webpage', 'section', 'subsection', 'date', 'isodate', 'time', 'title', 'doctitle', 'sitepage', 'sitepages'];
vars.pages = vars.topage

// headerOrFooter 1 = header, 2 == footer
// headerOrFooter //
var baseSelector = 'p3x-' + (headerOrFooter == 1 ? 'header' : 'footer');

$(document).ready(function () {

var itemName = baseSelector + '-' + vars.page;
var item = '';
if (items.hasOwnProperty(itemName)) {
item = items[itemName]
} else {
item = items[baseSelector];
};
// lodash-template-hack //
var $item = $(item);
var $body = $('body');
$body.append($item );
});
</script>
</head>
<body>

</body>
</html>
Loading

0 comments on commit fc37887

Please sign in to comment.