GithubHelp home page GithubHelp logo

pressbooks / pressbooks-book Goto Github PK

View Code? Open in Web Editor NEW
20.0 16.0 16.0 58.5 MB

McLuhan is the default book theme for Pressbooks.

Home Page: https://pressbooks.org

License: GNU General Public License v3.0

PHP 16.76% CSS 0.10% JavaScript 3.11% Shell 0.71% SCSS 79.33%
publishing book pressbooks default-theme pressbooks-theme

pressbooks-book's Introduction

Pressbooks

Contributors: Pressbooks [email protected] Tags: ebooks, publishing, webbooks Requires at least: 6.5.0 Tested up to: 6.5.0 Stable tag: 6.18.1 Requires PHP: 8.1 License: GPL v3.0 or later License URI: https://github.com/pressbooks/pressbooks/blob/production/LICENSE.md

Pressbooks is an open source book publishing tool built on a WordPress multisite platform.

Description

Packagist Current Release Packagist PHP from Packagist

Packagist Code Coverage Translate Pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS. Pressbooks is free software, released under the GPL v3.0 or later license.

Our webbooks and EPUB/PDF exports are all driven by HTML + CSS. XML outputs have no styling.

Requirements

Pressbooks works with PHP 8.1 and WordPress 6.5.0. Lower versions are not supported.

Installing the Plugin

Pressbooks is not for use on an existing blog. Instead it should be used with a fresh, multisite WordPress installation.

To install Pressbooks on your site, download the latest release and follow our installation instructions.

You may want to try Pressbooks.com before deciding whether or not you wish to host and maintain your own instance of Pressbooks. We can also host and maintain an instance of Pressbooks for you.

Contributor guidelines

Developers who are interested in contributing to our project should consult our "Contributing" guidelines and the developer guides published on our documentation website.

Disclaimers

The Pressbooks plugin is supplied "as is" and all use is at your own risk.

Changelog

6.18.1

Upgrade Notices

6.18.0

6.17.0

6.15.2

6.15.1

6.12.0

6.10.0

6.9.0

  • Pressbooks 6.9.0 requires PHP >= 8.1

6.4.0

  • Pressbooks 6.4.0 requires PHP >= 8.0
  • Pressbooks 6.4.0 requires WordPress 6.1.1

6.0.0

5.34.1

5.34.0

5.33.0

5.32.0

5.31.0

5.30.0

5.27.0

5.25.0

5.21.0

5.20.1

5.18.0

  • Pressbooks 5.18.0 requires PHP >= 7.3
  • Pressbooks 5.18.0 requires WordPress 5.5.3

