public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-DecSpecification/release/1.27][Patch v2] Add Gitbook Action to publish HTML, PDF, EPUB, and MOBI
@ 2020-11-13  5:15 Michael D Kinney
  2020-11-13 22:33 ` [edk2-devel] " Laszlo Ersek
  0 siblings, 1 reply; 2+ messages in thread
From: Michael D Kinney @ 2020-11-13  5:15 UTC (permalink / raw)
  To: devel

Add Gitbook Action to publish this document in the
gh-pages branch of the same repository in HTML, PDF,
EPUB, and MOBI formats.  The draft and release
versions of the documents are published in different
directories of the gh-pages branch so all published
versions are available for download and online
viewing.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .bookignore                          |  3 +++
 .github/workflows/gitbook-action.yml | 39 ++++++++++++++++++++++++++++
 .gitignore                           | 10 +++----
 book.json                            | 16 ++++++------
 styles/epub.css                      |  8 ++++++
 styles/mobi.css                      |  8 ++++++
 styles/pdf.css                       |  8 ++++++
 styles/website.css                   |  8 ++++++
 8 files changed, 87 insertions(+), 13 deletions(-)
 create mode 100644 .bookignore
 create mode 100644 .github/workflows/gitbook-action.yml

diff --git a/.bookignore b/.bookignore
new file mode 100644
index 0000000..ed716f0
--- /dev/null
+++ b/.bookignore
@@ -0,0 +1,3 @@
+/.github
+.gitignore
+.bookignore
diff --git a/.github/workflows/gitbook-action.yml b/.github/workflows/gitbook-action.yml
new file mode 100644
index 0000000..917b0d7
--- /dev/null
+++ b/.github/workflows/gitbook-action.yml
@@ -0,0 +1,39 @@
+name: 'Gitbook Action Build'
+on:
+  push:
+    branches:
+      - master
+      - release/*
+  workflow_dispatch:
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Checkout action
+      uses: actions/checkout@v2
+    - name: Get Branch
+      run: |
+        raw=$(git branch -r --contains ${{ github.ref }})
+        branch=${raw/  origin\/}
+        pubdir=${branch/master/draft}
+        pubdir=${pubdir////-}
+        echo "ON_PUSH_BRANCH_NAME=$branch" >> $GITHUB_ENV
+        echo "ON_PUSH_PUBDIR=$pubdir" >> $GITHUB_ENV
+    - name: Gitbook Action
+      uses: zanderzhao/gitbook-action@v1.2.4
+      with:
+        token: ${{secrets.GITBOOK_ACTION_PERSONAL_TOKEN}}
+        source_branch: ${{env.ON_PUSH_BRANCH_NAME}}
+        publish_branch: gh-pages
+        publish_dir: ${{env.ON_PUSH_PUBDIR}}
+        publish_remove_last_build: true
+        gitbook_pdf: true
+        gitbook_pdf_dir: /
+        gitbook_pdf_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
+        gitbook_epub: true
+        gitbook_epub_dir: /
+        gitbook_epub_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
+        gitbook_mobi: true
+        gitbook_mobi_dir: /
+        gitbook_mobi_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
diff --git a/.gitignore b/.gitignore
index 1a366fb..e9c50d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,12 +5,12 @@
 ## Dependency directory
 ## Commenting this out is preferred by some people, see
 ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git
-node_modules
+/node_modules
 
 # Book build output
-_book
+/_book
 
 # eBook build output
-*.epub
-*.mobi
-*.pdf
\ No newline at end of file
+/book.epub
+/book.mobi
+/book.pdf
\ No newline at end of file
diff --git a/book.json b/book.json
index 45f99c9..caaa81a 100644
--- a/book.json
+++ b/book.json
@@ -1,9 +1,9 @@
-{
-  "variables" : {
-    "title"   : "EDK II Package Declaration (DEC) File Format Specification",
-    "version" : "Revision 1.27"
-  },
-
-  "plugins": ["puml"],
-  "pluginsConfig": {}
+{
+  "variables" : {
+    "title"   : "EDK II Package Declaration (DEC) File Format Specification",
+    "version" : "Revision 1.27"
+  },
+
+  "plugins": ["puml-aleung"],
+  "pluginsConfig": {}
 }
diff --git a/styles/epub.css b/styles/epub.css
index be6b609..87d4f8f 100644
--- a/styles/epub.css
+++ b/styles/epub.css
@@ -1,3 +1,11 @@
+p {
+    font-family: sans, sans-serif, Ariel;
+}
+
+body {
+    font-family: sans, sans-serif, Ariel;
+}
+
 h1 {
     color: #0860A8;
     font-weight: normal;
diff --git a/styles/mobi.css b/styles/mobi.css
index db1ca60..0d85d04 100644
--- a/styles/mobi.css
+++ b/styles/mobi.css
@@ -1,3 +1,11 @@
+p {
+    font-family: sans, sans-serif, Ariel;
+}
+
+body {
+    font-family: sans, sans-serif, Ariel;
+}
+
 h1 {
     color: #0860A8;
     font-weight: bold;
diff --git a/styles/pdf.css b/styles/pdf.css
index be6b609..87d4f8f 100644
--- a/styles/pdf.css
+++ b/styles/pdf.css
@@ -1,3 +1,11 @@
+p {
+    font-family: sans, sans-serif, Ariel;
+}
+
+body {
+    font-family: sans, sans-serif, Ariel;
+}
+
 h1 {
     color: #0860A8;
     font-weight: normal;
diff --git a/styles/website.css b/styles/website.css
index be6b609..87d4f8f 100644
--- a/styles/website.css
+++ b/styles/website.css
@@ -1,3 +1,11 @@
+p {
+    font-family: sans, sans-serif, Ariel;
+}
+
+body {
+    font-family: sans, sans-serif, Ariel;
+}
+
 h1 {
     color: #0860A8;
     font-weight: normal;
-- 
2.29.2.windows.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] [edk2-DecSpecification/release/1.27][Patch v2] Add Gitbook Action to publish HTML, PDF, EPUB, and MOBI
  2020-11-13  5:15 [edk2-DecSpecification/release/1.27][Patch v2] Add Gitbook Action to publish HTML, PDF, EPUB, and MOBI Michael D Kinney
@ 2020-11-13 22:33 ` Laszlo Ersek
  0 siblings, 0 replies; 2+ messages in thread
