Skip to content

Commit

Permalink
Merge pull request #640 from electricbookworks/merged-html
Browse files Browse the repository at this point in the history
Merge HTML for PDF outputs
  • Loading branch information
arthurattwell authored Nov 11, 2022
2 parents 3126afc + 712f6d7 commit da82526
Show file tree
Hide file tree
Showing 167 changed files with 3,169 additions and 2,525 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check build
on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7

- name: Install Bundler
run: gem install bundler

- name: Bundle install
run: bundle install

- name: Build with Jekyll
run: |
bundle exec jekyll build
68 changes: 31 additions & 37 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@
# in your browser (i.e. an online development environment).
# See https://www.gitpod.io/docs/config-docker

FROM ubuntu:20.04
FROM gitpod/workspace-ruby-2

# Set default locale for the environment
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Install dependencies required to set timezone
RUN apt-get update && apt-get install -y \
locales libcurl4 curl

# Set timezone
RUN ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime

# Add node source for nodejs version 12, instead of Ubuntu installed node (version 10)
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash
# Need to be root to apt install
USER root

# Main dependency installation
RUN apt-get update && apt-get install -y \
RUN sudo apt-get update && apt-get install -y \
software-properties-common \
make \
gcc \
Expand All @@ -33,13 +21,10 @@ RUN apt-get update && apt-get install -y \
libffi-dev \
libreadline-dev \
zlib1g-dev \
nodejs \
ruby \
ruby-dev \
graphicsmagick

# Dependencies specifically for Puppeteer on unix
RUN apt-get install -y \
RUN sudo apt-get install -y \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
Expand All @@ -54,8 +39,13 @@ RUN apt-get install -y \
libxfixes3 \
libxrandr2