5.16.0

  • If you are using the plugin (Lord of the Files)[https://wordpress.org/plugins/blob-mimes/] version <=1.0.0, this upgrade will break your application. To fix this, you would need to update Lord of the files plugin to at least 1.1.0.

5.15.1

pressbooks-book's People

Contributors

alex-418 avatar arzola avatar bryborge avatar cagp-dev-mtl avatar colomet avatar dac514 avatar dannylonglegs avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar fdalcin avatar github-actions[bot] avatar greatislander avatar ho-man-chan avatar marbaque avatar mbrousseaubrock avatar pjotrsavitski avatar pressbooks-ops avatar ricardopressbooks avatar richard015ar avatar sevensidedsquare avatar steelwagstaff avatar transifex-integration[bot] avatar tw77 avatar

Stargazers

 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

pressbooks-book's Issues

Add compatibility with wrapped headings

Prerequisites

Description

See pressbooks/pressbooks#1045.

Steps to Reproduce

Not applicable.

System Information

Book: 2.0-dev

Fix table styling

Prerequisites

Description

See: https://github.com/pressbooks/pressbooks/issues/672

Steps to Reproduce

Not applicable.

System Information

Book Theme: Pressbooks Book
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

Subtitle displays tagline, not actual subtitle

Prerequisites

Description

See:

<?php if ( ! empty( $metadata['pb_about_140'] ) ) : ?>

Steps to Reproduce

Not applicable.

System Information

Pressbooks Book 1.10.1

Theme option for suppressing navigation items

Description

One common use case for Pressbooks titles in higher education is for books to be brought into Learning Management Systems using Thin Common Cartridge files with LTI links. This allows individual chapters to be launched from links within a learning management system. Lumen Learning has been using this method for some time with their setup, and several of the schools using Pressbooks in the Unizin consortium will be doing this increasingly often in the future. A sample screenshot of Pressbooks chapters imported as LTI links in Canvas (the LMS we're using now at my institution included below):
screen shot 2017-08-17 at 1 38 58 pm

When chapters are launched within the LMS, however, the Pressbooks navigation elements are redundant (at best), and highly confusing to the user (at worst). See how a Pressbooks loads in the LMS in the screenshot below:
screen shot 2017-08-17 at 1 39 27 pm

We'd like to propose an option that would suppress several navigation elements (probably using CSS rules to hide various elements) for cases where a book is displayed via an LTI launch/link in a LMS. We'd definitely want to suppress the forward/back buttons (the LMS already includes previous/next for its module items) and the 'home' and 'table of contents' buttons, as well as the top nav bar with book information.

The developers at Lumen (@bracken and @monkecheese) have already built something like this for their Bombadil theme: https://github.com/lumenlearning/candela-utility/blob/master/themes/bombadil/functions.php#L241-L262, but I think we'd want to refine this so that it was able to work for more general use cases and operated in parent themes. Hoping that this issue could serve as a discussion place for ideas to implement this feature for other themes and to help those of interested in building this functionality submit a well-thought out pull request for the project.

Unable to upload image for Catalog Profile

Prerequisites

Check the boxes below by changing them from [ ] to [x].

Description

When using the My Catalog Profile feature I am unable to upload a logo or image. I can browse my local file system for an image and the filename shows next to the browse button but there is no upload button. Hitting save changes generates the following error that appears on our dev platform: Fatal error: Call to undefined function Pressbooks\wp_handle_upload() in /vol/data/pressbooks.calidev.org/wp-content/plugins/pressbooks/inc/class-catalog.php on line 731

This behavior happens on both our development and production platforms for all users.

Steps to Reproduce

  1. Starting on My Catalog page, click on Catalog Profile link under Catalog sorting heading
  2. On My Catalog Profile page under Logo or Image click Browse and locate an image
  3. Click Open on File Upload window
  4. Click Save Changes, only option available on My Catalog Profile page

Expected behavior: I expected to be able to add some image that would replace the default image on my personal catalog page.

Actual behavior: Image did not load and an error was generated.

System Information

Root Blog Info

Root Blog ID: 1
Root Blog URL: http://pressbooks.calidev.org/

Browser

Platform: Windows
Browser Name: Firefox
Browser Version: 58.0
User Agent String: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0

WordPress Configuration

Network URL: http://pressbooks.calidev.org/
Network Type: Subdirectory
Version: 4.8.3
Language: en_US
WP_ENV: Not set
WP_DEBUG: Enabled
Memory Limit: 64M

Pressbooks Configuration

Version: 4.3.5
Root Theme: Pressbooks Publisher
Root Theme Version: 3.0.1

Pressbooks Dependencies

Epubcheck: Not Installed
Kindlegen: Not Installed
xmllint: Not Installed
PrinceXML: Not Installed
Saxon-HE: Not Installed

Must-Use Plugins

hm-autoloader.php: n/a

Network Active Plugins

Pressbooks: 4.3.5
Pressbooks Textbook: 3.1.6

Root Blog Active Plugins

Inactive Plugins

Akismet Anti-Spam: 4.0.1
Default Theme: 1.0.4
Hello Dolly: 1.6
WPMU DEV Dashboard: 4.4

Server Configuration

PHP Version: 5.6.23-1+deprecated+dontuse+deb.sury.org~trusty+1
MySQL Version: 5.5.54
Webserver Info: Apache/2.4.16 (Ubuntu) OpenSSL/1.0.1f

PHP Configuration

Safe Mode: Disabled
Memory Limit: 256M
Upload Max Size: 256M
Post Max Size: 256M
Upload Max Filesize: 256M
Time Limit: 180
Max Input Vars: 1000
URL-aware fopen: On (1)
Display Errors: On (1)

PHP Extensions

OPcache: Zend
XDebug: Disabled
cURL: Supported
cURL Version: 7.35.0
imagick: Not Installed
xsl: Installed

Standard element translations not appearing in webbook since 1.9.0 release

Prerequisites

Check the boxes below by changing them from [ ] to [x].

Description

Since 1.9.0 release, standard elements on webbook homepage & reading interface remain in English when another language is selected in "Book Info". Translations are confirmed present in Transifex. PDF & ebook unaffected.

Reported by a client on several books (can share URLs in Slack if need be, set to French) but confirmed on test book.

Steps to Reproduce

  1. Change book language away from English (e.g. French/Spanish/German)
  2. Navigate to webbook
  3. Check standard elements (e.g. 'Read' button, 'Book Description', 'Table of Contents')

Expected behavior: Standard elements should appear in active book language

Actual behavior: Standard elements appear in English

System Information

Let me know if you need this from client book(s).

Search text box needs label for a11y

Prerequisites

Description

The new "search within" textbox should have a label - e.g. "search within this book."

Steps to Reproduce

Not applicable

System Information

Book Theme: Pressbooks Book 1.8.0
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

License display

Prerequisites

Description

Consistent, granular licensing information should be displayed in the webbook. See:

pressbooks/pressbooks#108
pressbooks/pressbooks#805

Steps to Reproduce

Not applicable.

System Information

Book Theme: Pressbooks Book 2.0.0-dev
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

Enable Social Media Breaks Mobile Layout

Prerequisites

Check the boxes below by changing them from [ ] to [x].

Description

When I enabled "Add buttons to cover page and each chapter so that readers may share links to your book through social media: Facebook, Twitter, Google+" the layout is broken on my Android (Moto E, Chrome)

Tested in Luther (and Asimov Color)

Steps to Reproduce

  1. Theme Options -> Web Options -> Enable Social Media
  2. Navigate to a page on an Android (or emulate in Chrome)

Expected behavior: [What you expected to happen]

without-social-media-buttons

Actual behavior: [What actually happened]

with-social-media-buttons

System Information

Using a private test book for tests: https://dactest.pressbooks.com/front-matter/introduction/

Change hover behaviour to focus where applicable

Prerequisites

Description

From client: There is certain behavior that happens on mouse-over that should instead happen on focus. One example is the big red "read" button on the front pages of books.

Steps to Reproduce

Not applicable.

System Information

Book Theme: Pressbooks Book 1.8.0
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

Add support for <!--nextpage--> pagination

Prerequisites

Check the boxes below by changing them from [ ] to [x].

Description

Add support for <!--nextpage--> so that long chapters can be broken up into smaller parts in web books.

Technical Info

Info:
https://codex.wordpress.org/Styling_Page-Links

Code is in \WP_Query::setup_postdata() WordPress splits on <!-- nextpage --> then creates globals $pages (array), $multipage (bool), $more (string), $numpages (int)

get_the_content() already has code that deals with $pages, $multipage so it might already be working, without styling?

To investigate.

Favicon option

Prerequisites

Description

See: pressbooks/pressbooks#255

Steps to Reproduce

Not applicable.

System Information

Book Theme: Pressbooks Book
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

columnize is not a function due to async

I've run into an issue where, upon loading a Table of Contents page, the list of contents will render into one column. When I check the javascript console, I get an error saying $(...).columnize is not a function, even though, in the network tab, both columnizer.js and columnizer-load.js are returning a 200 status.

When you reload the page, it almost always renders correctly and the javascript error goes away.

Looking at the codebase, it appears that in pressbooks/themes-book/pressbooks-book/functions.php, in a function called pressbooks_async_scripts, there is an array of script names that are then loaded asynchronously. And in that array are the two aforementioned scripts. When I remove them from this list, the problem seems to go away. Though I imagine, they were added to that list to increase page load performance.

The other odd thing to note is that in the wp_enqueue_script for columnizer-load, columnizer is added as a dependency to that script, so Wordpress should be loading them in the right order. Perhaps there's a different Wordpress "way" of dealing with async while preserving script dependency?

In new themes, footnote block needs variables for top-margin & border

In new theme structure there is no mechanism to control footnote block top-margin & border.

Need to add in ~assets/book/styles/components/specials/_footnotes.scss the following:

@page {
  @footnotes {
    margin-top: $footnote-block-margin-top;
    border-top: $footnote-block-border-top;
 }
}

and then in ~assets/book/styles/variables/specials.scss the following:

$footnote-block-margin-top: .5em;
$footnote-block-border-top: 0;
and test.

(See: pressbooks/pressbooks#748)

TOC keyboard navigation

Prerequisites

Description

The tables of contents in online books that have more than one page within chapters cannot be navigated with a keyboard. In the table of contents, the individual sections are collapsed into their containing chapters and there is no way to expand those sections with a keyboard -- only a mouse. You can tab through the links to pages within chapters that are already expanded but the keyboard skips over any chapters that are not. This is a huge barrier to accessibility for anyone who uses a screen reader and relies on keyboard navigation.

See pressbooks/pressbooks#526

Steps to Reproduce

  1. Visit a webbook and click "Read".
  2. Attempt to use the keyboard to navigate into the table of contents.

Expected behavior: Keyboard should be able to navigate through all sub-chapters.

Actual behavior: Keyboard cannot navigate into collapsed sub-chapters when the TOC is more than a page long.

System Information

Book Theme: Pressbooks Book
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

Add manifest.json

Description

The idea/goal would be to set it up so that webbooks could be installed/read offline in mobile mode. Adding a manifest.json file would allow us to provide the metadata, etc. as a first step toward letting individual books function more like PWAs. Would then need to add a service worker to allow the book to be read/consumed offline: https://abookapart.com/products/going-offline + https://chris.bolin.co/offline/.

See:
http://kizu514.com/blog/manifest-json/
https://dev.opera.com/articles/installable-web-apps/
https://brucelawson.github.io/manifest/
See https://resilientwebdesign.com/ & https://resilientwebdesign.com/manifest.json

License transient is never used

Prerequisites

Description

A transient holding license information is set in this function, but the logic prevents the transient from ever being used. This triggers an API call to the Creative Commons API on every page load. See also: http://github.com/pressbooks/pressbooks/issues/195

Steps to Reproduce

  1. Load a chapter or book cover page.

Expected behavior: After the initial load the Creative Commons license is retrieved from the stored transient.
Actual behavior: A Creative Commons API call is triggered on every page load.

System Information

Pressbooks 4.0.0-RC1 / Pressbooks Book 1.9.0-RC1

Fix CC license image on MOBI

Prerequisites

Description

The image should be 88px × 31px but MOBI scales it down to the line height.

Steps to Reproduce

Not applicable.

System Information

Pressbooks: 4.1-dev
Pressbooks Book: 1.9.3-dev

Fix em value on license line height

Prerequisites

Description

EPUB house styles contains an em value for line height in the license block. This breaks MOBI.

Steps to Reproduce

Not applicable.

System Information

Book: >= 1.10

pressbooks_update_webbook_stylesheet() fails when style.css doesn't exist

Prerequisites

Description

When a new book has just been created, pressbooks_update_webbook_stylesheet() fails:

Warning: filemtime(): stat failed for /srv/www/pressbooks.dev/current/web/app/uploads/sites/2/css/style.css in /srv/www/pressbooks.dev/current/web/app/themes/pressbooks-book/functions.php on line 146

Steps to Reproduce

  1. Create a new book.
  2. Visit cover page (while in development environment).

Expected behavior: Hook runs if needed.

Actual behavior: Hook fails if style.css is missing. It should run regardless.

System Information

Pressbooks: 4.0.1
Pressbooks Book: 1.9.2
WordPress: 4.8
PHP: 7.1

Increase webbook width

Prerequisites

Description

A common request is for the webbook content to be wider.

Steps to Reproduce

Not applicable.

System Information

Book Theme: Pressbooks Book 1.8.0
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

Some predefined table stylings might be unexpected or even wrong

Description

Some predefined table stylings might be unexpected or even wrong. I made printscreens of what they look like in ebpub3 and pdf and printscreens of what I would expect them to look like.

ALSO: The editor view and the online version should be consistant with the PDF and EPUP3, eg should look like delivros_epub3.jpg, delivros_print_pdf.jpg .

Steps to Reproduce

  1. create 4 tables
  2. assign the 4 predefined tables classe to each table
  3. create pdf and epub3

Expected behavior: [What you expected to happen]
delivros_epub3.jpg, delivros_print_pdf.jpg

Actual behavior: [What actually happened]
clarke_epub3.jpg, clarke_print_pdf.jpg

CSS added to clake to make delivros (actually $shade-color-1 did not work for me, so is used #eee):

table:not([class]), table:not([class]) td, table:not([class]) th {
border: $table-border-width solid;
border-color: if-map-get($line-color-1, $type);
}

.no-lines, .no-lines td, .no-lines th {
border: 0;
}

.lines tr {
border-top: $table-border-width solid;
border-bottom: $table-border-width solid;
border-left: none;
border-right: none;
border-top-color: if-map-get($line-color-1, $type);
border-bottom-color: if-map-get($line-color-1, $type);
}

thead, thead td, thead th, th {
background-color: $shade-color-1;
}
.shaded {
background-color: $shade-color-1;
border: 0;
}


clarke_epub3
clarke_epub3
clarke_print_pdf
clarke_print_pdf
delivros_epub3
delivros_epub3
delivros_print_pdf
delivros_print_pdf

Deprecate custom CSS for web

Prerequisites

Description

See pressbooks/pressbooks-custom-css#3.

Steps to Reproduce

Not applicable.

System Information

Book: 2.0

Use stylelint

Prerequisites

Description

Use stylelint, as per pressbooks/pressbooks#817.

Steps to Reproduce

Not applicable.

System Information

Book Theme: Pressbooks Book
Pressbooks: 4.0.0-dev
WordPress: 4.8.0
PHP: 7.1

Catalog image & cover page background theme option

Description

Add web theme options for Catalog Image and Cover Page Background. Image will be used:

  1. On Aldine's catalog page (296px × 323px format).
  2. On the book cover page (1920px × 960px format).

Web Theme Options

Catalog Image: This image will appear on your webbook’s cover page and in the network catalog (if applicable). Catalog image should be 2:1 aspect ratio. Recommended minimum dimensions are 1920px × 960px, maximum file size is 2MB.

(User can upload or choose from presets. Uploads will be validated for minimum size and aspect ratio.)

Cover Page Background: Light / Dark (toggle switch).

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.