From: Laszlo Ersek @ 2020-11-13 22:33 UTC (permalink / raw)
  To: devel, michael.d.kinney

On 11/13/20 06:15, Michael D Kinney wrote:
> Add Gitbook Action to publish this document in the
> gh-pages branch of the same repository in HTML, PDF,
> EPUB, and MOBI formats.  The draft and release
> versions of the documents are published in different
> directories of the gh-pages branch so all published
> versions are available for download and online
> viewing.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  .bookignore                          |  3 +++
>  .github/workflows/gitbook-action.yml | 39 ++++++++++++++++++++++++++++
>  .gitignore                           | 10 +++----
>  book.json                            | 16 ++++++------
>  styles/epub.css                      |  8 ++++++
>  styles/mobi.css                      |  8 ++++++
>  styles/pdf.css                       |  8 ++++++
>  styles/website.css                   |  8 ++++++
>  8 files changed, 87 insertions(+), 13 deletions(-)
>  create mode 100644 .bookignore
>  create mode 100644 .github/workflows/gitbook-action.yml
> 
> diff --git a/.bookignore b/.bookignore
> new file mode 100644
> index 0000000..ed716f0
> --- /dev/null
> +++ b/.bookignore
> @@ -0,0 +1,3 @@
> +/.github
> +.gitignore
> +.bookignore
> diff --git a/.github/workflows/gitbook-action.yml b/.github/workflows/gitbook-action.yml
> new file mode 100644
> index 0000000..917b0d7
> --- /dev/null
> +++ b/.github/workflows/gitbook-action.yml
> @@ -0,0 +1,39 @@
> +name: 'Gitbook Action Build'
> +on:
> +  push:
> +    branches:
> +      - master
> +      - release/*
> +  workflow_dispatch:
> +
> +jobs:
> +  build:
> +    runs-on: ubuntu-latest
> +    steps:
> +    - name: Checkout action
> +      uses: actions/checkout@v2
> +    - name: Get Branch
> +      run: |
> +        raw=$(git branch -r --contains ${{ github.ref }})
> +        branch=${raw/  origin\/}
> +        pubdir=${branch/master/draft}
> +        pubdir=${pubdir////-}
> +        echo "ON_PUSH_BRANCH_NAME=$branch" >> $GITHUB_ENV
> +        echo "ON_PUSH_PUBDIR=$pubdir" >> $GITHUB_ENV
> +    - name: Gitbook Action
> +      uses: zanderzhao/gitbook-action@v1.2.4
> +      with:
> +        token: ${{secrets.GITBOOK_ACTION_PERSONAL_TOKEN}}
> +        source_branch: ${{env.ON_PUSH_BRANCH_NAME}}
> +        publish_branch: gh-pages
> +        publish_dir: ${{env.ON_PUSH_PUBDIR}}
> +        publish_remove_last_build: true
> +        gitbook_pdf: true
> +        gitbook_pdf_dir: /
> +        gitbook_pdf_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
> +        gitbook_epub: true
> +        gitbook_epub_dir: /
> +        gitbook_epub_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
> +        gitbook_mobi: true
> +        gitbook_mobi_dir: /
> +        gitbook_mobi_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
> diff --git a/.gitignore b/.gitignore
> index 1a366fb..e9c50d9 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -5,12 +5,12 @@
>  ## Dependency directory
>  ## Commenting this out is preferred by some people, see
>  ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git
> -node_modules
> +/node_modules
>  
>  # Book build output
> -_book
> +/_book
>  
>  # eBook build output
> -*.epub
> -*.mobi
> -*.pdf
> \ No newline at end of file
> +/book.epub
> +/book.mobi
> +/book.pdf
> \ No newline at end of file
> diff --git a/book.json b/book.json
> index 45f99c9..caaa81a 100644
> --- a/book.json
> +++ b/book.json
> @@ -1,9 +1,9 @@
> -{
> -  "variables" : {
> -    "title"   : "EDK II Package Declaration (DEC) File Format Specification",
> -    "version" : "Revision 1.27"
> -  },
> -
> -  "plugins": ["puml"],
> -  "pluginsConfig": {}
> +{
> +  "variables" : {
> +    "title"   : "EDK II Package Declaration (DEC) File Format Specification",
> +    "version" : "Revision 1.27"
> +  },
> +
> +  "plugins": ["puml-aleung"],
> +  "pluginsConfig": {}
>  }
> diff --git a/styles/epub.css b/styles/epub.css
> index be6b609..87d4f8f 100644
> --- a/styles/epub.css
> +++ b/styles/epub.css
> @@ -1,3 +1,11 @@
> +p {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
> +body {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
>  h1 {
>      color: #0860A8;
>      font-weight: normal;
> diff --git a/styles/mobi.css b/styles/mobi.css
> index db1ca60..0d85d04 100644
> --- a/styles/mobi.css
> +++ b/styles/mobi.css
> @@ -1,3 +1,11 @@
> +p {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
> +body {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
>  h1 {
>      color: #0860A8;
>      font-weight: bold;
> diff --git a/styles/pdf.css b/styles/pdf.css
> index be6b609..87d4f8f 100644
> --- a/styles/pdf.css
> +++ b/styles/pdf.css
> @@ -1,3 +1,11 @@
> +p {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
> +body {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
>  h1 {
>      color: #0860A8;
>      font-weight: normal;
> diff --git a/styles/website.css b/styles/website.css
> index be6b609..87d4f8f 100644
> --- a/styles/website.css
> +++ b/styles/website.css
> @@ -1,3 +1,11 @@
> +p {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
> +body {
> +    font-family: sans, sans-serif, Ariel;
> +}
> +
>  h1 {
>      color: #0860A8;
>      font-weight: normal;
> 


Per previous discussion:

  [edk2-devel] Tianocore-docs Gitbook offline document status (PDF, EPUB, MOBI)

  https://edk2.groups.io/g/devel/message/66308
  https://www.redhat.com/archives/edk2-devel-archive/2020-October/msg00526.html

Acked-by: Laszlo Ersek <lersek@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-13 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13  5:15 [edk2-DecSpecification/release/1.27][Patch v2] Add Gitbook Action to publish HTML, PDF, EPUB, and MOBI Michael D Kinney
2020-11-13 22:33 ` [edk2-devel] " Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox