From 08c77b6f2c12f854680fcfd411a1cc4bbfccb596 Mon Sep 17 00:00:00 2001 From: bobbyiliev Date: Sun, 12 Oct 2025 17:47:48 +0300 Subject: [PATCH 1/2] Switch to ibis-next --- .github/workflows/ibis.yml | 36 +++-- .github/workflows/pandoc.yml | 25 --- ebook/en/assets/highlight.codeblock.min.css | 1 + ebook/en/assets/style.css | 166 ++++++++++++++++++++ ebook/en/epub.yml | 14 -- 5 files changed, 189 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/pandoc.yml create mode 100644 ebook/en/assets/highlight.codeblock.min.css create mode 100644 ebook/en/assets/style.css delete mode 100644 ebook/en/epub.yml diff --git a/.github/workflows/ibis.yml b/.github/workflows/ibis.yml index ada7a37..d193b06 100644 --- a/.github/workflows/ibis.yml +++ b/.github/workflows/ibis.yml @@ -1,21 +1,29 @@ -name: Ibis eBook Generation +name: Build eBooks + on: push: - branches: - - main + branches: [main] + +permissions: + contents: write jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@main - with: - fetch-depth: '0' - - name: Build Ibis Export Files - uses: bobbyiliev/ibis-build-action@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - IBIS_PATH: './ebook/en/' - IBIS_BRANCH: 'main' - EMAIL: 'bobby@bobbyiliev.com' - COMMIT_MESSAGE: 'Updated Ibis Exorted Files' + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build eBooks with Ibis Next + uses: bobbyiliev/ibis-build-action@v2.0.0 + with: + ibis_path: "./ebook/en" + ibis_branch: "main" + email: "bobby@bobbyiliev.com" + commit_message: "📚 Updated eBook files" + php_version: "8.2" + formats: "pdf,pdf-dark,epub,sample,sample-dark" + skip_push: "false" diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml deleted file mode 100644 index 43466aa..0000000 --- a/.github/workflows/pandoc.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Pandoc eBook Generation -on: - workflow_run: - workflows: ["Ibis eBook Generation"] - types: - - completed - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - with: - fetch-depth: "0" - - name: Build Pandoc Export Files - uses: mph7/pandoc-build-action@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PANDOC_PATH: "./ebook/en/content/" - YML_PATH: "./ebook/en/epub.yml" - EXPORT_PATH: "./ebook/en/export/" - EXPORTED_FILE: "introduction-to-bash-scripting.epub" - PANDOC_BRANCH: "main" - EMAIL: "bobby@bobbyiliev.com" - COMMIT_MESSAGE: "Updated Pandoc Exported Files" diff --git a/ebook/en/assets/highlight.codeblock.min.css b/ebook/en/assets/highlight.codeblock.min.css new file mode 100644 index 0000000..0c84885 --- /dev/null +++ b/ebook/en/assets/highlight.codeblock.min.css @@ -0,0 +1 @@ +.hljs{display:block;background:white;padding:.5em;color:#333333;overflow-x:auto}.hljs-comment,.hljs-meta{color:#969896}.hljs-variable,.hljs-template-variable,.hljs-strong,.hljs-emphasis,.hljs-quote{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#d73a49}.hljs-literal,.hljs-symbol,.hljs-bullet,.hljs-attribute{color:#0086b3}.hljs-section,.hljs-name{color:#63a35c}.hljs-tag{color:#333333}.hljs-title,.hljs-attr,.hljs-selector-id,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo{color:#6f42c1}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}.hljs-number{color:#005cc5}.hljs-string{color:#032f62} \ No newline at end of file diff --git a/ebook/en/assets/style.css b/ebook/en/assets/style.css new file mode 100644 index 0000000..fc5ff49 --- /dev/null +++ b/ebook/en/assets/style.css @@ -0,0 +1,166 @@ +/* EPUB Styles for 101 Linux Commands eBook */ + +body { + font-family: 'Times New Roman', Times, serif; + font-size: 16px; + line-height: 1.6; + margin: 0; + padding: 20px; + color: #333; +} + +h1 { + font-size: 32px; + font-weight: bold; + margin-top: 40px; + margin-bottom: 20px; + page-break-before: always; + border-bottom: 2px solid #1a1c3e; + padding-bottom: 10px; + color: #1a1c3e; +} + +h2 { + font-size: 28px; + font-weight: bold; + margin-top: 30px; + margin-bottom: 15px; + page-break-before: always; + color: #1a1c3e; +} + +h3 { + font-size: 24px; + font-weight: bold; + margin-top: 25px; + margin-bottom: 10px; + color: #333; +} + +h4, h5, h6 { + font-size: 20px; + font-weight: bold; + margin-top: 20px; + margin-bottom: 8px; + color: #333; +} + +p { + margin-bottom: 15px; + text-align: justify; +} + +ul, ol { + margin-bottom: 15px; + padding-left: 30px; +} + +li { + margin-bottom: 5px; +} + +pre { + background-color: #f5f5f5; + border: 1px solid #ddd; + border-radius: 4px; + padding: 15px; + margin: 20px 0; + overflow-x: auto; + font-family: 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.4; +} + +code { + font-family: 'Courier New', Courier, monospace; + font-size: 14px; + background-color: #f5f5f5; + padding: 2px 4px; + border-radius: 3px; + color: #A5215D; +} + +pre code { + background: none; + padding: 0; + color: #2d2d2d; +} + +blockquote { + margin: 20px 0; + padding: 15px 20px; + border-left: 4px solid #ccc; + background-color: #f9f9f9; + font-style: italic; +} + +table { + width: 100%; + border-collapse: collapse; + margin: 20px 0; +} + +th, td { + border: 1px solid #ddd; + padding: 8px 12px; + text-align: left; +} + +th { + background-color: #f5f5f5; + font-weight: bold; +} + +a { + color: #1a1c3e; + text-decoration: underline; +} + +a:hover { + color: #333; +} + +img { + max-width: 100%; + height: auto; + display: block; + margin: 20px auto; +} + +/* Special styles for aside blocks */ +.aside { + margin: 20px 0; + padding: 15px; + border-radius: 5px; + border-left: 4px solid; +} + +.aside.note { + background-color: #e3f2fd; + border-left-color: #2196f3; +} + +.aside.tip { + background-color: #e8f5e8; + border-left-color: #4caf50; +} + +.aside.warning { + background-color: #fff3e0; + border-left-color: #ff9800; +} + +.aside.danger { + background-color: #ffebee; + border-left-color: #f44336; +} + +/* Styling for command tables */ +.command-table th { + background-color: #1a1c3e; + color: white; +} + +.command-table td { + font-family: 'Courier New', Courier, monospace; +} diff --git a/ebook/en/epub.yml b/ebook/en/epub.yml deleted file mode 100644 index c18e03d..0000000 --- a/ebook/en/epub.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# Generate an ePub by running: -# pandoc content/*.md epub.yml -o export/introduction-to-bash-scripting.epub -title: Introduction to Bash Scripting -author: Bobby Iliev -cover-image: ./ebook/en/assets/cover.jpg -rights: MIT License -lang: en-US -tags: [bash, Unix, Linux] - -# Filter preferences: -# - pandoc-crossref -linkReferences: true ---- \ No newline at end of file From 130d53d776d853af06609434ae551a6ad81fdd06 Mon Sep 17 00:00:00 2001 From: bobbyiliev Date: Sun, 12 Oct 2025 17:51:42 +0300 Subject: [PATCH 2/2] Fix failing pdf builds --- ebook/en/ibis.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ebook/en/ibis.php b/ebook/en/ibis.php index 2eb0509..6334110 100644 --- a/ebook/en/ibis.php +++ b/ebook/en/ibis.php @@ -11,6 +11,21 @@ */ 'author' => 'Bobby Iliev', + /** + * CSS inline style for the page header. + * If you want to skip header, comment the line + */ + 'header' => 'font-style: italic; text-align: right; border-bottom: solid 1px #808080;', + + /** + * Cover page image configuration. + */ + 'cover' => [ + 'position' => 'position: absolute; left:0; right: 0; top: -.2; bottom: 0;', + 'dimensions' => 'width: 210mm; height: 297mm; margin: 0;', + 'image' => 'cover.jpg', + ], + /** * The list of fonts to be used in the different themes. */