GithubHelp home page GithubHelp logo

vivliostyle / vivliostyle.js Goto Github PK

View Code? Open in Web Editor NEW
568.0 40.0 50.0 338.68 MB

πŸ“– The power of CSS typesetting, right at your fingertips.

Home Page: https://vivliostyle.org

License: GNU Affero General Public License v3.0

JavaScript 11.99% CSS 0.20% Shell 0.31% HTML 29.19% Batchfile 0.08% TypeScript 55.57% SCSS 1.35% EJS 1.31%
vivliostyle epub typesetting css

vivliostyle.js's Introduction

Vivliostyle

GitHub tag Build Status Sauce Test Status GitHub contributors PR's welcome

Vivliostyle is an open source project for a new typesetting system based on web standard technology.

Vivliostyle.js offers HTML+CSS typesetting and rich paged viewing with EPUB/Web publications support.

🌏 Vivliostyle.org
πŸ“– Documentation
🀝 Join Community
πŸ•Ά Awesome Vivliostyle
πŸ’… Vivliostyle Themes

Table of contents

Packages

npm: version npm: total downloads

A core library for HTML+CSS typesetting with EPUB/Web publications support.

See API Reference for further details.

npm: version npm: total downloads

A web app provides intuitive UI for Vivliostyle.

Use officially-hosted Vivliostyle Viewer or download a distribution package from https://vivliostyle.github.io.

npm: version npm: total downloads

A command-line interface of Vivliostyle.

npm: version npm: total downloads

Use React component as a Vivliostyle renderer.

npm: version npm: total downloads

Vivliostyle Flavored Markdown (VFM) is a Markdown syntax optimized for book authoring. It is standardized and published for Vivliostyle and its sibling projects.

npm: version npm: total downloads

Vivliostyle Print allows page-layouting using Vivliostyle Core for printing within a website without destroying the original layout.

npm: version npm: total downloads

The fastest way to start writing book with Vivliostyle ecosystem.

npm: total downloads

Create Vivliostyle theme at ease.

Contribution

Bug Reports & Feature Requests

Please report on GitHub Issues.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

sorotokin
sorotokin

πŸ’»
KAWAKUBO Toru
KAWAKUBO Toru

πŸ’»
Satoru MATSUSHIMA (β„ )
Satoru MATSUSHIMA (β„ )

πŸ’»
Seiya Konno
Seiya Konno

πŸ’»
Johannes Wilm
Johannes Wilm

πŸ’»
Florian Rivoal
Florian Rivoal

πŸ’»
Satoshi KOJIMA
Satoshi KOJIMA

πŸ’»
Masaya Yamauchi
Masaya Yamauchi

πŸ’»
Shinyu Murakami
Shinyu Murakami

πŸ’» πŸ“– πŸ“’
Shota Kubota
Shota Kubota

πŸ’»
spring-raining
spring-raining

πŸ’» πŸ“– πŸ“’
Hiroshi Hatake
Hiroshi Hatake

πŸ’»
takanakahiko
takanakahiko

πŸ’»
Yasuaki Uechi
Yasuaki Uechi

πŸ’» πŸ“– 🎨 πŸ“’
Zachary Waldowski
Zachary Waldowski

πŸ’»
yamasy1549
yamasy1549

πŸ’» 🎨
OGATA Katsuhiro
OGATA Katsuhiro

πŸ“ πŸ“‹
akabeko
akabeko

πŸ–‹ πŸ€”
youchan
youchan

πŸ’» πŸ“’
Yuku Kotani
Yuku Kotani

πŸ’»
Christoph PΓ€per
Christoph PΓ€per

πŸ’»
Ikko Eltociear Ashimine
Ikko Eltociear Ashimine

πŸ’»
Takai ayumu
Takai ayumu

πŸ’» πŸ“’
daisuke-tanabe
daisuke-tanabe

πŸ’»
Hiroaki KAWAI
Hiroaki KAWAI

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Bronze Sponsor

License

Licensed under AGPL Version 3.

Vivliostyle Core is implemented based on Peter Sorotokin's EPUB Adaptive Layout implementation, which is licensed under Apache License, Version 2.0.

Credits

Powered By Vercel

Testing Powered By SauceLabs

vivliostyle.js's People

Contributors

cosmo0920 avatar crissov avatar daisuke-tanabe avatar dependabot[bot] avatar eltociear avatar frivoal avatar hkwi avatar johanneswilm avatar kubosho avatar kwkbtr avatar murakamishinyu avatar nulltask avatar ogwata avatar satorumurmur avatar skoji avatar sorotokin avatar spring-raining avatar takanakahiko avatar uetchy avatar unageanu avatar yamasy1549 avatar yukukotani avatar zwaldowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vivliostyle.js's Issues

Logfiles

Right now VS uses global log files (for Mac and Linux). It should be possible to configure the logfiles by command-line or at least default to the current directory instead of writing to /tmp.

CSS parsing throws error

Parsing following CSS (used in Wikipedia) throws an error:

.alert-container {
    -moz-border-radius: 3px;
    border-radius: 3px;
    background-image:linear-gradient(bottom, rgb(215,215,215) 4%, rgb(230,230,230) 55%, rgb(255,255,255) 100%);
}

Do not block entire process when stylesheets cannot be fetched or parsed

