GithubHelp home page GithubHelp logo

bccampus / pressbooks-textbook Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 13.0 6.28 MB

A plugin that extends Pressbooks for textbook authoring

License: GNU General Public License v2.0

CSS 22.13% PHP 50.04% JavaScript 26.40% Shell 1.42%

pressbooks-textbook's People

Contributors

alex-418 avatar bdolor avatar figureone avatar hughmcguire avatar jackdougherty avatar juliencxx avatar rwestmacott 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pressbooks-textbook's Issues

Theme Options and mPDF TOC issue found

WP 4.2.2, PB 3.1.2, PBT 2.1.2, PmPDF 1.0.1

Symptom:
No TOC generated with PDF even though all system configurations are correct.

Workaround Solution:
Go to Open Textbook Theme Options > mPDF Options tab > Table of Contents > disable, then Save Changes, then re-enabled

Now generates TOC in PDF

Circumstances when this happens:
Migrating from one server to another. Everything appears fine across Pressbooks system and sites, except TOC is not generated in PDF.

Populate new book with content from copied book

After 'copy book' button has been pushed and new book as been created

  • use the WP-API to:
  • copy the book content
  • copy the book metadata
  • define the copyright and set the attribution
  • copy some of the recent editing history
  • retain a connection back to the original copy

Large tables not displaying correctly in Site visit and epub export

Wordpress 4.3
Pressbooks Version 2.7.1
PressBooks Textbook Version 1.2.15


Visit Site display extends beyond body of text:
html-table_1_lg

EPUB display cuts off table content:
epuf-table_1_lg

No issue with mPDF rendering

pdf-table_1_lg

PRESSBOOKS . COM site outputs Visit Site display correctly as a horizontal scroll:

2015-09-13_11-03-42

Research links:
Responsive Data Tables - https://css-tricks.com/responsive-data-tables/
How to Create Responsive Tables in WordPress - http://exisweb.net/responsive-tables-in-wordpress
10+ Solutions for Responsive Data Tables - http://exisweb.net/responsive-table-plugins-and-patterns


Workaround for epub display seems to be converting large tables into images with link to larger content.

or

The following appears to be a potential solution for Site visit display:

Themes > Editor > Open Textbooks > style.css > #content table {

CHANGE display:table to block

Example:
/*******************************
Textbook specific styles
********************************/

content table {

border-spacing: 0;
    display: block;

}

Pressbook formats

Hello
After updating Pressbook Textbook download formats options disappeared. I'm using the pluging with wordpress with the last version.
Does anybody know how to solve this issue?
Thanks so Much
Aureliano

PBT 2.1.2 error: PBT cannot find a Pressbooks install

Brad,
I created a fresh install on a test site as described below, but received an error.

  • New WP 4.1.1 site and database, set to multisite
  • Installed PB 3.1.2 from GitHub release, and successfully created a test book
  • Installed PB 2.1.2 from GitHub release
  • Network Dashboard error: "PBT cannot find a Pressbooks install"
  • Also, the Pressbooks Textbook theme does not appear in Network Dashboard > Themes
    Let me know if you would like privileges to explore this public test site.

dashboard_ pressbookstest _pressbooks

thanks,
Jack

admin option to configure creative commons

Creative commons configurator plugin has filter hook to rewrite the message, currently this is solved in a child theme, but needs to move and be able to receive arguments.

/**
 * Completely replaces the CC text with best-practices for derivatives text
 * 
 * @param string $license_text
 * @return string The new, best practices CC text for derivatives
 */
function pressbooks_copyright_notice_to_cc_text( $license_text ) {
    // we want to replace the entirety of auto-generated text, so 
    $license_text = '';
    $blog = get_bloginfo('name');

    switch ( $blog ) {
        case "Introduction to Sociology":
            $attribution = "<a href='http://cnx.org/content/col11407/latest'>".$blog."</a>";
            $author = "Dr. William Little";
            break;

        default:
            $attribution = "an original";
            $author = "an author";
            break;
    }
    $extra_text = "This work is a derivative of ".$attribution." by <a href='http://www.rice.edu'>Rice University</a>, used under <a href='http://creativecommons.org/licenses/by/3.0/'>CC-BY 3.0</a>. "
        . "This derivative is licensed under <a href='http://creativecommons.org/licenses/by/4.0/'>CC-BY 4.0</a> by ".$author.".";
    return $extra_text;
}


