Commit 822e2b7e authored by julien's avatar julien
Browse files

Initial commit

parents
node_modules
dist
.vscode
\ No newline at end of file
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// open : {
// default : {
// path: 'http://localhost:9000/dist/index.html',
// }
// },
// CSS Build
postcss: {
options: {
map: {
inline: false,
annotation: 'dist/css/maps/'
},
processors: [
require('postcss-import')(),
// require('postcss-css-variables')(),
require('pixrem')(),
require('postcss-color-function')(),
require('postcss-nested')(),
require('postcss-merge-rules')(),
// require('autoprefixer-core')('last 1 version'),
require('postcss-discard-comments')({
removeAll: true
}),
// require('cssnano')()
]
},
dist: {
src: 'src/css/book.css',
dest: 'dist/css/book.css'
}
},
copy: {
main: {
expand: true,
cwd: 'src/js',
src: '**',
dest: 'dist/js/',
},
html: {
expand: true,
cwd: 'src/content',
src: '**/*.html',
dest: 'dist/',
},
img: {
expand: true,
cwd: 'src/images',
src: '**',
dest: 'dist/images/',
},
fonts: {
expand: true,
cwd: 'src/fonts',
src: '**',
dest: 'dist/fonts'
}
},
// Server Run
connect: {
server: {
options: {
port: 9000,
// base: 'www-root'
}
}
},
livereload: {
options: {
port: 9000,
// base: 'dist/index.html'
},
},
watch: {
css: {
files: 'src/css/**/*.css',
tasks: ['postcss'],
options: {
livereload: true
},
},
copy: {
files: 'src/**/*',
tasks: ['copy'],
options: {
livereload: true
},
},
}
});
//'serve',
grunt.registerTask('default', ['copy', 'postcss', 'connect', 'watch']);
};
\ No newline at end of file
# Bookstyler: a paged.js starter kit
The bookstyler starter-kit contains everything you need to make a book with paged.js
You can install and test it like this:
1. Install node.js if you haven't already.
1. create a folder and open a terminal inside it. Clone the repo there, using `git clone https://gitlab.pagedmedia.org/julientaq/bookstyler.git`
1. install grunt with `npm install -g grunt-cli`
1. run `npm install` inside the cloned folder
1. run `grunt` in the terminal and browse the `localhost:9000` in chrome or chromium.
## Prerequisites
Bookstyler use postcss plugins to handle nested css, import files, some colors functions, etc. If that's too complicated, you can use real css in a simple file, and not worry about postcs.
When you run `grunt`, it will look at the content of your src folder and copy everything in the images, fonts, js, and content folders while processing the css to transform it into a single file.
That's why you only need to add this link to the html:
`<link href="css/book.css" media="screen" rel="stylesheet" type="text/css">`
## Road map
- add styles and update the existing stylesheet
- add pug/jade/etc. support to handle multiple html preprocessor
Version 0.0.5
## Licence
The MIT licence (MIT)
Copyright 2018 — pagedmedia.org
This software is distributed under the MIT licence.
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.
\ No newline at end of file
This diff is collapsed.
{
"name": "bookStyler - printing with graphic art",
"version": "0.0.1",
"description": "Framework to develop books using html and css using html, grunt and postcss plugins",
"main": "Gruntfile.js",
"dependencies": {
"grunt": "^1.0.3"
},
"devDependencies": {
"autoprefixer-core": "^6.0.1",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "git+https://github.com/gruntjs/grunt-contrib-copy.git",
"grunt-contrib-watch": "^1.1.0",
"grunt-open": "^0.2.3",
"grunt-postcss": "^0.9.0",
"load-grunt-tasks": "^4.0.0",
"pixrem": "^4.0.1",
"postcss-center": "^1.1.0",
"postcss-color-function": "^4.0.1",
"postcss-color-rgba-fallback": "^3.0.0",
"postcss-css-variables": "^0.9.0",
"postcss-discard-comments": "^4.0.0",
"postcss-font-magician": "^2.2.1",
"postcss-import": "^11.1.0",
"postcss-merge-rules": "^4.0.0",
"postcss-nested": "^3.0.0",
"postcss-simple-extend": "^1.0.0",
"postcss-simple-vars": "^4.1.0",
"time-grunt": "^1.4.0"
},
"scripts": {
"start": "npm i && grunt",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "pagedMedia.org",
"license": "MIT"
}
This diff is collapsed.
/* import your fonts if you have some in the src/fonts folder */
/* @import "modules/fonts.css"; */
/* theming of the book */
@import 'modules/reset.css';
@import "modules/vars.css";
/* paged js interface and screen view css */
@import "interface/interface.css";
/* baseline helper */
/* @import "interface/baseline.css"; */
/* hack for stuff not implemented yet */
@import "interface/hack.css";
/* css for the layouts */
@import "modules/layout.css";
/* adding a visual helper for the baseline grid */
:root {
/* you can change the line-height step for the grid here (as it may not be the same that the lineheight) */
--baseline: var(--font-lineHeight);
}
@media screen {
.pagedjs_page {
background: linear-gradient( var(--color-paper) 0%, var(--color-paper) 94%, var(--color-baseline) 94%, var(--color-baseline) 100%), var(--color-paper);
background-size: 100% var(--baseline);
background-repeat: repeat-y;
background-position-y: var(--margin-head);
}
}
\ No newline at end of file
/* here come some simple hacks for features that are not yet in paged js */
/* To define how the book look on the screen: */
@media screen {
body {
background-color: var(--color-background);
}
.pagedjs_pages {
display: flex;
width: calc(var(--width) * 2);
flex: 0;
flex-wrap: wrap;
margin: 0 auto;
margin-bottom: 3em;
}
.pagedjs_page {
background-color: var(--color-paper);
box-shadow: 0 0 0 2px var(--color-pageBox);
margin: 0;
flex-shrink: 0;
flex-grow: 0;
margin-top: 10mm;
}
.pagedjs_first_page {
margin-left: var(--width);
}
/* uncomment for recto/verso book.
--------------------------------------------------- */
/* .pagedjs_pages {
flex-direction: column;
width: 100%;
}
.pagedjs_first_page {
margin-left: 0;
}
.pagedjs_page {
margin: 0 auto;
margin-top: 10mm;
} */
}
\ No newline at end of file
.smallcaps{ font-variant: small-caps; }
@page {
size: A4;
margin: 20mm;
}
\ No newline at end of file
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in
* IE on Windows Phone and in iOS.
*/
html {
// line-height: 1.15; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/**
* Add the correct display in IE 9-.
*/
article,
aside,
footer,
header,
nav,
section {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main { /* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
}
/**
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: sans-serif; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {