pagedjs merge requestshttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests2018-10-11T20:55:53Zhttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/27WIP: Text align last2018-10-11T20:55:53ZBoris Budiniboris@cloud68.coWIP: Text align lasttext-align-last close issue #21 text-align-last close issue #21 https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/28chunker: add reflow()2022-03-30T19:46:29ZBoris Budiniboris@cloud68.cochunker: add reflow()https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/53Rectify ESM modules2019-10-31T21:11:34ZBoris Budiniboris@cloud68.coRectify ESM modulesI did several things in this PR:
- I fixed the Rollup ESM bundling (npm modules were not bundled)
- an ESM module is generated for the polyfill
- I updated the documentation
The latter can be revised, I'm not sure if all the cha...I did several things in this PR:
- I fixed the Rollup ESM bundling (npm modules were not bundled)
- an ESM module is generated for the polyfill
- I updated the documentation
The latter can be revised, I'm not sure if all the changes fit in the scope. At least it illustrates the ESM syntax.
---
```
$ npm run build
> pagedjs@0.1.31 build /Users/oncletom/workspace/pagedjs
> rollup -c
dist/paged.esm.js → dist/paged.js, ./dist/paged.esm.js...
created dist/paged.js, ./dist/paged.esm.js in 1.2s
./src/polyfill/polyfill.js → ./dist/paged.polyfill.js, ./dist/paged.polyfill.esm.js...
created ./dist/paged.polyfill.js, ./dist/paged.polyfill.esm.js in 1.7s
```
The source of the bundled file now reflects npm dependencies have been included:
```
$ head dist/paged.esm.js
(function(l, i, v, e) { v = l.createElement(i); v.async = 1; v.src = '//' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; e = l.getElementsByTagName(i)[0]; e.parentNode.insertBefore(v, e);})(document, 'script');
function getBoundingClientRect(element) {
if (!element) {
return;
}
let rect;
if (typeof element.getBoundingClientRect !== "undefined") {
rect = element.getBoundingClientRect();
} else {
let range = document.createRange();
```https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/54Do not run the polyfill automatically (BREAKING CHANGE)2019-04-05T18:26:51ZBoris Budiniboris@cloud68.coDo not run the polyfill automatically (BREAKING CHANGE)I found out it was easier not to polyfill automatically when the script is included via ESM.
I use the "polyfill" because it's a no brainer for me, as I don't understand (yet) how to order the use of the chunker, parser etc. — that's ...I found out it was easier not to polyfill automatically when the script is included via ESM.
I use the "polyfill" because it's a no brainer for me, as I don't understand (yet) how to order the use of the chunker, parser etc. — that's an "advanced" scenario for me.
I also never use the polyfill out of the box because there is always something else to do (markdown to HTML, moving some content around, fetching dynamic data). And I use ECMAScript modules without a build toolchain for workshop purposes (nothing to configure, everything works with a plain HTML file).
---
ALTHOUGH — and this is not what is reflected by the PR but what came to my mind afterwards — I wonder if it would be simpler to:
1. not have ESM modules for the polyfill script (it now sounds confusing to me)
1. move the "manual" magic to the non-polyfill script
Which means, in terms of responsability, "polyfill" is about getting stuff done "magically" while the other script is about doing things manually.
```html
<html>
<script type="module">
import {Polyfill} from 'https://unpkg.com/pagedjs/dist/paged.esm.js';
/* ... */
window.addEventListener('load', () => Polyfill.preview());
</script>
<link rel="stylesheet" href="...">
<body>
<!-- ... -->
</body>
</html>
```
```html
<html>
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js" defer></script>
<link rel="stylesheet" href="...">
<body>
<!-- ... -->
</body>
</html>
```
What do you think? I'm happy to rework things in a way which lowers the barrier to entry as well as the maintenance.https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/55Reduce the selector score to be able to override [data-split-to] styles witho...2020-10-08T16:11:57ZBoris Budiniboris@cloud68.coReduce the selector score to be able to override [data-split-to] styles without using !important.Removed the
```css
.pagedjs_pages > .pagedjs_page > .pagedjs_sheet > .pagedjs_pagebox > .pagedjs_area > div [data-split-to] {
```
to keep only
```
div [data-split-to] {
```
This was breaking the use of `::first-letter` elem...Removed the
```css
.pagedjs_pages > .pagedjs_page > .pagedjs_sheet > .pagedjs_pagebox > .pagedjs_area > div [data-split-to] {
```
to keep only
```
div [data-split-to] {
```
This was breaking the use of `::first-letter` element in the beginning of a page.Boris Budiniboris@cloud68.coBoris Budiniboris@cloud68.cohttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/59WIP: turn styles into class fot the text-align-last2019-10-26T06:21:20ZBoris Budiniboris@cloud68.coWIP: turn styles into class fot the text-align-lastchanged the text-align-last to a class that handlechanged the text-align-last to a class that handlehttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/60Only force last split element to justify2019-10-26T06:17:58ZBoris Budiniboris@cloud68.coOnly force last split element to justify* Only justify the very last split element
* Force justification using `[data-force-text-align-last='justify']` for easier overridding
Fixes https://gitlab.pagedmedia.org/tools/pagedjs/merge_requests/59* Only justify the very last split element
* Force justification using `[data-force-text-align-last='justify']` for easier overridding
Fixes https://gitlab.pagedmedia.org/tools/pagedjs/merge_requests/59https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/62Add PagedConfig handlers property2020-02-06T09:18:51ZBoris Budiniboris@cloud68.coAdd PagedConfig handlers propertyIt changes 3 things:
- registering handlers from within the config object
- register handlers as bare objects (as long as the property name matches a hook)
- register a config object after a polyfill script
Config is now scoped t...It changes 3 things:
- registering handlers from within the config object
- register handlers as bare objects (as long as the property name matches a hook)
- register a config object after a polyfill script
Config is now scoped to the instance of the Polyfill, and it is taken in account when `DOMContentReady` is fired.
Config is simpler because we don't have to use 2 different concepts (config object, and registering classes).
Before we would have to use 3 scripts (config object, script src, then Handler classes with manual preview call).
I did some extra stuff:
- removed explicit dependency to `lodash` because it's not imported by `paged.js`
- moved tests to the `src` folder so as they mimic the structure of the `specs` one.
Let me know if you have questions, or would like me to change something.
This work has been done during [Les Rencontres de Lure](https://delure.org/en/les-rencontres/rencontres-precedentes/instant-t), with @JulieBlanc sitting next to me!https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/63Add beforePreview and afterPreview hooks2019-10-31T16:27:57ZBoris Budiniboris@cloud68.coAdd beforePreview and afterPreview hooksThis way DOM can be manipulated before being wrapped by Paged.js, and after it has finished everything else.
cc @JulieBlancThis way DOM can be manipulated before being wrapped by Paged.js, and after it has finished everything else.
cc @JulieBlanchttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/72Hyphen update2019-11-06T17:08:12ZBoris Budiniboris@cloud68.coHyphen updatefor @nicolast, added the possibility to change the hyphen glyph per html:
`window.pagedConfig = { hyphenGlyph = "-"}`for @nicolast, added the possibility to change the hyphen glyph per html:
`window.pagedConfig = { hyphenGlyph = "-"}`https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/86resolves #164 remove elements that do not affect the layout2020-05-10T21:31:06ZBoris Budiniboris@cloud68.coresolves #164 remove elements that do not affect the layoutI had to remove the elements in the `wrapContent` function otherwise the nodes are detached from the `document` and I cannot get the effective styles (using `window.getComputedStyle`).
resolves #164 I had to remove the elements in the `wrapContent` function otherwise the nodes are detached from the `document` and I cannot get the effective styles (using `window.getComputedStyle`).
resolves #164 https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/87Counter pages fix2020-01-15T22:27:18ZBoris Budiniboris@cloud68.coCounter pages fixFix counter(pages) - closes #169Fix counter(pages) - closes #169Boris Budiniboris@cloud68.coBoris Budiniboris@cloud68.cohttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/89resolves #174: implementation of prev to breakToken container check2020-05-19T01:58:53ZBoris Budiniboris@cloud68.coresolves #174: implementation of prev to breakToken container checkThis illustrates the fix that works for me. I left in one console.log reporting that the avoid break request was ignored.
I haven't been able to install ghostscript successfully so can't run the test suite, so haven't tried to write a ...This illustrates the fix that works for me. I left in one console.log reporting that the avoid break request was ignored.
I haven't been able to install ghostscript successfully so can't run the test suite, so haven't tried to write a unit or spec test.
I have a test document but at the moment I don't know how to make it very portable.https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/97remove script from the content before it’s parsed2020-05-10T21:31:28ZBoris Budiniboris@cloud68.coremove script from the content before it’s parsedRemove scripts from the content when Paged.js runsRemove scripts from the content when Paged.js runshttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/113resolves #176 white space characters that can be ignored are: Line Feed, Carr...2020-04-29T19:07:14ZBoris Budiniboris@cloud68.coresolves #176 white space characters that can be ignored are: Line Feed, Carriage Return, Tab and Spaceresolves #176resolves #176https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/135Add a (failing) test on long section with break-inside: avoid2020-09-11T11:56:41ZBoris Budiniboris@cloud68.coAdd a (failing) test on long section with break-inside: avoidAnother failing test to highlight the issue with long elements. Similar issue: https://gitlab.pagedmedia.org/tools/pagedjs/merge_requests/112
At first, I thought that this issue was only related to tables but I can reproduce it with oth...Another failing test to highlight the issue with long elements. Similar issue: https://gitlab.pagedmedia.org/tools/pagedjs/merge_requests/112
At first, I thought that this issue was only related to tables but I can reproduce it with other long elements (here a `<section>`).
> I think we should be able correct this on the `onOverflow` hook, but the chunker break doesn't have a special way to handle tables (or other things images) so hopefully this can be fixed with those updates.
@fchasen I'm not sure I understand what you meant. In this case, the `onOverflow` hook is not called (using either a `<table>` or a `<section>`).
Unless I'm missing something we need to detect when an element with `break-inside: avoid` cannot fit on its own on a page. If that's the case then we should try to fit the element on the previous page (and break the element accordingly).
My idea was to check that:
- the previous break node has the rule `break-inside: avoid`
- one of the parent elements of the current break node is equals to the previous break node
Basically, it means that we are breaking inside an element that has the rule `break-inside: avoid`. In other words, at this point we know that this element cannot fit on one page and that the rule `break-inside: avoid` cannot be fulfilled.
This part is relatively easy to implement but then I need to remove/ignore the `break-inside: avoid` rule and "reflow" the previous page...
Does it makes sense? is it the right approach? How can I do to "reflow" the previous page?https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/143resolves #162 remove the wrapper to avoid layout issue2022-03-31T19:08:12ZBoris Budiniboris@cloud68.coresolves #162 remove the wrapper to avoid layout issueIn fact, the wrapping `<div>` does not fit the whole page and prevents the root element of a page to take 100% of the page height.
resolves #162In fact, the wrapping `<div>` does not fit the whole page and prevents the root element of a page to take 100% of the page height.
resolves #162https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/151Document Ghostscript dependency2022-05-06T04:34:58ZBoris Budiniboris@cloud68.coDocument Ghostscript dependencyProvide install instructions for Debian based systems.
Without this, and using `npm i` I am not able to install the latest version of pagedjs
Closes #303Provide install instructions for Debian based systems.
Without this, and using `npm i` I am not able to install the latest version of pagedjs
Closes #303https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/156reference to paged.js corrected2021-07-20T19:43:51ZBoris Budiniboris@cloud68.coreference to paged.js corrected/dist/* folder is not available - which makes these examples non-functional
Update index.html/dist/* folder is not available - which makes these examples non-functional
Update index.htmlhttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/164Safari overflow fix2022-04-12T06:13:00ZFred ChasenSafari overflow fixFrom https://github.com/pagedjs/pagedjs/pull/35From https://github.com/pagedjs/pagedjs/pull/35