add_filter( 'bccl_cc_license_text', 'pressbooks_copyright_notice_to_cc_text', 10, 1 );

Check minimum PB requirements before trying to load plugin

Hi, can you include this snippet (or something similar) above Line 403 in pressbooks-textbook.php please?

// Minimum PB requirements
if ( ! @include_once( WP_PLUGIN_DIR . '/pressbooks/compatibility.php' ) ) {
    add_action( 'admin_notices', function () {
        echo '<div id="message" class="error fade"><p>' . __( 'Cannot find Pressbooks install.', 'pressbooks' ) . '</p></div>';
    } );
    return;
}
elseif ( ! pb_meets_minimum_requirements() ) {
    return;
}

It's a new file that can be used for plugins that depend on the PB plugin. It will prevent PBT from running if a user upgrades and gets bitten by the PHP version change in the next release.

Check auth/permissions

After a 'copy book' button has been clicked

  • check if the user is authenticated
  • if no, retain the value of the book location when redirecting user to log in screen
  • check if the user is registered
  • if no, check if the site allows user registration
  • if yes, allow them to sign up
  • if user is logged in, check if the user has enough permissions to create a book

Table of Contents not public

PressBooks v.2.5.2
PressBooks Textbook v.1.2.13

Table of Contents (TOC) Title is displayed but nothing else in public view.
In admin view, TOC is displayed correctly.
PUBLIC:
toc-public

ADMIN:
toc-admin

Cut tags that correspond to WP releases

Would it be possible to tag master with tags that correspond to releases on wp.com?

That would make it easier to track releases from git, as opposed to wp.

Ordered List Rendering

A few issues with rendering ordered lists (and nested OLs) and the discrepancies between Pressbooks preview and browser rendering.

The following is the code used:

  1. Why do economists use the ceteris paribus assumption?
  2. In an analysis of the market for paint, an economist discovers the facts listed below. State whether each of these changes will affect supply or demand, and in what direction.
    1. There have recently been some important cost-saving inventions in the technology for making paint.
    2. Paint is lasting longer, so that property owners need not repaint as often.
    3. Because of severe hailstorms, many people need to repaint now.
    4. The hailstorms damaged several factories that make paint, forcing them to close down for several months.
  3. Many changes are affecting the market for oil. Predict how each of the following events will affect the equilibrium price and quantity in the market for oil. In each case, state how the event will affect the supply and demand diagram. Create a sketch of the diagram if necessary.
    1. Cars are becoming more fuel efficient, and therefore get more miles to the gallon.
    2. The winter is exceptionally cold.
    3. A major discovery of new oil is made off the coast of Norway.
    4. The economies of some major oil-using nations, like Japan, slow down.
    5. A war in the Middle East disrupts oil-pumping schedules.
    6. Landlords install additional insulation in buildings.
    7. The price of solar energy falls dramatically.
    8. Chemical companies invent a new, popular kind of plastic made from oil.

    A screenshot from the PressBooks Visual panel view of this code:
    image

    A screenshot from the rendered version (same in all major browsers) of this same code:
    image

    Issues
    The rendered browser version lacks hanging indents, and when nesting the lists there isn't enough space to differentiate between the two levels of hierarchy.

    Also, rendering seems to not like the lettered lists, and converts them all to numbers (e.g. a, b, c becomes 1.1, 1.2, 1.3) despite the inline code stating otherwise.

download tracking event code for Google Analytics Universal upgrade?

Brad, thanks for adding Google Analytics code for tracking download events. However, it's still not working for me, and I suspect that this may be caused by Google's recent upgrade from Classic to newer Universal Analytics:
https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

See also these references:
http://stackoverflow.com/questions/25506115/does-not-display-track-record-in-google-analytics
and
http://stackoverflow.com/questions/26754109/google-analytics-universal-event-tracking-code-not-working

in line 98, you suggested that Google Analytics users insert this code:

$tracking = "_gaq.push(['_trackEvent','exportFiles','Downloads','$file_class']);";