Currently the entire layout process is blocked when a stylesheet cannot be fetched or parsed.
This includes, for example,

  • Exceptions caused by bugs in the CSS parser (e.g. #140).
  • Blocking of the HTTP request by browser when the current (UI) page is served over HTTPS.

These events should be skipped (with warning messages) and the entire layout process should be continued, instead of begin stopped completely.

Float images in pages

Here is a sample that a image positioned by float: right and width: 50%.

I remember that Johannes Wilm is editing CSS Page Floats. So I'd like to know how will vivliostyle project going to support it?

HTML well-formed as XML is displayed incorrectly

When the source HTML happens to be a well-formed XML document, it is not correctly displayed.
Example:

<!DOCTYPE html>
<html>
 <head>
   <title>Test</title>
 </head>
 <body>
   <h1>Test</h1>
   <p>Hello, world!</p>
 </body>
</html>

Current implementation treats the source as an XML document if it can be parsed as a well-formed XML.
However, since the source lacks the XML namespace declaration, it is not treated as (X)HTML and default style sheets for (X)HTML are not applied.

The document type should be judged by Content-Type or file extension.

"Fit inside viewport" zoom mode

Since current implementation stores only a single zoom factor, the following procedure leads to a page not fitting inside viewport:

  1. Click "Fit inside viewport" button on a page
  2. Navigate to another page whose size is different from the first one

It would be good to have a "Fit inside viewport" zoom mode, in which the zoom factor changes along with page navigation so that pages are always displayed as fitting inside viewport.

--version command line option

It would be nice having a --version command line option for the formatter in order to introspect the installed version.

Page/column break inside table

The current implementation handles page/column breaks as if break-inside: avoid were always specified on display: table elements.
This behavior is not specified in CSS specs, and often leads to unnaturally large spaces before tables.

Appropriately handle interaction between forced break value and avoid break value

Spec: CSS Fragmentation - 4.3. Forced Breaks

A forced break occurs at a class A break point if, among the break-after properties specified on or propagated to the earlier sibling box and the break-before properties specified on or propagated to the later sibling box there is at least one with a forced break value. (Thus a forced break value effectively overrides any avoid break value that also applies at that break point.)

Add support for Compositing and Blending Level 1

https://drafts.fxtf.org/compositing-1/

Should be easy to support by simply delegating to the browser. There's no particular interaction with pagination.

Note that 2 properties (isolation and mix-blend-mode) create stacking context when not at their initial value. I'm marking this as quickfix assuming we can simply pass everything through, but if the stacking context story complicates things, we should probably split this bug in 2, one for background-blend-mode, which should stay a quickfix, and one for isolation and mix-blend-mode.

Page-margin box styles are ignored

Example:

@page {
  margin: 1cm;
}
@page:right {
  @top-center { content: "right"; }
}
@page:left {
  @top-center { content: "left"; }
}

In this case, all pages show "right" header and the page at-rule for left pages is ignored.

JIS B paper size

In Japan, JIS B paper size is used much more often than ISO B paper size.
Should it be included to CSS Paged Media Module?
We can implement a vendor extension to the size value, but having it in the spec is better.

Truncate margins at unforced page/column breaks

Spec: CSS Fragmentation Module Level 3 - Adjoining Margins at Breaks

When an unforced break occurs between block-level boxes, any margins adjoining the break truncate to the remaining fragmentainer extent before the break, and are truncated to zero after the break. When a forced break occurs there, adjoining margins before the break are truncated, but margins after the break are preserved. Cloned margins are always truncated to zero on block-level margins.

Copy 'size' property in page at-rules to the DOM

Google Chrome's "Save As PDF" feature reads page at-rules in stylesheets and automatically set the page size of the output PDF file.
Since current Vivliostyle.js reads page at-rules in stylesheets and determines the page dimensions but does not write the rules in the view DOM, the page size information is lost on print.
The 'size' property in the page at-rules should be copied to the view DOM.

Incorrect pagination caused by absolutely positioned element

Current implementation delays application of position: relative after the page layout is done:

An absolutely positioned element can be placed at a wrong position when its containing block is specified by a position: relative element, since the application of the position value is delayed and another wrong element may be chosen as its containing block. This sometimes leads to incorrect pagination where a page break occurs even if there remains room for subsequent contents.

position: relative should not affect layout of subsequent (sibling) elements, but should affect pagination. In this sense, I think the delay should be dropped.

Git pack files > 100MB

The total weight of vivliostyle is around 10MB, but it checks out at 100MB. For some reason the git pack files are huge.

$
git clone https://github.com/vivliostyle/vivliostyle.js.git
Cloning into 'vivliostyle.js'...
remote: Counting objects: 36378, done.
remote: Total 36378 (delta 0), reused 0 (delta 0), pack-reused 36378
Receiving objects: 100% (36378/36378), 110.55 MiB | 4.70 MiB/s, done.
Resolving deltas: 100% (3473/3473), done.
Checking connectivity... done.
$ 
$ pwd
....../vivliostyle/vivliostyle.js/.git/objects/pack
$ 
$ ls -lah
996K Oct 22 11:47 pack-5242ff6347025cabc7c8cd929dc9d192816bd9d2.idx
111M Oct 22 11:47 pack-5242ff6347025cabc7c8cd929dc9d192816bd9d2.pack

Unique page number counter for EPUB

When viewing an EPUB with multiple HTML files, a unique (builtin) page number counter should be used for the entire EPUB document.
In other words, page-based counters should not be automatically reset when switching the HTML files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.