Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise How the Options pages work #106

Closed
hughmcguire opened this issue Mar 18, 2015 · 8 comments

Comments

@hughmcguire
Copy link
Member

commented Mar 18, 2015

Hi @bdolor I'm assigning this to you just because you are working on something related to this request already ... and I just looked at how it works and all I can say is: ug. (and, @greatislander is working on some other things).

So, how I would propose this should work is:

  1. User implements his/her options (in GLOBAL, PDF, EBOOK and/or WEB)
  2. This generates a CSS file snippet (one for each format), reflecting the options chosen by the user for this book probably with "!important" appended to each declaration)
  3. These 3 CSS file snippets (PDF, EBOOK, WEB) get injected into the correct CSS-file on export
  4. Then... on export a "customized" CSS sheet is stuffed into the various export protocols ...

So then the routine is:
-- read options page
-- generate CSS snippets
-- inject on export

which seems much more sane than the individualized "if this option, then run this routine; if this other option, then run this other routine"

thoughts?

@hughmcguire

This comment has been minimized.

Copy link
Member Author

commented Mar 18, 2015

added edit above, regarding: ug:
"this has nothing to do with what you guys did ... but rather how the process works as currently built!!"

@hughmcguire

This comment has been minimized.

Copy link
Member Author

commented Mar 20, 2015

consider this as the official assignment of this ticket to @bdolor.

@bdolor

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2015

The good news is that 10 out of the 14 export options that a user can choose (excluding the one web output option) already generate CSS snippets that get appended to the relevant CSS export file.

Of the four options that are left, two of those can't be controlled with CSS: Compress images and footnotes style invoke calls to PHP functions.
https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/epub/class-pb-epub201.php#L1658
https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/xhtml/class-pb-xhtml11.php#L288

The remaining two options generate HTML. Enable a two-level TOC and display copyright license options could potentially be controlled, effectively, with the addition of a CSS snippet.

Knowing that there are only two potential candidates, would you still like to proceed?

WEB output is exceptional both in that the current TOC collapse functionality relies on Javascript, and WordPress provides a sufficient mechanism for enqueuing scripts/styles which works for CSS files too.
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L79

GLOBAL OPTIONS

  1. display page numbers (CSS) https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1110
    https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1224
  2. enable two level TOC (HTML)
    https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/xhtml/class-pb-xhtml11.php#L729
  3. display copyright license (HTML)
    https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/xhtml/class-pb-xhtml11.php#L725

PDF OPTIONS
4. page size (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1131
5. display crop marks (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1163
6. enable hyphenation (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1169
7.paragraph separation (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1179
8.blank pages (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1183
9.table of contents (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1189
10.footnotes style (PHP)
https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/xhtml/class-pb-xhtml11.php#L288
11.widows (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1194
12.orphans (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1197

EBOOKS
13.paragraph separation (CSS)
https://github.com/pressbooks/pressbooks/blob/dev/themes-book/pressbooks-book/functions.php#L1234
14.compress images (PHP)
https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/epub/class-pb-epub201.php#L1655

@greatislander greatislander added this to the Q3 2015 milestone May 14, 2015

@hughmcguire

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2015

@greatislander let's discuss this ...

@greatislander greatislander modified the milestone: Q3 2015 Sep 9, 2015

@hughmcguire

This comment has been minimized.

Copy link
Member Author

commented Apr 20, 2016

related to/dependent on #383 ...

@hughmcguire

This comment has been minimized.

Copy link
Member Author

commented Jun 21, 2016

some PDF options we need to add:
body {font-size;line-height;}
@page:left {margin-top; margin-right; margin-bottom; margin-left;}
@page:right {margin-top; margin-right; margin-bottom; margin-left;}

greatislander added a commit that referenced this issue Jun 21, 2016
greatislander added a commit that referenced this issue Jun 22, 2016
greatislander added a commit that referenced this issue Jun 22, 2016

@greatislander greatislander added this to the v3.7 milestone Jul 19, 2016

@greatislander

This comment has been minimized.

Copy link
Collaborator

commented Jul 19, 2016

Global

  • Two-level TOC (copy update)
  • Language support (copy update)
  • Copyright (clarify functionality)
  • Chapter types (eliminate theme option, make available on all books: standard, numberless)

Web

  • Black & white webbook
  • Collapsible TOC (eliminate theme option, enable automatically where needed)
  • a11y font size (eliminate theme option, make available everywhere)

PDF

  • Body font size
  • Body line height
  • Black & white PDF
  • Custom page size
  • Section openings (copy update)
  • Increase font size (eliminate theme option, superseded by body font size)
  • Margins
  • Image resolution
  • Half title
  • Footnote style (copy update)
  • Drop caps
  • Highlight links
  • Running heads and feet (use basic templating to determine output)

Ebook

  • Black & white Ebook
greatislander added a commit that referenced this issue Aug 9, 2016
greatislander added a commit that referenced this issue Aug 9, 2016
@greatislander

This comment has been minimized.

Copy link
Collaborator

commented Aug 10, 2016

Closing this in favour of separate issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.