This version did not work for me, probably because my GA accounts have all been updated from Classic to Universal. My understanding is that newer event code should follow this general format:

ga('send', 'event', 'category', 'action', 'opt_label', opt_value, {'nonInteraction': 1});

But I can't figure out the correct syntax to insert into your code. My failed attempts looked like this:

$tracking = "_ga(['send','event','exportFiles','Downloads','$file_class']);";

Can you point me in the right direction? Thanks.

Opentextbook

I have installed Pressbook on my wordpress blog and installed PRESSBOOKS TEXTBOOKS.
When I activate opentexbook theme, the arrows next and back do not appear in the book.
Could you please tell me what to do?
WP version 4.4.1
Pressbook version 3.1.1
Pressbooks Textbook 2.1.1

It is not an error, it does not shows how to pass the pages (< >). I have to click Chapter by chapter
BEST WISHES,
AURELIANO

Create an empty book

After the 'copy book' button has been clicked and user authentication is checked

  • create a prompt for what to call the book (book uri)
  • create the new book, activate some default options
  • delete unwanted pages created by default during book creation process

Captions not in sync

PressBooks v.2.5.2
PressBooks Textbook v.1.2.13

Captions in Image editor remain when removed from Media Library image caption. In addition, adding captions in Media Library does not update captions of images already added to webpage.
captions in image details

Table over run in View Chapter mode

Webpage Read View - table appears to be non-responsive
table-opentextbook-theme

ePUB Export View - Table contents cropped
epub

ePUB 3 Export View - Table contents cropped
epub3

not seeing option for Textbook theme in WP PB install

I doubt this is a truly github worthy "issue" but I'm trying to get set up with the PressBooks TextBook plugin/theme.

I set up a multisite WordPress install and installed the PressBooks plugin successfully (I believe). I see the basic PB WP themes available and have created a book.

http://jeremydean.org/pressbooks/ananthologyofmyown/

http://jeremydean.org/pressbooks/ananthologyofmyown/chapter/chapter-1/

I've added the PB Textbook plugin and network activated it.

BUT I'm not seeing the "Textbook theme" available at the network or book appearance admin levels.

Again, apologies that this is not likely a bug/feature issue, but any support would be appreciated.

I work with professors who want to do have annotatable PressBooks and want to be able to properly guide them through the process.

Long URL overrun

Latest of PB, PBT, WP

Long URL wraps in editor but not in webpage output:
chapter three the clinical learning environment healthhealth

Two Different Book Info pages

The source of the issue is with the pressbooks-textbook plugin:

  1. starting on ../wp-admin/options-general.php?page=pressbooks-textbook-settings
  2. select Book Info link in "Two easy steps, using built-in functionality (recommended)
    Select your 'Copyright license' from the drop down menu in the Copyright section on the Book Info page."
  3. goes to a blank info page (/wp-admin/wp-admin/post-new.php?post_type=metadata) - saving this page will delete previous book info

mPDF options > two-level TOC ?

Current PDF export does not display 2 level TOC.

The Global Options - Enable a two-level TOC - applicable to mPDF TOC ?

Status:
Open Textbooks Theme Options enabled:
- Display table of contents
- Enable a two-level TOC

PressBooks Textbook Version 1.2.15
Pressbooks Version 2.6.5
Theme - Open Textbooks

possible to create valid child-theme of OpenTextbook?

Brad
I'm not an experienced coder, as you know, but I have managed to create WP child-themes in the past.

Is there something about pressbooks-textbook plugin that prevents me from successfully uploading a child-theme (or is it just my lack of skills?).

Here's the link to my attempted child-theme (with some modified style.css, also in prince export folder, for my publisher) https://github.com/JackDougherty/opentextbook-webwriting-child

Here's the "broken theme" error message I receive on PB
themes_ network_admin__pressbookstest _pressbooks

My workaround, which is not ideal, has been to clone and modify your entire plugin
https://github.com/JackDougherty/pressbooks-textbook/blob/master/README.md

curiously
Jack

Process for migration of features to Pressbooks core

