diff --git a/_chapters/handling-secrets-in-sst.md b/_chapters/handling-secrets-in-sst.md index 9419b37c6..bee982bbb 100644 --- a/_chapters/handling-secrets-in-sst.md +++ b/_chapters/handling-secrets-in-sst.md @@ -63,3 +63,11 @@ function: { This will add `STRIPE_SECRET_KEY` as a secret in the stack. And allow our API to access the secret. Now we are ready to add an API to handle billing. + +{%note%} +Test note +{%endnote%} + +{% info %} Test Info {% endinfo%} + +{%caution %} Test Caution {%endcaution%} diff --git a/etc/ebook/build-epub.rb b/etc/ebook/build-epub.rb index cbdf73d32..52dba4858 100644 --- a/etc/ebook/build-epub.rb +++ b/etc/ebook/build-epub.rb @@ -112,9 +112,21 @@ def build_chapter chapter_data # Remove class in table chapter = chapter.gsub('{: .cost-table }', '') + # Remove image widths + chapter = chapter.gsub('\{:\s*width\s*=\s*"\d+"\s*\}', '') + # Remove {% raw %} and {% endraw %} tags chapter = chapter.gsub(/{% (raw|endraw) %}/, '') + # Replace admonition start tags + chapter = chapter.gsub(/{%\s*(note)\s*%\}\s*/, 'Note: ') + chapter = chapter.gsub(/{%\s*(info)\s*%\}\s*/, 'Info: ') + chapter = chapter.gsub(/{%\s*(caution)\s*%\}\s*/, 'Caution: ') + # Remove admonition end tags + chapter = chapter.gsub(/\s*{%\s*(endnote)\s*%\}/, '') + chapter = chapter.gsub(/\s*{%\s*(endinfo)\s*%\}/, '') + chapter = chapter.gsub(/\s*{%\s*(endcaution)\s*%\}/, '') + # Replace site variables $config.each do |variable| chapter = chapter.gsub(/{{ site.#{variable[0].to_s} }}/, variable[1].to_s) diff --git a/etc/ebook/build-pdf.rb b/etc/ebook/build-pdf.rb index 9a87909e3..69d4f80f4 100644 --- a/etc/ebook/build-pdf.rb +++ b/etc/ebook/build-pdf.rb @@ -113,9 +113,21 @@ def build_chapter chapter_data # Remove class in table chapter = chapter.gsub('{: .cost-table }', '') + # Remove image widths + chapter = chapter.gsub('\{:\s*width\s*=\s*"\d+"\s*\}', '') + # Remove {% raw %} and {% endraw %} tags chapter = chapter.gsub(/{% (raw|endraw) %}/, '') + # Replace admonition start tags + chapter = chapter.gsub(/{%\s*(note)\s*%\}\s*/, 'Note: ') + chapter = chapter.gsub(/{%\s*(info)\s*%\}\s*/, 'Info: ') + chapter = chapter.gsub(/{%\s*(caution)\s*%\}\s*/, 'Caution: ') + # Remove admonition end tags + chapter = chapter.gsub(/\s*{%\s*(endnote)\s*%\}/, '') + chapter = chapter.gsub(/\s*{%\s*(endinfo)\s*%\}/, '') + chapter = chapter.gsub(/\s*{%\s*(endcaution)\s*%\}/, '') + # Replace site variables $config.each do |variable| chapter = chapter.gsub(/{{ site.#{variable[0].to_s} }}/, variable[1].to_s)