# Clear apt cache to make image smaller
RUN rm -rf /var/lib/apt/lists/*
# # Clear apt cache to make image smaller
RUN sudo apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*

# Add node source for new nodejs, instead of old Ubuntu-installed node.
# That install script also prompts to do sudo apt-get install -y nodejs
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash
RUN sudo apt-get install -y nodejs

# Install PrinceXML for printing to PDF
RUN wget https://www.princexml.com/download/prince_11.4-1_ubuntu18.04_amd64.deb && \
Expand All @@ -65,24 +55,28 @@ RUN wget https://www.princexml.com/download/prince_11.4-1_ubuntu18.04_amd64.deb
RUN wget https://github.com/jgm/pandoc/releases/download/2.5/pandoc-2.5-1-amd64.deb && \
dpkg -i pandoc-2.5-1-amd64.deb

# Pin RubyGems to 3.0.8
# (https://github.com/rubygems/rubygems/issues/3068)
RUN gem update --system 3.0.8 --no-document

# Install Bundler and latest EBT-compatible Jekyll
RUN gem install bundler jekyll:3.9.2

# Update npm
RUN npm install -g npm@latest

# Install Gulp cli app
RUN npm install --global gulp-cli

# Copy our project files to the container
COPY . .

# Install gems in Gemfile
RUN bundle install

# Install modules in package.json
RUN npm install
# Switch to the gitpod user
USER gitpod

# Set paths for Ruby gems
RUN echo '# Define Ruby Gems path' >> ~/.bashrc
RUN echo 'export GEM_HOME="$HOME/.rvm/gems/ruby-2.7.6"' >> ~/.bashrc
RUN echo 'export PATH="$HOME/.rvm/gems/ruby-2.7.6:$PATH"' >> ~/.bashrc
RUN bash -lc "source ~/.bashrc"

# Install gems.
# Note we do this here, not in a gitpod `init` task
# because changes to files outside /workspace,
# like gem installs, are lost in prebuilds, which
# only save the /workspace. We could also try installing
# these dependencies in a `before` task, but that would
# run twice, potentially making builds slower.
# (https://www.gitpod.io/docs/configure/projects/prebuilds#workspace-directory-only)
COPY Gemfile .
RUN bash -lc "bundle install"
6 changes: 6 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
image:
file: .gitpod.Dockerfile

tasks:
- name: Setup and show EB commands
init: |
npm install
npm run eb
ports:
- name: Electric Book server
description: A web output of your Electric Book project
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ source 'https://rubygems.org'

# GitHub Pages recommends using the github-pages gem to ensure
# that your site will build exactly as it will on GitHub Pages.
# This gem includes the current version of Jekyll used on GitHub Pages.
# This gem includes the current version of Jekyll used on GitHub Pages,
# along with the gems listed here:
# https://github.com/github/pages-gem/blob/master/lib/github-pages/dependencies.rb
# If you prefer to control your version of Jekyll (recommended if you
# are not relying on GitHub Pages), then comment out the following line
# and uncomment the Jekyll version above.
Expand Down
2 changes: 1 addition & 1 deletion _api/content/index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _api/content/samples/00-05-contents-page/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":11,"url":"samples/00-05-contents-page.html","title":"Contents – Samples","description":"Sample content demonstrating Electric Book support for a wide range of book features.","content":"Contents Frontmatter Half title page Previous publications Title page Copyright Contents Dedication Epigraph Frontispiece Other frontmatter Text Plain text Headings Quotes Blockquotes Pullquotes Quote sources Lists Simple lists Chapter tables of contents Bibliographies Definitions and glossaries Tables Boxes Notes Dividers Poetry Questions and quizzes Images Plain images Figures Code and mathematics Code Mathematics Interactivity Links and buttons Video Audio iFrames Slides Indexes Traditional index Dynamic index"}
{"id":11,"url":"samples/00-05-contents-page.html","title":"Contents – Samples","description":"Sample content demonstrating Electric Book support for a wide range of book features.","content":"Contents Frontmatter Half title page Previous publications Title page Copyright Contents Dedication Epigraph Frontispiece Other frontmatter Text Plain text I II III Headings Quotes Blockquotes Pullquotes Quote sources Lists Simple lists Chapter tables of contents Bibliographies Definitions and glossaries Tables Boxes Notes Dividers Poetry Questions and quizzes Images Plain images Figures Code and mathematics Code Mathematics Interactivity Links and buttons Video Audio iFrames Slides Indexes Traditional index Dynamic index"}
1 change: 1 addition & 0 deletions _api/content/samples/01-01-plain-text-1/index.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _api/content/samples/01-01-plain-text-2/index.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _api/content/samples/01-01-plain-text-3/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":19,"url":"samples/01-01-plain-text-3.html","title":"Plain text – Samples","description":"Sample content demonstrating Electric Book support for a wide range of book features.","content":"III. I slept at Baker Street that night, and we were engaged upon our toast and coffee in the morning when the King of Bohemia rushed into the room. “You have really got it!” he cried, grasping Sherlock Holmes by either shoulder and looking eagerly into his face. “Not yet.” “But you have hopes?” “I have hopes.” “Then, come. I am all impatience to be gone.” “We must have a cab.” “No, my brougham is waiting.” “Then that will simplify matters.” We descended and started off once more for Briony Lodge. “Irene Adler is married,” remarked Holmes. “Married! When?” “Yesterday.” “But to whom?” “To an English lawyer named Norton.” “But she could not love him.” “I am in hopes that she does.” “And why in hopes?” “Because it would spare your Majesty all fear of future annoyance. If the lady loves her husband, she does not love your Majesty. If she does not love your Majesty, there is no reason why she should interfere with your Majesty’s plan.” “It is true. And yet–Well! I wish she had been of my own station! What a queen she would have made!” He relapsed into a moody silence, which was not broken until we drew up in Serpentine Avenue. The door of Briony Lodge was open, and an elderly woman stood upon the steps. She watched us with a sardonic eye as we stepped from the brougham. “Mr. Sherlock Holmes, I believe?” said she. “I am Mr. Holmes,” answered my companion, looking at her with a questioning and rather startled gaze. “Indeed! My mistress told me that you were likely to call. She left this morning with her husband by the 5:15 train from Charing Cross for the Continent.” “What!” Sherlock Holmes staggered back, white with chagrin and surprise. “Do you mean that she has left England?” “Never to return.” “And the papers?” asked the King hoarsely. “All is lost.” “We shall see.” He pushed past the servant and rushed into the drawing-room, followed by the King and myself. The furniture was scattered about in every direction, with dismantled shelves and open drawers, as if the lady had hurriedly ransacked them before her flight. Holmes rushed at the bell-pull, tore back a small sliding shutter, and, plunging in his hand, pulled out a photograph and a letter. The photograph was of Irene Adler herself in evening dress, the letter was superscribed to “Sherlock Holmes, Esq. To be left till called for.” My friend tore it open and we all three read it together. It was dated at midnight of the preceding night and ran in this way: “MY DEAR MR. SHERLOCK HOLMES,–You really did it very well. You took me in completely. Until after the alarm of fire, I had not a suspicion. But then, when I found how I had betrayed myself, I began to think. I had been warned against you months ago. I had been told that if the King employed an agent it would certainly be you. And your address had been given me. Yet, with all this, you made me reveal what you wanted to know. Even after I became suspicious, I found it hard to think evil of such a dear, kind old clergyman. But, you know, I have been trained as an actress myself. Male costume is nothing new to me. I often take advantage of the freedom which it gives. I sent John, the coachman, to watch you, ran up stairs, got into my walking-clothes, as I call them, and came down just as you departed. “Well, I followed you to your door, and so made sure that I was really an object of interest to the celebrated Mr. Sherlock Holmes. Then I, rather imprudently, wished you good-night, and started for the Temple to see my husband. “We both thought the best resource was flight, when pursued by so formidable an antagonist; so you will find the nest empty when you call to-morrow. As to the photograph, your client may rest in peace. I love and am loved by a better man than he. The King may do what he will without hindrance from one whom he has cruelly wronged. I keep it only to safeguard myself, and to preserve a weapon which will always secure me from any steps which he might take in the future. I leave a photograph which he might care to possess; and I remain, dear Mr. Sherlock Holmes, “Very truly yours, “IRENE NORTON, née ADLER.” “What a woman–oh, what a woman!” cried the King of Bohemia, when we had all three read this epistle. “Did I not tell you how quick and resolute she was? Would she not have made an admirable queen? Is it not a pity that she was not on my level?” “From what I have seen of the lady she seems indeed to be on a very different level to your Majesty,” said Holmes coldly. “I am sorry that I have not been able to bring your Majesty’s business to a more successful conclusion.” “On the contrary, my dear sir,” cried the King; “nothing could be more successful. I know that her word is inviolate. The photograph is now as safe as if it were in the fire.” “I am glad to hear your Majesty say so.” “I am immensely indebted to you. Pray tell me in what way I can reward you. This ring–” He slipped an emerald snake ring from his finger and held it out upon the palm of his hand. “Your Majesty has something which I should value even more highly,” said Holmes. “You have but to name it.” “This photograph!” The King stared at him in amazement. “Irene’s photograph!” he cried. “Certainly, if you wish it.” “I thank your Majesty. Then there is no more to be done in the matter. I have the honour to wish you a very good-morning.” He bowed, and, turning away without observing the hand which the King had stretched out to him, he set off in my company for his chambers. And that was how a great scandal threatened to affect the kingdom of Bohemia, and how the best plans of Mr. Sherlock Holmes were beaten by a woman’s wit. He used to make merry over the cleverness of women, but I have not heard him do it of late. And when he speaks of Irene Adler, or when he refers to her photograph, it is always under the honourable title of the woman."}
1 change: 0 additions & 1 deletion _api/content/samples/01-01-plain-text/index.json

This file was deleted.

Loading

0 comments on commit da82526

Please sign in to comment.