We are looking into starting to migrate some features from Pressbooks Textbook into the core Pressbooks plugin so as to make them available to all users of Pressbooks. First and foremost is the MCE Table Editor (pressbooks/pressbooks#154) and the MCE Superscript and Subscript buttons (pressbooks/pressbooks#157). I have introduced a couple of commits into pressbooks/dev that bring the MCE Table Editor plugin into Pressbooks core—however, it causes an error when the current version of Pressbooks Textbook is installed and the Open Textbook theme is active. How would you like to coordinate this? I can submit a pull request which removes the table editor from Pressbooks Textbook, and then going forward as I migrate features from Textbook I can submit pull requests to handle the switch similarly. At this point the MCE Table Editor and the superscript and subscript buttons are the two features we are looking to move over. Thanks in advance for your thoughts on this. (FYI, @hughmcguire.)

Search and Import

Dear sir:

My name is Toni Devís.

I´m the founder of on-lingua.com. A libre web site for learning second languages.

I want to use PressBooks with my books. And also pressbooks texbooks in one of my installation. Because i want to allow the people to download and share the content.

We have content in many languages, and we hope we will open the site soon. But we have now a problem with your plugin, because it´s easy to download our content from other site.
<<
Search against the following domains.
(You can manage the list of domains to search against at any time:)
Reminder: You are responsible for adhering to all licensing and copyright restrictions.

That is not a problem for the open content, but sometimes we have restrictet content (because we need also charge money some times to our users) . If somebody from other installation can download our premium content, we have not busines. And i think is it not fear for the users if they do not want to share

Can you make a modification and just autorice download a book or chapter if the material is under Creative Commons license, please and if is with copyright do not allow to download?.

thanks

EPUB and MOBI EXPORT errors

WP 4.4.1, BP 3.1.2, PBT 2.1.2

Some interesting errors output on EPUB and MOBI exports, that I have not seen before:

MOBI - Amazon kindlegen(Linux) V2.9 build 1028-0897292

CSS style specified in content is not supported by Kindle readers. Removing the CSS property: 'max-width' in file: /tmp/mobi-d98Che/OEBPS/open-textbooks.css

Please use % or refer Kindle Publishing Guidelines about usage of property: 'line-height' in file: /tmp/mobi-d98Che/OEBPS/chapter-001-slug-1-introduction.xhtml

EPUB3

ERROR(RSC-007): /var/www/html/wp-content/uploads/sites/3/exports/e-Textbook-Reflections-1453987136._3.epub/OEBPS/open-textbooks.css(23,9): Referenced resource could not be found in the EPUB

bcc-box respresentation in mPDF output

div class="bcc-box bcc-success"
div class="bcc-box bcc-info"

Aforementioned code is displayed correctly in webpage output
web_kt
and ePUB export
epub_kt

However, mPDF output looses CSS in Title
mpdf_kt

Is this a limitation of mPDF that will display correctly using PRINCE?

Thanks,
Steve

Various export issues

Wordpress version 4.42
Pressbooks version 2.5
Pressbooks textbooks version 1.28

Issues
A) Cell colours in tables do not render in:

  1. standard display: https://drive.google.com/file/d/0B90-KHEjN4KVU2NBV1dYUG0walU/view?usp=sharing
  2. odt export: https://drive.google.com/file/d/0B90-KHEjN4KVSGd2WXg1cDBGV1k/view?usp=sharing

B) Table width scaled to fit table contents, not page width:

  1. epub: https://drive.google.com/file/d/0B90-KHEjN4KVYzdva2hvOXN5UVE/view?usp=sharing
  2. odt: https://drive.google.com/file/d/0B90-KHEjN4KVak9wcGd5OGMwQlE/view?usp=sharing
  3. Xhtml: https://drive.google.com/file/d/0B90-KHEjN4KVRFVESkRqbjNjanM/view?usp=sharing

C) Footnotes not rendering in xhtml version

D)

    lists not rendering in mpdf export:

    1. https://drive.google.com/file/d/0B90-KHEjN4KVeDM4Nm9PV0RObms/view?usp=sharing

    E) Figures not appearing in odt export
    blob:https://drive.google.com/351c665b-a970-4066-9908-82b382db6f14

Custom Text box CSS not displayed

I can create custom Textbook styles buttons for boxes, with new titles and CSS, I loose the background CSS (text is displayed correctly with white title):

.au-creative {
background-color: #E8FFFC;
}

.au-field {
background-color: #F7F7F9;
}

.au-box.au-creative h3 {
background-color: #6D97FB;
}

.au-box.au-field h3 {
background-color: #008080;
}

For some reason, bcc-success -highlight -info are linked in ways that I am missing.
From what I can understand, the aforementioned files work together to produce a textbook style:

pressbooks-textbook/symbionts/mce-textbook-buttons/assets/css/editor-style.css

pressbooks-textbook/symbionts/mce-textbook-buttons/assets/js/textbook-buttons.js

pressbooks-textbook/themes-book/opentextbook/style.css

PBT error on update

Wordpress 4.3.1
Pressbooks 2.7.2
Pressbooks Textbook 1.2.16

newver

Updating to 2.0 creates the following error:
"PBT cannot find a Pressbooks install."

Resolutions?

PHP error message when installing Pressbooks-Textbook v.2

Re-posted from (pressbooks/pressbooks#303)

MESSAGE
"... can be overridden, so long as it is remains above PHP 5.4.0. Add a line to wp-config.php as follows: $pb_minimum_php = 5.4.0; "

Needs quotes ???

 $pb_minimum_php = '5.4.0';

. ' If you suspect this is the case, it can be overridden, so long as it is remains above PHP 5.4.0. Add a line to wp-config.php as follows: $pb_minimum_php = 5.4.0; ', 'pressbooks-textbook' ) . '</p></div>';

Search and import not importing

I'm running Wordpress 4.2.2 with Pressbooks 2.5 and PB Textbooks 1.2.8.
I'm using the search and import to search titles of chapters and books and that produces a list of chapters to import. I then select the chapters I'm interested and hit the start button. That quite quickly jumps me to the text organize dashboard page of the book but the chapters I selected for import are not visible in the list of posts included in the book.
I've checked my apache logs and found the following in the error log for the import part of the search and import transaction:
[Sat Jun 20 12:16:16.746234 2015] [:error] [pid 27595] [client 64.134.28.106:50671] [ PBT Search and Import Log ]\nArray\n(\n [time] => Sat Jun 20 12:16:16 2015\n [site_url] => http://samplebook2.lawbooks.cali.org\n [0] => Array\n (\n [171] => Array\n (\n [type] => chapter\n [license] => cc-by-sa\n [author] => J.H. Verkerke\n [link] => http://verkerkecontractsone.lawbooks.cali.org/chapter/contract-formation/\n )\n\n )\n\n)\nTried to import a post from this PressBooks instance and succeeded :), referer: http://samplebook2.lawbooks.cali.org/wp-admin/admin.php?page=api_search_import
Any ideas?

missing left running header in PDF export?

Brad - Thanks for responding to my recent questions, and here's a new one brought to my attention by the U of Michigan Press production team.

The Open TextBooks theme left running header appears to be missing in PDF export. See screenshot comparison below of TextBooks vs Luther themes, using PB master branch and PB Textbook dev branch (as of Oct 25th). Perhaps it has something to do with this recent commit by Hugh?
pressbooks/pressbooks@86893e9

leftrunningheadissue

PDF download error on Visit Site page

Settings > PB Textbook > Redistribute tab > Yes. I would like the latest export files to be available on the homepage for free, to everyone.

  1. Export to PDF
  2. Visit Site - Download PDF
  3. Export > Trash PDF
    4.Export > Export to PDF (mPDF)
  4. Visit Site
    dnloadformats
  5. Download PDF > error: File not found: CREATIVE-CLINICAL-TEACHING-IN-THE-HEALTH-PROFESSIONS-1436712639.pdf

plugin v 1.2.7 cannot be activated due to fatal error

Hi Brad,

I received the same fatal error on two test sites when attempting to update Pressbooks Textbook to the newest v 1.2.7, with PB v 2.4.5 (from WP repo) and WP 4.2.2.

Fatal error: Cannot redeclare class PressBooks\Import\Import in /var/www/pressbookstest/wp-content/plugins/pressbooks/includes/modules/import/class-pb-import.php on line 17

Did I screw up something obvious?
Jack

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.