Repository: akosma/eBook-Template Branch: master Commit: 6736a8a2bbcd Files: 29 Total size: 676.5 KB Directory structure: gitextract_mgrstzv9/ ├── .gitignore ├── Dockerfile ├── LICENSE.adoc ├── Makefile ├── README.adoc ├── _conf/ │ └── umlconfig.txt ├── _resources/ │ ├── epubstyles/ │ │ ├── epub3-css3-only.css │ │ └── epub3.css │ └── pdfstyles/ │ └── default-theme.yml ├── chapters/ │ ├── appendix.adoc │ ├── bibliography.adoc │ ├── chapter_01.adoc │ ├── chapter_02.adoc │ ├── colophon.adoc │ ├── dedication.adoc │ ├── epigraph.adoc │ ├── glossary.adoc │ ├── index.adoc │ ├── preface.adoc │ ├── qanda.adoc │ └── shortcuts.adoc ├── code/ │ └── code.swift ├── data/ │ └── tracks.csv ├── master.adoc └── samples/ ├── book.1 ├── book.epub ├── book.html ├── book.mobi └── raw_book.html ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ ? .DS_Store _build .asciidoctor chapters/images stem-*.png stem-*.svg diag-*.png diag-*.svg ================================================ FILE: Dockerfile ================================================ # docker build -t "ebook-template" . # docker run -v ${PWD}:/workdir ebook-template FROM ubuntu:18.04 MAINTAINER Adrian Kosmaczewski "akosma@me.com" # Update packages RUN apt-get update RUN apt-get upgrade -y # Install basics RUN apt-get install -y build-essential # Install Ruby and Python RUN apt-get install -y ruby ruby-dev RUN apt-get install -y python # Install specifics RUN apt-get install -y ghostscript RUN apt-get install -y plantuml cmake bison flex RUN apt-get install -y libxml2-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libffi-dev RUN apt-get install -y fonts-lyx intltool # Update Rubygems RUN gem update --system RUN gem update # Install Ruby gems RUN gem install rake RUN gem install pygments.rb kindlegen asciimath asciidoctor epubcheck RUN gem install asciidoctor-pdf asciidoctor-epub3 --pre RUN MATHEMATICAL_SKIP_STRDUP=1 gem install mathematical RUN gem install asciidoctor-mathematical asciidoctor-diagram WORKDIR /workdir # Done ENTRYPOINT ["make"] ================================================ FILE: LICENSE.adoc ================================================ = License This work is placed in the public domain. It belongs to mankind and to nobody in particular. Use it to write poetry, arts, science books and novels. You shall not use it to spread hatred or to write bad things. Just in case, the author does not take any responsibility about any bad things that might happen when using this template. Hopefully this will not be the case. Use, share, transform, as much as you want. I hope you find it useful! ================================================ FILE: Makefile ================================================ DIR = _build INPUT = master OUTPUT = book DIAGRAM = --require=asciidoctor-diagram MATH = --require=asciidoctor-mathematical #REQUIRES = ${DIAGRAM} ${MATH} REQUIRES = OUTPUT_FOLDER = --destination-dir=${DIR} MANPAGE = --backend=manpage HTML = --backend=html5 -a max-width=55em RAW_HTML = --backend=html5 -a stylesheet! -a source-highlighter! PDF = --backend=pdf --require=asciidoctor-pdf EPUB = --backend=epub3 --require=asciidoctor-epub3 KINDLE = ${EPUB} -a ebook-format=kf8 # Public targets all: manpage html raw_html pdf compressed_pdf epub kindle manpage: _build/book.1 html: _build/book.html raw_html: _build/raw_book.html pdf: _build/book.pdf compressed_pdf: _build/compressed_book.pdf epub: _build/book.epub kindle: _build/book.mobi stats: wc -w course/*.adoc clean: if [ -d ".asciidoctor" ]; \ then rm -r .asciidoctor; \ fi; \ if [ -d "${DIR}" ]; \ then rm -r ${DIR}; \ fi; \ # Private targets _build/book.1: asciidoctor ${MANPAGE} ${OUTPUT_FOLDER} --out-file=${OUTPUT}.1 ${INPUT}.adoc; \ _build/book.html: asciidoctor ${HTML} ${REQUIRES} ${OUTPUT_FOLDER} --out-file=${OUTPUT}.html ${INPUT}.adoc; \ _build/raw_book.html: asciidoctor ${RAW_HTML} ${REQUIRES} ${OUTPUT_FOLDER} --out-file=raw_${OUTPUT}.html ${INPUT}.adoc; \ _build/book.pdf: asciidoctor ${PDF} ${REQUIRES} ${OUTPUT_FOLDER} --out-file=${OUTPUT}.pdf ${INPUT}.adoc; \ # Courtesy of # http://www.smartjava.org/content/compress-pdf-mac-using-command-line-free # Requires `brew install ghostscript` _build/compressed_book.pdf: _build/book.pdf gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${DIR}/compressed_book.pdf ${DIR}/book.pdf; \ _build/book.epub: asciidoctor ${EPUB} ${REQUIRES} ${OUTPUT_FOLDER} --out-file=${OUTPUT}.epub ${INPUT}.adoc; \ _build/book.mobi: asciidoctor ${KINDLE} ${REQUIRES} ${OUTPUT_FOLDER} --out-file=${OUTPUT}.mobi ${INPUT}.adoc; \ if [ -e "${DIR}/${OUTPUT}-kf8.epub" ]; \ then rm ${DIR}/${OUTPUT}-kf8.epub; \ fi; \ ================================================ FILE: README.adoc ================================================ = Template for Writing an eBook This is a new version of the classic template for eBooks. You can use this code to kickstart your writing project from scratch. == Design Guidelines Why using such a complex setup instead of just using a simpler tool like Word or Pages? The primary motivation of this template is versioning. Being able to use plain text files as input for the book brings the possibility of versioning each change individually using Git, Subversion or any other similar tool. This also opens up the door to collaboration among team members when editing a document. The second motivation is to separate the presentation and the layout of the final book from its contents. Other output file types could be added in the future. This also brings the possibility of using any text editor in just about any operating system; files are just plain text files that can be edited with gEdit, Notepad, Emacs, Vim, TextEdit, or any other similar tool. Markup languages like Markdown or Asciidoc (used in this template) are simpler and more readable than LaTeX or other SGML-like languages, making the files readable and lean even when edited in a text editor without any syntax highlighting or formatting support. Finally, being able to streamline the creation of the three versions of the book in just one command-line operation allows the whole setup to be automatized. The choice of http://asciidoctor.org[Asciidoctor] comes from the following features: - Syntax highlighting of https://swift.org[Swift] and https://kotlinlang.org[Kotlin] code in all outputs (http://pandoc.org[Pandoc] does not support Swift at the moment.) - Multi-file projects (Pandoc, because of Markdown, does not support the `include` mechanism that AsciiDoc provides.) == History This toolkit started as a pure LaTeX workflow in 2009. In late 2011 the system moved to Markdown and it used Pandoc to generate the artifacts. In 2012 the choice was http://asciidoc.org[AsciiDoc], and in 2016 this new system was finally developed, using AsciiDoctor. == How To Use The `master.asciidoc` file at the root of this project provides the guiding structure of the book. Chapters can be shuffled around, independently of their contents or internal structure. Individual chapters are stored in the `chapters` folder, one file per chapter. Images are stored as PNG files in the `images` folder. Data files (XML, CSV, etc,) are located in the `data` folder. The Makefile creates a temporary `_build` folder, copies all the different elements in it (the master file, the chapters and the images) and commands the execution of the whole toolchain in order to get the final result: - Unix `man` page - Self-contained HTML5 - PDF - EPUB3 - Kindle (.mobi) UML diagrams are generated by text through http://plantuml.com[PlantUML]. 1. Execute the `make` command. This will create the PDF, ePub and HTML versions of the book. 2. `make pdf`, `make html`, `make epub` and `make kindle` each generate the specified version of the booklet. 3. `make clean` removes the `_build` folder. After the build process completes, the compiled eBooks will be available at the `_build` subfolder. == Requirements and Installation Instructions This section explains the different required libraries, for both macOS and Ubuntu Linux. === macOS (Sierra) Before using this template, make sure to have Homebrew and Rubygems installed, then run the following commands to install the required dependencies: $ xcode-select --install # (required for nokogiri, itself a requirement for asciidoc-epub3) $ brew install plantuml glib gdk-pixbuf cairo pango cmake libxml2 $ gem install pygments.rb kindlegen asciimath asciidoctor asciidoctor-diagram asciidoctor-mathematical epubcheck $ gem install asciidoctor-pdf asciidoctor-epub3 --pre Install the font dependencies for `asciidoctor-mathematical`: cd ~/Library/Fonts; \ curl -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/cmex10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/cmmi10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/cmr10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/cmsy10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/esint10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/eufm10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/msam10.ttf \ -LO http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma/ttf/msbm10.ttf If you experience compilation problems with `asciidoctor-mathematical` you can `brew link gettext --force` if needed. Follow the installation instructions from the https://github.com/asciidoctor/asciidoctor-mathematical[project] in case of issues. === Ubuntu Linux (16.04/16.10/18.04) Install the following libraries: sudo apt-get install -y plantuml cmake ruby-dev libxml2-dev libcairo2-dev \ libpango1.0-dev bison flex libgdk-pixbuf2.0-dev libffi-dev ttf-lyx \ intltool sudo gem install pygments.rb kindlegen asciimath asciidoctor \ asciidoctor-diagram epubcheck sudo gem install asciidoctor-pdf asciidoctor-epub3 --pre sudo MATHEMATICAL_SKIP_STRDUP=1 gem install mathematical sudo gem install asciidoctor-mathematical [Unfortunately](https://github.com/asciidoctor/asciidoctor-epub3/issues/179) the current versions of Asciidoctor on Ubuntu exhibit a weird behaviour when using asciidoctor-diagram during the generation of EPUB output. === Docker The project includes a `Dockerfile` which can be built using the following command: `docker build -t "ebook-template" .` Once built, the Docker container can be used as follows on the local folder where the Makefile is located: `docker run -v ${PWD}:/workdir ebook-template` == License See the LICENSE.adoc file. ================================================ FILE: _conf/umlconfig.txt ================================================ hide empty members skinparam defaultFontName Helvetica skinparam backgroundColor transparent skinparam monochrome true skinparam class { BackgroundColor White ArrowColor Black BorderColor Black } skinparam legend { BackgroundColor LightGray ArrowColor Black BorderColor Black } skinparam note { BackgroundColor LightGray ArrowColor Black BorderColor Black } skinparam stereotype { CBackgroundColor LightGray } skinparam state { BackgroundColor White ArrowColor Black BorderColor Black } skinparam shadowing false ================================================ FILE: _resources/epubstyles/epub3-css3-only.css ================================================ /* Gitden & Namo default to 16px font-size; bump it to 20px (125%) */ body.gitden-reader, body.namo-epub-library { font-size: 125%; } /* Gitden doesn't give us much margin, so let's match Kindle */ body.gitden-reader { margin: 0 25pt; } /* Namo has the same margin problem, except setting side margins doesn't work */ /*body.namo-epub-library > section.chapter { margin: 0 25pt; }*/ /* Use tighter margins and smaller font (18px) on phones (Nexus 4 and smaller) */ @media only screen and (max-device-width: 768px) and (max-device-height: 1280px), only screen and (max-device-width: 1280px) and (max-device-height: 768px) { body.gitden-reader, body.namo-epub-library { font-size: 112.5%; } body.gitden-reader { margin: 0 5pt; } /*body.namo-epub-library > section.chapter { margin: 0 5pt; }*/ } body h1, body h2, body h3:not(.list-heading), body h4, body h5, body h6, h1 :not(code), h2 :not(code), h3:not(.list-heading) :not(code), h4 :not(code), h5 :not(code), h6 :not(code) { /* !important required to override custom font setting in Kindle / Gitden / Namo */ /* Gitden requires the extra weight of a parent selector; it also makes headings bold when custom font is specified */ /* Kindle and Gitden require the override on heading child elements */ font-family: "M+ 1p", sans-serif !important; } /* QUESTION what about nested elements inside code? */ body code, body kbd, body pre, pre :not(code) { /* !important required to override custom font setting in Kindle / Gitden / Namo */ /* Gitden requires the extra weight of a parent selector */ /* Kindle and Gitden require the override on pre child elements */ font-family: "M+ 1mn", monospace !important; } @media amzn-kf8 { /* Kindle does its own margin management, so don't use an explicit margin */ /*body { margin: 0 !important; }*/ /* text-rendering is the only way to enable kerning in Kindle (and Calibre, though it seems to kern automatically) */ /* personally, I think Kindle overdoes kerning, but we're running with it for now */ /* text-rendering: optimizeLegibility kills certain Kindle eInk devices */ /*h1, h2, h3, h4, h5, h6, body p, li, dd, blockquote > footer, th, td, figcaption, caption { text-rendering: optimizeLegibility; }*/ /* hack line height of subtitle using floats on Kindle */ h1.chapter-title .subtitle { margin-top: -0.2em; margin-bottom: 0.3em; /* compensate for reduced line height */ } /* NOTE using b instead of span since Firefox ePubReader applies immutable styles to span */ h1.chapter-title .subtitle > b { float: left; display: inline-block; margin-bottom: -0.3em; /* reduce the line height */ padding-right: 0.2em; /* spacing between words */ } h1.chapter-title .subtitle > b:last-child { padding-right: 0; } h1.chapter-title .subtitle::after { display: table; content: ' '; clear: both; } } .chapter-header p.byline { height: auto; /* Aldiko requires this value to be 0; reset it for all others */ } /* Font-based icons */ .icon { display: inline-block; /* !important required to override custom font setting in Kindle (since .icon can appear inside a span) */ font-family: "FontAwesome" !important; font-style: normal !important; font-weight: normal !important; line-height: 1; } .icon-1_5x { padding: 0 0.25em; -webkit-transform: scale(1.5, 1.5); transform: scale(1.5, 1.5); } .icon-2x { padding: 0 0.5em; -webkit-transform: scale(2, 2); transform: scale(2, 2); } .icon-small { font-size: 0.85em; vertical-align: 0.075em; } .icon-1_5em { font-size: 1.5em; } .icon-2em { font-size: 2em; } .icon-3em { font-size: 3em; } .icon-4em { font-size: 4em; } .icon-rotate-90 { -webkit-transform: rotate(90deg); transform: rotate(90deg); } .icon-rotate-90i { -webkit-transform: scale(-1, 1) rotate(90deg); transform: scale(-1, 1) rotate(90deg); } .icon-rotate-180 { -webkit-transform: rotate(180deg); transform: rotate(180deg); } .icon-rotate-180i { -webkit-transform: scale(-1, 1) rotate(180deg); transform: scale(-1, 1) rotate(180deg); } .icon-rotate-270 { -webkit-transform: rotate(270deg); transform: rotate(270deg); } .icon-rotate-270i { -webkit-transform: scale(-1, 1) rotate(270deg); transform: scale(-1, 1) rotate(270deg); } .icon-flip-h { -webkit-transform: scale(-1, 1); transform: scale(-1, 1); } .icon-flip-v { -webkit-transform: scale(1, -1); transform: scale(1, -1); } ================================================ FILE: _resources/epubstyles/epub3.css ================================================ @import url("epub3-fonts.css"); *, *:before, *:after { box-sizing: border-box; } /* educate older readers about tags introduced in HTML5 */ article, aside, details, figcaption, figure, footer, header, nav, section, summary { display: block; } /* html and body declarations must be separate entries for some readers */ html { margin: 0 !important; padding: 0 !important; /* set the em base (and relative em anchor) by setting the font-size on html */ /* TODO set font-size > 100% except for Kindle */ font-size: 100%; -webkit-text-size-adjust: 100%; } /* don't set margin on body as that's how many readers frame reading area */ /* can't set the font-family on body in Kindle */ body { padding: 0 !important; /* add margin to ~ match Kindle's narrow setting */ /* don't use !important on margin as it breaks calibre */ margin: 0; font-size: 100%; /* NOTE putting optimizeLegibility on the body slows down rendering considerably */ text-rendering: optimizeSpeed; /* -webkit-font-smoothing has no noticable effect and is controversial, so leaving it off */ } /* disables night mode in Aldiko, hoo-ha! */ html body { background-color: #FFFFFF; } /* sets minimum margin permitted */ /* @page not supported by Kindle or GitDen */ @page { /* push the top & bottom margins down in Aldiko to emulate Kindle (Kindle uses ~ 10% of screen by default )*/ margin: 1cm; } div, p, blockquote, pre, figure, figcaption, h1, h2, h3, h4, h5, h6, dl, dt, dd, ol, ul, li, table, caption, thead, tfoot, tbody, tr, th, td { margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; } a, abbr, address, cite, code, em, kbd, span, strong { font-size: 100%; } a { background: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } address { white-space: pre-line; } b, strong { font-weight: bold; } b.button { font-weight: normal; text-shadow: 1px 0 0 #B3B3B1; color: #191918; white-space: nowrap; } b.button .label { padding: 0 0.25em; } kbd { display: inline-block; font-size: 0.8em; line-height: 1; background-color: #F7F7F7; /* #FAFAFA */ border: 1px solid #BEBEBC; -webkit-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 1px 1px 0 rgba(102, 102, 101, 0.25), 0 0 0 1px white inset; box-shadow: 1px 1px 0 rgba(102, 102, 101, 0.25), 0 0 0 1px white inset; margin: 0 0.15em; padding: 0.25em 0.4em 0.2em 0.4em; vertical-align: 0.15em; } .keyseq { white-space: nowrap; } .menuseq .caret { /* font-family: "FontAwesome"; font-size: 0.7em; line-height: 1; font-weight: bold; vertical-align: 0.08rem; */ font-weight: bold; } .menuseq span[class~="caret"] { visibility: hidden; } .menuseq .caret::before { font-family: "FontAwesome"; content: "\f054"; font-size: 0.6em; vertical-align: 0.15em; visibility: visible; display: inline-block; width: 0; padding-right: 0.15em; } img { border: 0; } mark { background-color: #FFC14F; color: #191918; } small { font-size: 80%; } sub, sup { font-size: 0.75em; line-height: 1; } sup { /* position: relative not permitted on Kindle */ /* position: relative; top: -0.5em; */ /* alternate approach #1 */ /* display: inline-block; vertical-align: text-top; padding-top: .25em; */ /* alternate approach #2 */ line-height: 1; vertical-align: text-top; } sub { /* position: relative not permitted on Kindle */ /* position: relative; bottom: -0.25em; */ /* alternate approach #1 */ /* display: inline-block; vertical-align: text-bottom; padding-bottom: .5em; */ /* alternate approach #2 */ line-height: 1; vertical-align: text-bottom; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } body a:link { color: #333332; /* hack for font color in iBooks and Gitden (though Gitden would accept color !important too) */ -webkit-text-fill-color: #333332; /* Kindle requires the !important on text-decoration */ /* In night mode, the only indicator of a link is the underline, so we need it or a background image */ text-decoration: none !important; border-bottom: 1px dashed #666665; /* allow URLs to break anywhere if they don't fit on a line; but how do we know it's a URL? */ /* word-break: break-all; */ } body:first-of-type a:link { border-bottom: none; background-repeat: no-repeat; background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, #666665 5%, #666665 95%, rgba(255,255,255,0) 100%); background-image: linear-gradient(to right, rgba(255,255,255,0) 0%, #666665 5%, #666665 95%, rgba(255,255,255,0) 100%); background-size: 100% 1px; background-position: 0 1.2em; } body a:visited { color: #666665; /* hack for font color in iBooks */ -webkit-text-fill-color: #666665; } code.literal { /* don't let it affect line spacing */ /* disable since M+ 1mn won't interrupt line height */ /*line-height: 1;*/ /* white-space: nowrap; */ word-wrap: break-word; } h1, h2, h3, h4, h5, h6 { font-family: "M+ 1p", sans-serif; font-weight: 400; letter-spacing: -0.01em; /* NOTE Kindle doesn't allow the line-height to be less than the font size (refer to heading font sizes) */ line-height: 1.4; /* or 1.2125 */ text-align: left; -webkit-hyphens: none; /* disable hyphenation where supported (e.g., iBooks) */ word-wrap: break-word; /* break in middle of long word if no other break opportunities are available */ /* avoiding page breaks does not seem to work in Kindle */ -webkit-column-break-inside: avoid; page-break-inside: avoid; -webkit-column-break-after: avoid; page-break-after: avoid; } /* Aldiko requires a higher precedence rule to set margin and text-indent, hence the body prefix */ /* We'll just use the stronger rule for all paragraph-related stuff to be sure */ body p { margin: 1em 0 0 0; text-align: justify; text-indent: 0; widows: 2; orphans: 2; } body p, ul, ol, li, dl, dt, dd, footer, div.verse .attribution, table.table th, table.table td, figcaption, caption { color: #333332; /* NOTE iBooks will forcefully override font-family of text inside div, p and span elements when font other than Original is selected */ /* NOTE iBooks honors Original font for prose text if declared in display-options.xml */ font-family: "Noto Serif", serif; } body p, li, dt, dd, footer { line-height: 1.6; } code, kbd, pre { color: #191918; font-family: "M+ 1mn", monospace; -webkit-hyphens: none; /* disable hyphenation where supported (e.g., iBooks) */ } /* QUESTION should we kern preformatted text blocks? */ h1, h2, h3, h4, h5, h6, body p, li, dd, blockquote > footer, th, td, figcaption, caption { /* forward-compatible CSS to enable kerning (if we want ligatures, add "liga" and "dlig") */ /* WebKits that don't recognize these properties don't kern well, hence why we don't simply enable kerning via text-rendering */ -webkit-font-feature-settings: "kern"; font-feature-settings: "kern"; font-kerning: normal; /* NOTE see Kindle hack in epub3-css3-only.css for additional kerning settings (disabled) */ } p.last::after { color: #57AD68; display: inline-block; font-family: "FontAwesome"; font-size: 1em; content: "\f121"; /* i.e., */ margin-left: 0.25em; } ul li, ol li { /* minimum margin in case there is no paragraph content */ margin-top: 0.4em; } /* use paragraph-size gaps between list items */ .complex > ul > li, .complex > ol > li { margin-top: 1em; } /* squeeze content in complex lists */ /* li > figure, li > p { margin-top: 0.4em; } */ dl { margin-top: 0; margin-bottom: 0; } dt { -webkit-column-break-inside: avoid; page-break-inside: avoid; -webkit-column-break-after: avoid; page-break-after: avoid; } dt > span.term { font-style: italic; } /* dt > span.term > code.literal { font-style: normal; } */ dt { margin-top: 0.75em; /* balances 0.25em to term */ } dl dd { /* minimum margin in case there is no paragraph content */ margin-top: 0.25em; } div.callout-list { margin-top: 0.5em; } div.callout-list ol { font-size: 80%; margin-left: 1.5em !important; list-style-type: none; } div.callout-list ol li { text-align: left; } i.conum { color: #468C54; font-family: "M+ 1mn", monospace; font-style: normal; } /* don't let conum affect line spacing; REVIEW may not need this! */ /*pre i.conum { line-height: 1; }*/ div.callout-list li > i.conum { float: left; margin-left: -1.25em; display: block; width: 1.25em; } div.itemized-list, div.ordered-list, div.description-list { margin-top: 1em; padding-bottom: 0.25em; /* REVIEW maybe, maybe not */ } /* QUESTION should we add the class "list" so we can style these generically? */ div.itemized-list div.itemized-list, div.itemized-list div.ordered-list, div.itemized-list div.description-list, div.ordered-list div.itemized-list, div.ordered-list div.ordered-list, div.ordered-list div.description-list { margin-top: 0; } /*div.description-list div.itemized-list, div.description-list div.ordered-list, div.description-list div.description-list { }*/ h3.list-heading { font-size: 1em; font-family: "Noto Serif", serif; font-weight: bold; line-height: 1.6; margin-top: 1em; margin-bottom: -0.25em; letter-spacing: 0; } div.stack li strong.subject, div.stack-subject li strong.subject { display: block; } ul { /* QUESTION do we need important here? */ margin-left: 1em !important; list-style-type: square; } ul ul { list-style-type: circle; } ul ul ul { list-style-type: disc; } /* disable list style type for CSS3-enabled clients */ body:first-of-type ul, body:first-of-type ul ul, body:first-of-type ul ul ul { list-style-type: none; } ul > li::before { float: left; margin-left: -1em; margin-top: -0.05em; padding-left: 0.25em; /* guarantee it's out of the flow */ width: 0; display: block; } ul > li::before { content: "\25AA"; /* small black square */ color: #666665; } ul ul > li::before { content: "\25E6"; /* small white circle */ color: #57AD68; } ul ul ul > li::before { content: "\2022"; /* small black circle */ color: #666665; } ul ul ul ul > li::before { content: "\25AB"; /* small white square */ color: #57AD68; } ol { margin-left: 1.75em !important; } ol { list-style-type: decimal; } ol ol { list-style-type: lower-alpha; } ol ol ol { list-style-type: lower-roman; } /* REVIEW */ dd { margin-left: 1.5rem !important; } /* Kindle does not justify list-item element, must wrap in nested block element */ li > span.principal, dd > span.principal { display: block; text-align: justify; } ol.brief > li > span.principal, ul.brief > li > span.principal { text-align: left; } /* REVIEW still considering keeping this one */ /* disable justify within a link */ /* li strong.subject a:link { white-space: pre-wrap; word-spacing: 0.1em; }*/ /* .bibliography ul li, .references ul li { text-align: left; } */ ul.bibliography > li > span.principal, ul.references > li > span.principal { text-align: left; } /* sized based on the major third modular scale (4:5, 16px, 24px) */ h1, h2 { color: #333332; font-size: 1.5em; word-spacing: -0.075em; margin-top: 1em; /* 1.5rem */ margin-bottom: -0.3333em; /* -0.5rem, 0.5rem to content */ } h3 { color: #333332; font-size: 1.25em; margin-top: 0.84em; /* 1.05rem */ margin-bottom: -0.5em; /* -0.625rem, 0.375rem to content */ } h4 { color: #4F4F4C; font-weight: 200; font-size: 1.1em; margin-top: 1em; /* 1.1rem */ margin-bottom: -0.818em; /* -0.9rem, 0.1rem to content */ font-size: 1.2em; margin-top: .917em; /* 1.1rem */ margin-top: 0.875em; /* 1.05rem */ /*margin-bottom: -0.75em;*/ /* -0.9rem, 0.1rem to content */ margin-bottom: -0.625em; /* -0.75rem, 0.25rem to content */ } h5 { color: #666665; /* font-size: 1em; text-transform: uppercase; margin-top: 1em; margin-bottom: -1em; */ font-size: 0.9em; font-weight: 700; text-transform: uppercase; margin-top: 1.11em; /* 1rem */ margin-bottom: -0.972em; /* -0.875rem */ } h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { color: inherit; } h5 code { text-transform: none; } /* Kindle strips (or unwraps)
tags, so we use an inner div to style */ .chapter-header { background-color: #333332; /* NOTE div must have at least 1px top padding for background to fill */ padding: 0.75em 1.5em 0.25em 1.5em; /* would like to use 1.5vh 1.5em */ margin-bottom: 2.5em; /* TODO maybe what we need to get articles to start in left column -webkit-column-break-before: left; page-break-before: left; */ } h1.chapter-title { font-weight: 200; font-size: 1.2em; margin-top: 3.5em; /* 4.2rem - would like to use 9vh */ margin-bottom: 0; padding-bottom: 0.8333em; /* 1.2rem */ color: #B3B3B1; text-transform: uppercase; word-spacing: -0.075em; letter-spacing: -0.01em; border-bottom: 1px solid #DCDCDE; } h1.chapter-title .subtitle { font-weight: 400; color: #FFFFFF; display: block; font-size: 1.5em; margin: 0 0 0 0.75em; /* would like to use 2vw */ line-height: 1.2; /* line-height will remain 1.4 on Kindle, see hack in media query */ } h1.chapter-title em { color: #57AD68; font-style: normal; } h1.chapter-title b { font-weight: inherit; } .chapter-header p.byline { color: #DCDCDE; /* float left and height 0 takes this line out of the flow */ float: left; height: 0; width: 100%; text-align: right; margin-top: 0; line-height: 2; } .chapter-header p.byline b { font-weight: normal; padding-left: 0.2em; /* 0.25rem */ font-size: 0.8em; line-height: 2.5; /* 2rem */ } .chapter-header p.byline img { -webkit-border-radius: 0.5em; border-radius: 0.5em; vertical-align: middle; /* some readers like to resize images; we don't want the author images resized */ height: 2em !important; width: 2em !important; } /* HACK: Solves a problem in the current implementation of asciidoctor-epub3 */ p.byline { display: none; } /* HACK: Solves a problem in the current implementation of asciidoctor-epub3 */ div.abstract { margin: 5% 1.5em 2.5em 1.5em; } div.abstract > p { color: #666665; font-size: 1.05em; /* or 1.1em? */ line-height: 1.75; } div.abstract > p a:link { color: #666665; /* hack for font color in iBooks */ -webkit-text-fill-color: #666665; } div.abstract > p:first-child::first-line { font-weight: bold; -webkit-font-feature-settings: "kern" off; font-feature-settings: "kern" off; font-kerning: none; /* and for Kindle... */ text-rendering: optimizeSpeed; } div.abstract p strong { font-weight: inherit; font-style: italic; } p.lead { font-size: 1.05em; line-height: 1.75; } hr.thematicbreak { display: none; } hr.thematicbreak + p { margin-top: 1.5em; } /* TODO finish layout of first-letter */ hr.thematicbreak + p::first-letter { font-size: 200%; } p.stack > strong.head, p.stack-head > strong.head { display: block; } p.signature { font-size: 0.9em; } figure, aside.sidebar { margin-top: 1em; } /* aside.sidebar { -webkit-column-break-inside: avoid; page-break-inside: avoid; float: left; margin-bottom: 1em; } */ figure.image { -webkit-column-break-inside: avoid; page-break-inside: avoid; } figure.image img { max-width: 100%; } figure.coalesce { -webkit-column-break-inside: avoid; page-break-inside: avoid; } figcaption, caption { font-size: 0.9em; font-style: italic; color: #666665; letter-spacing: -0.01em; line-height: 1.4; text-align: left; padding-left: 0.1em; page-break-inside: avoid; -webkit-column-break-after: avoid; page-break-after: avoid; } figure.image figcaption { padding-left: 0; margin-top: 0.2em; -webkit-column-break-after: auto; page-break-after: auto; } p + figure.listing, span.principal + figure.listing { margin-top: 0.75em; /* 0.75rem */ } figure.listing > pre { margin-top: 0; } /* REVIEW TODO put margin bottom on the figcaption instead */ figure.listing > figcaption + pre { margin-top: 0.294em; /* 0.25rem */ } aside.sidebar { border: 1px solid #B3B3B1; padding: 0 1.5em; font-size: 0.9em; background-color: #F2F2F2; text-align: right; /* aligns heading to right */ /* -webkit-box-shadow: 0px 1px 1px rgba(102, 102, 101, 0.15); box-shadow: 0px 1px 1px rgba(102, 102, 101, 0.15); */ } body:first-of-type aside.sidebar { background-color: rgba(0, 0, 0, 0.05); /* using transparency is night-mode friendly */ /*background-color: rgba(51, 51, 50, 0.06);*/ /* using transparency is night-mode friendly */ } /* a bit of a cheat; could use aside.sidebar[title] instead, but not on Aldiko */ aside.sidebar.titled { margin-top: 2em; } aside.sidebar > h2 { /*text-transform: uppercase;*/ /* uppercase done manually to support Aldiko */ font-size: 1em; /* font-weight: 700; */ font-weight: 400; letter-spacing: 0; display: inline-block; white-space: nowrap; /* for some reason it's wrapping prematurely */ border: 1px solid #B3B3B1; padding: 1.5em .75em .5em .75em; margin: -1em 0.5em -0.25em 0.5em; background-color: #FFFFFF; /* -webkit-box-shadow: 0px 1px 1px rgba(102, 102, 101, 0.1); box-shadow: 0px 1px 1px rgba(102, 102, 101, 0.1); */ } /* doesn't work body:first-of-type aside.sidebar > h2 { background-color: rgba(255, 255, 255, 1); } */ aside.sidebar > div.content { margin-bottom: 1em; text-align: justify; /* restore text alignment in content */ } /* QUESTION same for ordered-list? */ aside.sidebar > div.content > div.itemized-list > ul { margin-left: 0.5em !important; } div.blockquote { padding: 0 1em; margin: 1.25em auto; } /* display: table causes quotes to be repeated in Aldiko, so we hide this part */ div[class~="blockquote"] { display: table; } blockquote > p { color: #191918; font-style: italic; /* font-size: 1.2em; word-spacing: 0.1em; */ font-size: 1.15em; word-spacing: 0.1em; margin-top: 0; line-height: 1.75; } /* hide explicit open quote for CSS3-enabled clients */ blockquote span.open-quote:not(:empty) { display: none; } /* NOTE if we mapped the font icon to "\201c", we could just style the .open-quote */ blockquote > p:first-of-type::before { display: inline-block; color: #666665; text-shadow: 0 1px 2px rgba(102, 102, 101, 0.3); /* using serif quote from entypo */ font-family: "FontIcons"; /*content: "\f10e";*/ /* quote-right from Entypo */ /* -webkit-transform: rotate(180deg); transform: rotate(180deg); padding-left: .3em; padding-right: .2em; */ content: "\f10d"; /* quote-left, a flipped version of the quote-right from Entypo */ padding-right: .5em; font-size: 1.5em; line-height: 1.3; margin-top: -0.5em; vertical-align: text-bottom; } blockquote footer { font-size: 0.9em; font-style: italic; margin-top: 0.5rem; text-align: right; } blockquote footer .context { font-size: 0.9em; letter-spacing: -0.1em; color: #666665; } /* Kindle requires text-align: center on surrounding div to align image to center */ figure.image div.content { text-align: center; } /* in the event the viewer adds display: block to the image */ figure.image img { /* max-width not supported in Kindle, need to use a media query to add */ /*max-width: 95%;*/ margin: 0 auto; } pre { text-align: left; /* fix for Namo */ margin-top: 1em; /* 0.85rem */ /*margin-top: 1.176em;*/ /* 1rem */ white-space: pre-wrap; /*word-break: break-all;*/ /* break at the end of the line, no matter what */ word-wrap: break-word; /* break in middle of long word if no other break opportunities are available */ font-size: 0.85em; line-height: 1.4; /* matches what Kindle uses and can't go less */ background-color: #F2F2F2; padding: 0.5rem 0.75rem; /* border-top: 3px solid #DCDCDE; */ /* QUESTION #B3B3B1? */ border-top: 1px solid #DCDCDE; border-right: 1px solid #DCDCDE; } body:first-of-type pre { background-color: rgba(0, 0, 0, 0.05); /* using transparency is night-mode friendly */ /*background-color: rgba(51, 51, 50, 0.06);*/ /* using transparency is night-mode friendly */ } /* TODO what we really want is for pre w/o caption to be unbreakable */ pre.screen { /* -webkit-column-break-inside: avoid; page-break-inside: avoid; */ orphans: 3; widows: 3; /* widows doesn't seem to work here */ } pre.source { orphans: 3; widows: 3; /* widows doesn't seem to work here */ } div.verse { -webkit-column-break-inside: avoid; page-break-inside: avoid; } /* TODO we may want to reenable hyphens here, but not for kf8 */ div.verse > pre { background-color: transparent; border: none; font-size: 1.2em; text-align: center; } div.verse .attribution { display: block; margin-top: 1.4em; } aside.admonition { margin-top: 1em; padding: 1em; border-left: 0.5em solid transparent; -webkit-column-break-inside: avoid; page-break-inside: avoid; } /* overrides for CSS3-enabled clients */ aside[class~="admonition"] { margin: 1.5em 2em; /* even if admonition is at bottom of block, we want that extra space below */ padding: 0; border-width: 0; background: none !important; } aside.note { border-left-color: #B3B3B1; background-color: #E1E1E1; /* 25% opacity of border */ } aside.tip { border-left-color: #57AD68; background-color: #D4EAD9; /* 25% opacity of border */ } aside.caution { border-left-color: #666665; background-color: #D8D8D8; /* 25% opacity of border */ } aside.warning { border-left-color: #C83737; background-color: #F1CCCC; /* 25% opacity of border */ } aside.important { border-left-color: #FFC14F; background-color: #FFEFD2; /* 25% opacity of border */ } aside.admonition::before { display: block; font-family: "FontAwesome"; font-size: 2em; line-height: 1; width: 1em; text-align: center; margin-bottom: -0.25em; margin-left: -0.5em; text-shadow: 0px 1px 2px rgba(102, 102, 101, 0.3); } aside.admonition > div.content { font-size: 90%; margin-top: -1em; /* prevent at top of content when using block form of admonition */ } aside[class~="admonition"] > div[class~="content"] { margin-top: 0; padding-bottom: 1em; background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 bottom; /* template background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 42.5%, 45%, 55%, rgba(255,255,255,0) 57.5%); background-image: linear-gradient(to right, rgba(255,255,255,0) 42.5%, 45%, 55%, rgba(255,255,255,0) 57.5%); */ } aside.note::before { /*content: "\f0f4";*/ /* fa-coffee */ content: "\f040"; /* fa-pencil */ color: #B3B3B1; /* 179,179,177 */ } aside[class~="note"] > div[class~="content"] { background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 42.5%, #B3B3B1 45%, #B3B3B1 55%, rgba(255,255,255,0) 57.5%); background-image: linear-gradient(to right, rgba(255,255,255,0) 42.5%, #B3B3B1 45%, #B3B3B1 55%, rgba(255,255,255,0) 57.5%); } aside.tip::before { /*content: "\f069";*/ /* fa-asterisk */ /*content: "\f0d6";*/ /* fa-money */ content: "\f15a"; /* fa-bitcoin */ color: #57AD68; /* 87,173,104 */ } aside[class~="tip"] > div[class~="content"] { background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 42.5%, #57AD68 45%, #57AD68 55%, rgba(255,255,255,0) 57.5%); background-image: linear-gradient(to right, rgba(255,255,255,0) 42.5%, #57AD68 45%, #57AD68 55%, rgba(255,255,255,0) 57.5%); } aside.caution::before { content: "\f0c2"; /* fa-cloud */ color: #666665; /* 102,102,101 */ } aside[class~="caution"] > div[class~="content"] { background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 42.5%, #666665 45%, #666665 55%, rgba(255,255,255,0) 57.5%); background-image: linear-gradient(to right, rgba(255,255,255,0) 42.5%, #666665 45%, #666665 55%, rgba(255,255,255,0) 57.5%); } aside.warning::before { content: "\f0e7"; /* fa-bolt */ color: #C83737; /* 200,55,55 */ } aside[class~="warning"] > div[class~="content"] { background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 42.5%, #C83737 45%, #C83737 55%, rgba(255,255,255,0) 57.5%); background-image: linear-gradient(to right, rgba(255,255,255,0) 42.5%, #C83737 45%, #C83737 55%, rgba(255,255,255,0) 57.5%); } aside.important::before { content: "\f12a"; /* fa-exclamation */ color: #FFC14F; /* 255,193,79 */ } aside[class~="important"] > div[class~="content"] { background-image: -webkit-linear-gradient(left, rgba(255,255,255,0) 42.5%, #FFC14F 45%, #FFC14F 55%, rgba(255,255,255,0) 57.5%); background-image: linear-gradient(to right, rgba(255,255,255,0) 42.5%, #FFC14F 45%, #FFC14F 55%, rgba(255,255,255,0) 57.5%); } aside.admonition > h2 { margin-top: 0; margin-bottom: 1.5em; font-size: 1em; text-align: center; } aside[class~="admonition"] > h2 { float: left; width: 100%; margin-top: -1.25em; margin-bottom: 0; } div.table { margin-top: 1em; } table.table thead, table.table tbody, table.table tfoot { font-size: 0.8em; } table.table > caption { padding-bottom: 0.1em; } table.table th, table.table td { line-height: 1.4; padding: 0.5em 0.5em 1em 0.1em; vertical-align: top; text-align: left; -webkit-column-break-inside: avoid; page-break-inside: avoid; } table.table th { font-weight: bold; } table.table thead th { border-bottom: 1px solid #80807F; } table.table td > p { margin-top: 0; text-align: left; } /* REVIEW */ table.table td > p + p { margin-top: 1em; } table.table-framed { border-width: 1px; border-style: solid; border-color: #80807F; } table.table-framed-topbot { border-width: 1px 0; border-style: solid; border-color: #80807F; } table.table-framed-sides { border-width: 0 1px; border-style: solid; border-color: #80807F; } table.table-grid th, table.table-grid td { border-width: 0 1px 1px 0; border-style: solid; border-color: #80807F; } table.table-grid thead tr > *:last-child { border-right-width: 0; } table.table-grid tbody tr:last-child > th, table.table-grid tbody tr:last-child > td { border-bottom-width: 0; } table.table-grid-rows tbody th, table.table-grid-rows tbody td { border-width: 1px 0 0 0; border-style: solid; border-color: #80807F; } table.table-grid-cols th, table.table-grid-cols td { border-width: 0 1px 0 0; border-style: solid; border-color: #80807F; } table.table-grid-cols thead th:last-child { border-right-width: 0; } table.table-grid-cols tbody tr > td:last-child { border-right-width: 0; } hr.pagebreak { -webkit-column-break-after: always; page-break-after: always; border: none; margin: 0; } /* REVIEW */ hr.pagebreak + * { margin-top: 0 !important; } #_about_the_author { -webkit-column-break-before: always; page-break-before: always; border-bottom: 1px solid #B3B3B3; } img.headshot { float: left; border: 1px solid #80807F; padding: 1px; margin: 0.35em 1em 0.15em 0; height: 5em !important; width: 5em !important; } /* Kindle refuses to style footer (perhaps stripped), so we use an explicit class */ .chapter-footer { -webkit-column-break-before: always; page-break-before: always; } div.footnotes { margin-top: 1em; } div.footnotes p { font-size: 0.8rem; margin-top: 0.4rem; } div.footnotes sup.noteref { font-weight: bold; font-size: 0.9em; } /*div.footnotes sup.noteref a {*/ sup.noteref a { /* Kindle wants to underline these links */ text-decoration: none !important; background-image: none; } nav#toc ol { list-style-type: none; } .icon { display: none; } @media amzn-mobi { /* NOTE mobi7 doesn't support custom fonts, so revert to generic ones */ body p, ul, ol, li, dl, dt, dd, figcaption, caption, footer, table.table th, table.table td, div.verse .attribution { font-family: serif; } h1, h2, h3, h4, h5, h6 { font-family: sans-serif; } code, kbd, pre, i.conum { font-family: monospace; } } ================================================ FILE: _resources/pdfstyles/default-theme.yml ================================================ font: catalog: # Noto Serif supports Latin, Latin-1 Supplement, Latin Extended-A, Greek, Cyrillic, Vietnamese & an assortment of symbols Noto Serif: normal: notoserif-regular-subset.ttf bold: notoserif-bold-subset.ttf italic: notoserif-italic-subset.ttf bold_italic: notoserif-bold_italic-subset.ttf # M+ 1mn supports ASCII and the circled numbers used for conums M+ 1mn: normal: mplus1mn-regular-ascii-conums.ttf bold: mplus1mn-bold-ascii.ttf italic: mplus1mn-italic-ascii.ttf bold_italic: mplus1mn-bold_italic-ascii.ttf # M+ 1p supports Latin, Latin-1 Supplement, Latin Extended, Greek, Cyrillic, Vietnamese, Japanese & an assortment of symbols # It also provides arrows for ->, <-, => and <= replacements in case these glyphs are missing from font M+ 1p Fallback: normal: mplus1p-regular-fallback.ttf bold: mplus1p-regular-fallback.ttf italic: mplus1p-regular-fallback.ttf bold_italic: mplus1p-regular-fallback.ttf fallbacks: - M+ 1p Fallback page: background_color: ffffff layout: portrait margin: [0.5in, 0.67in, 0.67in, 0.67in] margin_inner: 0.75in margin_outer: 0.59in size: A4 base: align: justify # color as hex string (leading # is optional) font_color: 333333 # color as RGB array #font_color: [51, 51, 51] # color as CMYK array (approximated) #font_color: [0, 0, 0, 0.92] #font_color: [0, 0, 0, 92%] font_family: Noto Serif # choose one of these font_size/line_height_length combinations font_size: 14 line_height_length: 20 #font_size: 11.25 #line_height_length: 18 #font_size: 11.2 #line_height_length: 16 #font_size: 10.5 #line_height_length: 15 # correct line height for Noto Serif metrics #line_height_length: 12 #font_size: 11.25 #line_height_length: 18 line_height: $base_line_height_length / $base_font_size font_size_large: round($base_font_size * 1.25) font_size_small: round($base_font_size * 0.85) font_size_min: $base_font_size * 0.75 font_style: normal border_color: eeeeee border_radius: 4 border_width: 0.5 # FIXME vertical_rhythm is weird; we should think in terms of ems #vertical_rhythm: $base_line_height_length * 2 / 3 # correct line height for Noto Serif metrics (comes with built-in line height) vertical_rhythm: $base_line_height_length horizontal_rhythm: $base_line_height_length # QUESTION should vertical_spacing be block_spacing instead? vertical_spacing: $vertical_rhythm link: font_color: 428bca # literal is currently used for inline monospaced in prose and table cells literal: font_color: b12146 font_family: M+ 1mn menu_caret_content: " \u203a " heading: #font_color: 181818 font_color: $base_font_color font_family: M+ 1p Fallback font_style: bold # h1 is used for part titles (book doctype only) h1_font_size: floor($base_font_size * 2.6) # h2 is used for chapter titles (book doctype only) h2_font_size: floor($base_font_size * 2.15) h3_font_size: round($base_font_size * 1.7) h4_font_size: $base_font_size_large h5_font_size: $base_font_size h6_font_size: $base_font_size_small #line_height: 1.4 # correct line height for Noto Serif metrics (comes with built-in line height) line_height: 1 margin_top: $vertical_rhythm * 0.4 margin_bottom: $vertical_rhythm * 0.9 title_page: align: right logo: top: 10% title: top: 55% font_size: $heading_h1_font_size font_color: 999999 line_height: 0.9 subtitle: font_size: $heading_h3_font_size font_style: bold_italic line_height: 1 authors: margin_top: $base_font_size * 1.25 font_size: $base_font_size_large font_color: 181818 revision: margin_top: $base_font_size * 1.25 block: margin_top: 0 margin_bottom: $vertical_rhythm caption: align: left font_style: italic # FIXME perhaps set line_height instead of / in addition to margins? margin_inside: $vertical_rhythm / 3 #margin_inside: $vertical_rhythm / 4 margin_outside: 0 lead: font_size: $base_font_size_large line_height: 1.4 abstract: font_color: 5c6266 font_size: $lead_font_size line_height: $lead_line_height font_style: italic first_line_font_style: bold admonition: border_color: $base_border_color border_width: $base_border_width padding: [0, $horizontal_rhythm, 0, $horizontal_rhythm] # icon: # tip: # name: fa-lightbulb-o # stroke_color: 111111 # size: 24 blockquote: font_color: $base_font_color font_size: $base_font_size_large border_color: $base_border_color border_width: 5 padding: [$vertical_rhythm / 2, $horizontal_rhythm, $vertical_rhythm / -2, $horizontal_rhythm + $blockquote_border_width / 2] cite_font_size: $base_font_size_small cite_font_color: 999999 # code is used for source blocks (perhaps change to source or listing?) code: font_color: $base_font_color font_family: $literal_font_family font_size: ceil($base_font_size) padding: $code_font_size line_height: 1.25 background_color: f5f5f5 border_color: cccccc border_radius: $base_border_radius border_width: 0.75 conum: font_family: M+ 1mn font_color: $literal_font_color font_size: $base_font_size line_height: 4 / 3 example: border_color: $base_border_color border_radius: $base_border_radius border_width: 0.75 background_color: transparent # FIXME reenable margin bottom once margin collapsing is implemented padding: [$vertical_rhythm, $horizontal_rhythm, 0, $horizontal_rhythm] image: align: left prose: margin_top: 0 margin_bottom: $vertical_rhythm sidebar: border_color: $page_background_color border_radius: $base_border_radius border_width: $base_border_width background_color: eeeeee # FIXME reenable margin bottom once margin collapsing is implemented padding: [$vertical_rhythm, $vertical_rhythm * 1.25, 0, $vertical_rhythm * 1.25] title: align: center font_color: $heading_font_color font_family: $heading_font_family font_size: $heading_h4_font_size font_style: $heading_font_style thematic_break: border_color: $base_border_color border_style: solid border_width: $base_border_width margin_top: $vertical_rhythm * 0.5 margin_bottom: $vertical_rhythm * 1.5 description_list: term_font_style: italic term_spacing: $vertical_rhythm / 4 description_indent: $horizontal_rhythm * 1.25 outline_list: indent: $horizontal_rhythm * 1.5 # NOTE item_spacing applies to list items that do not have complex content item_spacing: $vertical_rhythm / 2 #marker_font_color: 404040 table: background_color: $page_background_color #head_background_color: #head_font_color: $base_font_color head_font_style: bold even_row_background_color: f9f9f9 #odd_row_background_color: foot_background_color: f0f0f0 border_color: dddddd border_width: $base_border_width # HACK accounting for line-height cell_padding: [3, 3, 6, 3] toc: dot_leader_color: dddddd #dot_leader_content: '. ' indent: $horizontal_rhythm line_height: 1.4 # NOTE In addition to footer, header is also supported footer: font_size: $base_font_size_small font_color: $base_font_color # NOTE if background_color is set, background and border will span width of page border_color: dddddd border_width: 0.25 height: $base_line_height_length * 2.5 line_height: 1 padding: [$base_line_height_length / 2, 1, 0, 1] vertical_align: top #image_vertical_align: or # additional attributes for content: # * {page-count} # * {page-number} # * {document-title} # * {document-subtitle} # * {chapter-title} # * {section-title} # * {section-or-chapter-title} recto_content: #right: '{section-or-chapter-title} | {page-number}' #right: '{document-title} | {page-number}' right: '{page-number}' #center: '{page-number}' verso_content: #left: '{page-number} | {chapter-title}' left: '{page-number}' #center: '{page-number}' ================================================ FILE: chapters/appendix.adoc ================================================ [appendix] = Copyright and License Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ================================================ FILE: chapters/bibliography.adoc ================================================ [chapter] = Bibliography .Books [bibliography] - [[[flanagan]]] David Flanagan. http://oreilly.com/catalog/9780596805531[JavaScript: The Definitive Guide, Sixth Edition]. O'Reilly. 2011. ISBN 0-596-80552-7 - [[[crockford]]] Douglas Crockford. http://oreilly.com/catalog/9780596517748[JavaScript: The Good Parts]. O'Reilly. 2008. ISBN 0-596-51774-2. - [[[stefanov]]] Stoyan Stefanov. http://shop.oreilly.com/product/9780596806767.do[JavaScript Patterns]. O'Reilly. 2010. ISBN 0-596-80675-2. - [[[keith]]] Jeremy Keith. http://www.abookapart.com/products/html5-for-web-designers[HTML5 for Web Designers]. A Book Apart. 2010. ISBN 978-0-9844425-0-8. - [[[cederholm]]] Dan Cederholm http://www.abookapart.com/products/css3-for-web-designers[CSS3 for Web Designers]. A Book Apart. 2011. ISBN 978-0-9844425-2-2. - [[[prag]]] Andy Hunt & Dave Thomas. The Pragmatic Programmer: From Journeyman to Master. Addison-Wesley. 1999. - [[[seam]]] Dan Allen. Seam in Action. Manning Publications. 2008. .Websites [bibliography] - http://nodejs.org/[Official Node.js Website] - http://nodejs.org/docs/latest/api/index.html[Latest Node.js documentation] - http://nodeguide.com/style.html[Node.js Style Guide] - http://www.nodebeginner.org/[Node.js Tutorial] ================================================ FILE: chapters/chapter_01.adoc ================================================ = The Book of the Thrills Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. [format="csv", options="header"] |=== include::{datadir}/tracks.csv[] |=== Lorem (((Something, Whatever, Lorem)))ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia ((deserunt)) mollit anim id est laborum. [plantuml,diagram-classes,png] .UIResponder Hierarchy Diagram .... title UIResponder Hierarchy Diagram legend right UIViewController and UIView are subclasses of UIResponder endlegend note right of NSObject : In Swift, every class\nextends this one. class NSObject << (P,LightGray) >> class UIResponder class UIView class UIViewController NSObject <|-- UIResponder UIResponder <|-- UIView UIResponder <|-- UIViewController .... == Conclusion Chapter one is over. But before we leave, a checklist of stuff not to forget: - [*] buy milk - [x] buy bread - [ ] call mum ================================================ FILE: chapters/chapter_02.adoc ================================================ [[chapter-2]] = More About Jane Chapter two has just begun. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. == Mathematics This are very important equations; make sure you learn them by heart. [stem] ++++ k_{n+1} = n^2 + k_n^2 - k_{n-1} ++++ Another one: [stem] ++++ \cos (2 \theta) = \cos^2 \theta - \sin^2 \theta ++++ Let's continue: [stem] ++++ f(n) = n^5 + 4n^2 + 2 |_{n=17} ++++ And we can infer that: [stem] ++++ \frac{n!}{k!(n-k)!} = \binom{n}{k} ++++ But since: [stem] ++++ x = a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } } ++++ We can then write that: [stem] ++++ M = \begin{bmatrix} \frac{5}{6} & \frac{1}{6} & 0 \\[0.3em] \frac{5}{6} & 0 & \frac{1}{6} \\[0.3em] 0 & \frac{5}{6} & \frac{1}{6} \end{bmatrix} ++++ Without forgetting: [stem] ++++ \left(\! \begin{array}{c} n \\ r \end{array} \!\right) = \frac{n!}{r!(n-r)!} ++++ ((Lorem)) ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. _The Pragmatic Programmer_ <> should be required reading for all developers. .Some image here image::image.png[] [[section-1]] == Some code samples This is section 1 of chapter 2. We are going to add more JavaScript code, but before, some Swift. [source,swift,numberLines,indent=1] ---- include::{codedir}/code.swift[tags=contains] ---- <1> This is very important! NOTE: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. More code: [source,javascript,numberLines,indent=1] ---- function test() { var boom = "boom"; alert(boom); } ---- ================================================ FILE: chapters/colophon.adoc ================================================ [colophon] = Colophon The Asciidoctor Press, Ceres and Denver (C) 2013 by The Asciidoctor Press Published in the Milky Way Galaxy This book is designed by Dagger Flush, Denver, Colorado. The types are handset Chinchilla and Dust, designed by Leeloo. Leeloo designed the typefaces to soften the bluntness of documentation. Created in Asciidoctor and Fedora 19. The printing and binding is by Ceres Lithographing, Inc., Ceres, Milky Way. ================================================ FILE: chapters/dedication.adoc ================================================ [dedication] = Dedication For S.S.T.-- thank you for the plague of archetypes. ================================================ FILE: chapters/epigraph.adoc ================================================ [epigraph] = Epigraph Thanks for reading! ================================================ FILE: chapters/glossary.adoc ================================================ [glossary] = Glossary [glossary] mud:: wet, cold dirt rain:: water falling from the sky ================================================ FILE: chapters/index.adoc ================================================ [index] = Index ================================================ FILE: chapters/preface.adoc ================================================ [preface] = Preface Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ================================================ FILE: chapters/qanda.adoc ================================================ [chapter] = Questions And Answers [qanda] What is Asciidoctor?:: An implementation of the AsciiDoc processor in Ruby. What is the answer to the Ultimate Question?:: 42 video::rPQoq7ThGAU[youtube] [cols="1,1,2", options="header"] .Applications |=== |Name |Category |Description |Firefox |Browser |Mozilla Firefox is an open-source web browser. It's designed for standards compliance, performance, portability. |Arquillian |Testing |An innovative and highly extensible testing platform. Empowers developers to easily create real, automated tests. |=== ================================================ FILE: chapters/shortcuts.adoc ================================================ [appendix] = Shortcuts |=== |Shortcut |Purpose |kbd:[F11] |Toggle fullscreen |kbd:[Ctrl+T] |Open a new tab |kbd:[Cmd+Option+N] |New incognito window |kbd:[Cmd + +] |Increase zoom |=== ================================================ FILE: code/code.swift ================================================ class Boom { // tag::contains[] func test() -> String { // <1> return "Yeah" } // end::contains[] } ================================================ FILE: data/tracks.csv ================================================ Artist,Track,Genre Baauer,Harlem Shake,Hip Hop The Lumineers,Ho Hey,Folk Rock ================================================ FILE: master.adoc ================================================ :author: Adrian Kosmaczewski :revdate: {docdate} :revnumber: 1.0 :email: email@server.com :copyright: CC-BY-SA 3.0 :doctype: book :doctitle: The Quest Of Life: A journey through sea and land :producer: Adrian Kosmaczewski :creator: Adrian Kosmaczewski :description: A guide to survive in this world :keywords: Asciidoctor, samples, e-book, EPUB3, MOBI :front-cover-image: images/cover.png :title-logo-image: image:logo.png[Logo,100,100] :lang: en :toc: left :toclevels: 2 :sectnumlevels: 2 :numbered: :icons: font :icon-set: fi :imagesdir: {docdir}/images :source-language: swift :source-highlighter: rouge :codedir: {docdir}/code :datadir: {docdir}/data :experimental: :stem: latexmath :hide-uri-scheme: :chapter-label: Chapter :appendix-caption: Appendix :plantuml-config: {docdir}/_conf/umlconfig.txt ifdef::backend-html5[] :data-uri: :mathematical-format: svg :mathematical-ppi: 300 endif::[] ifdef::backend-pdf[] :media: prepress :pdf-stylesdir: _resources/pdfstyles :pdf-style: default :mathematical-format: svg endif::[] ifdef::backend-epub3[] :imagesdir: images :epub3-stylesdir: _resources/epubstyles :ebook-validate: :mathematical-format: svg :mathematical-inline: true endif::[] ifdef::ebook-format-kf8[] // Settings for Kindle endif::[] //// Do not use ":pygments-css: class" in the block above, as this blocks the generation and/or display of highlighted code in EPUB output. Also, the ":pygments-style: xcode" is required, since by default the EPUB generation uses the "bw" style (i.e., black and white.) //// = {doctitle} :sectnums!: include::chapters/colophon.adoc[] // Abstract and Dedication MUST have a level-0 heading in EPUB and Kindle // but level-1 in PDF and HTML ifndef::backend-epub3[:leveloffset: +1] include::chapters/dedication.adoc[] ifndef::backend-epub3[:leveloffset: -1] include::chapters/preface.adoc[] :sectnums: ifndef::backend-epub3[] = The Attack of the Clones [partintro] -- This is the introduction to the first part of our mud-encrusted journey. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. [plantuml,diagram-state,png] .UIViewController States .... title UIViewController States legend right We use states to make the code easier to understand endlegend [*] --> Idle Idle --> [*] Idle : Right after starting Idle -> Done Done : Right before stopping Done --> [*] .... -- endif::[] ifndef::backend-epub3[:leveloffset: +1] include::chapters/chapter_01.adoc[] include::chapters/chapter_02.adoc[] ifndef::backend-epub3[:leveloffset: -1] include::chapters/epigraph.adoc[] include::chapters/appendix.adoc[] include::chapters/shortcuts.adoc[] include::chapters/glossary.adoc[] include::chapters/qanda.adoc[] include::chapters/bibliography.adoc[] ifdef::backend-pdf[] include::chapters/index.adoc[] endif::[] ================================================ FILE: samples/book.1 ================================================ '\" t .\" Title: The Quest Of Life: A journey through sea and land .\" Author: Adrian Kosmaczewski .\" Generator: Asciidoctor 1.5.6.1 .\" Date: 2017-08-22 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "THE QUEST OF LIFE: A JOURNEY THROUGH SEA AND LAND" "1" "2017-08-22" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \\$2 \(laURL: \\$1 \(ra\\$3 .. .if \n[.g] .mso www.tmac .LINKSTYLE blue R < > .SH "COLOPHON" .sp The Asciidoctor Press, Ceres and Denver .sp \(co 2013 by The Asciidoctor Press .sp Published in the Milky Way Galaxy .sp This book is designed by Dagger Flush, Denver, Colorado. The types are handset Chinchilla and Dust, designed by Leeloo. Leeloo designed the typefaces to soften the bluntness of documentation. Created in Asciidoctor and Fedora 19. The printing and binding is by Ceres Lithographing, Inc., Ceres, Milky Way. .SH "DEDICATION" .sp For S.S.T.\-\- .sp thank you for the plague of archetypes. .SH "PREFACE" .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .SH "THE ATTACK OF THE CLONES" .sp This is the introduction to the first part of our mud\-encrusted journey. .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .sp .B UIViewController States .br .sp .if n \{\ .RS 4 .\} .nf title UIViewController States legend right We use states to make the code easier to understand endlegend [*] \-\-> Idle Idle \-\-> [*] Idle : Right after starting Idle \-> Done Done : Right before stopping Done \-\-> [*] .fi .if n \{\ .RE .\} .SH "THE BOOK OF THE THRILLS" .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .TS allbox tab(:); lt lt lt. T{ .sp Artist T}:T{ .sp Track T}:T{ .sp Genre T} T{ .sp Baauer T}:T{ .sp Harlem Shake T}:T{ .sp Hip Hop T} T{ .sp The Lumineers T}:T{ .sp Ho Hey T}:T{ .sp Folk Rock T} .TE .sp .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .sp .B UIResponder Hierarchy Diagram .br .sp .if n \{\ .RS 4 .\} .nf title UIResponder Hierarchy Diagram legend right UIViewController and UIView are subclasses of UIResponder endlegend note right of NSObject : In Swift, every class\(rsnextends this one. class NSObject << (P,LightGray) >> class UIResponder class UIView class UIViewController NSObject <|\-\- UIResponder UIResponder <|\-\- UIView UIResponder <|\-\- UIViewController .fi .if n \{\ .RE .\} .SS "Conclusion" .sp Chapter one is over. But before we leave, a checklist of stuff not to forget: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} buy milk .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} buy bread .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} call mum .RE .SH "MORE ABOUT JANE" .sp Chapter two has just begun. .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .SS "Mathematics" .sp This are very important equations; make sure you learn them by heart. \[k_{n+1} = n^2 + k_n^2 - k_{n-1}\] \[\cos (2\theta) = \cos^2 \theta - \sin^2 \theta\] \[f(n) = n^5 + 4n^2 + 2 |_{n=17}\] \[\frac{n!}{k!(n-k)!} = \binom{n}{k}\] \[ x = a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }\] \[M = \begin{bmatrix} \frac{5}{6} & \frac{1}{6} & 0 \\[0.3em] \frac{5}{6} & 0 & \frac{1}{6} \\[0.3em] 0 & \frac{5}{6} & \frac{1}{6} \end{bmatrix}\] \[\left(\! \begin{array}{c} n \\ r \end{array} \!\right) = \frac{n!}{r!(n-r)!}\] .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .sp \fIThe Pragmatic Programmer\fP [prag] should be required reading for all developers. .SS "Some code samples" .sp This is section 1 of chapter 2. We are going to add more JavaScript code, but before, some Swift. .sp .if n \{\ .RS 4 .\} .nf func test() \-> String { \fB(1)\fP return "Yeah" } .fi .if n \{\ .RE .\} .TS tab(:); r lw(\n(.lu*75u/100u). \fB(1)\fP\h'-2n':T{ This is very important! T} .TE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 .B Note .ps -1 .br .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .sp .5v .RE .sp More code: .sp .if n \{\ .RS 4 .\} .nf function test() { var boom = "boom"; alert(boom); } .fi .if n \{\ .RE .\} .SH "EPIGRAPH" .sp Thanks for reading! .SH "COPYRIGHT AND LICENSE" .sp Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. .SH "SHORTCUTS" .TS allbox tab(:); lt lt. T{ .sp Shortcut T}:T{ .sp Purpose T} T{ .sp F11 T}:T{ .sp Toggle fullscreen T} T{ .sp Ctrl\0+\0T T}:T{ .sp Open a new tab T} T{ .sp Cmd\0+\0Option\0+\0N T}:T{ .sp New incognito window T} T{ .sp Cmd\0+\0+ T}:T{ .sp Increase zoom T} .TE .sp .SH "GLOSSARY" .sp mud .RS 4 wet, cold dirt .RE .sp rain .RS 4 water falling from the sky .RE .SH "QUESTIONS AND ANSWERS" .sp 1. What is Asciidoctor? .RS 4 An implementation of the AsciiDoc processor in Ruby. .RE .sp 2. What is the answer to the Ultimate Question? .RS 4 42 .RE (video) .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table 1. Applications .TS allbox tab(:); lt lt lt. T{ .sp Name T}:T{ .sp Category T}:T{ .sp Description T} T{ .sp Firefox T}:T{ .sp Browser T}:T{ .sp Mozilla Firefox is an open\-source web browser. It\(cqs designed for standards compliance, performance, portability. T} T{ .sp Arquillian T}:T{ .sp Testing T}:T{ .sp An innovative and highly extensible testing platform. Empowers developers to easily create real, automated tests. T} .TE .sp .SH "BIBLIOGRAPHY" .sp .B Books .br .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} David Flanagan. \c .URL "http://oreilly.com/catalog/9780596805531" "JavaScript: The Definitive Guide, Sixth Edition" . O\(cqReilly. 2011. ISBN 0\-596\-80552\-7 .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Douglas Crockford. .URL "http://oreilly.com/catalog/9780596517748" "JavaScript: The Good Parts" "." O\(cqReilly. 2008. ISBN 0\-596\-51774\-2. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Stoyan Stefanov. .URL "http://shop.oreilly.com/product/9780596806767.do" "JavaScript Patterns" "." O\(cqReilly. 2010. ISBN 0\-596\-80675\-2. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Jeremy Keith. \c .URL "http://www.abookapart.com/products/html5\-for\-web\-designers" "HTML5 for Web Designers" . A Book Apart. 2010. ISBN 978\-0\-9844425\-0\-8. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Dan Cederholm \c .URL "http://www.abookapart.com/products/css3\-for\-web\-designers" "CSS3 for Web Designers" . A Book Apart. 2011. ISBN 978\-0\-9844425\-2\-2. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Andy Hunt & Dave Thomas. The Pragmatic Programmer: From Journeyman to Master. Addison\-Wesley. 1999. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Dan Allen. Seam in Action. Manning Publications. 2008. .RE .sp .B Websites .br .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} .URL "http://nodejs.org/" "Official Node.js Website" "" .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} .URL "http://nodejs.org/docs/latest/api/index.html" "Latest Node.js documentation" "" .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} .URL "http://nodeguide.com/style.html" "Node.js Style Guide" "" .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} .URL "http://www.nodebeginner.org/" "Node.js Tutorial" "" .RE .SH "AUTHOR(S)" .sp \fBAdrian Kosmaczewski\fP .RS 4 Author(s). .RE ================================================ FILE: samples/book.html ================================================ The Quest Of Life: A journey through sea and land

Colophon

The Asciidoctor Press, Ceres and Denver

© 2013 by The Asciidoctor Press

Published in the Milky Way Galaxy

This book is designed by Dagger Flush, Denver, Colorado. The types are handset Chinchilla and Dust, designed by Leeloo. Leeloo designed the typefaces to soften the bluntness of documentation. Created in Asciidoctor and Fedora 19. The printing and binding is by Ceres Lithographing, Inc., Ceres, Milky Way.

Dedication

For S.S.T.--

thank you for the plague of archetypes.

Preface

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The Attack of the Clones

This is the introduction to the first part of our mud-encrusted journey.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

UIViewController States
UIViewController States

1. The Book of the Thrills

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Artist Track Genre

Baauer

Harlem Shake

Hip Hop

The Lumineers

Ho Hey

Folk Rock

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

UIResponder Hierarchy Diagram
UIResponder Hierarchy Diagram

1.1. Conclusion

Chapter one is over. But before we leave, a checklist of stuff not to forget:

  • buy milk

  • buy bread

  • call mum

More About Jane

Chapter two has just begun.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Mathematics

This are very important equations; make sure you learn them by heart.

$$k_{n+1} = n^2 + k_n^2 - k_{n-1}$$
$$\cos (2\theta) = \cos^2 \theta - \sin^2 \theta$$
$$f(n) = n^5 + 4n^2 + 2 |_{n=17}$$
$$\frac{n!}{k!(n-k)!} = \binom{n}{k}$$
$$  x = a_0 + \cfrac{1}{a_1
          + \cfrac{1}{a_2
          + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }$$
$$M = \begin{bmatrix}
       \frac{5}{6} & \frac{1}{6} & 0           \\[0.3em]
       \frac{5}{6} & 0           & \frac{1}{6} \\[0.3em]
       0           & \frac{5}{6} & \frac{1}{6}
     \end{bmatrix}$$
$$\left(\!
    \begin{array}{c}
      n \\
      r
    \end{array}
  \!\right) = \frac{n!}{r!(n-r)!}$$

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The Pragmatic Programmer [prag] should be required reading for all developers.

image
Figure 1. Some image here

Some code samples

This is section 1 of chapter 2. We are going to add more JavaScript code, but before, some Swift.

1 2 3
func test() -> String { (1) return "Yeah" }
1 This is very important!
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

More code:

1 2 3 4
function test() { var boom = "boom"; alert(boom); }

Epigraph

Thanks for reading!

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Appendix B: Shortcuts

Shortcut Purpose

F11

Toggle fullscreen

Ctrl+T

Open a new tab

Cmd+Option+N

New incognito window

Cmd++

Increase zoom

Glossary

mud

wet, cold dirt

rain

water falling from the sky

Questions And Answers

  1. What is Asciidoctor?

    An implementation of the AsciiDoc processor in Ruby.

  2. What is the answer to the Ultimate Question?

    42

Table 1. Applications
Name Category Description

Firefox

Browser

Mozilla Firefox is an open-source web browser. It’s designed for standards compliance, performance, portability.

Arquillian

Testing

An innovative and highly extensible testing platform. Empowers developers to easily create real, automated tests.

Bibliography

Books
================================================ FILE: samples/raw_book.html ================================================ The Quest Of Life: A journey through sea and land

Colophon

The Asciidoctor Press, Ceres and Denver

© 2013 by The Asciidoctor Press

Published in the Milky Way Galaxy

This book is designed by Dagger Flush, Denver, Colorado. The types are handset Chinchilla and Dust, designed by Leeloo. Leeloo designed the typefaces to soften the bluntness of documentation. Created in Asciidoctor and Fedora 19. The printing and binding is by Ceres Lithographing, Inc., Ceres, Milky Way.

Dedication

For S.S.T.--

thank you for the plague of archetypes.

Preface

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The Attack of the Clones

This is the introduction to the first part of our mud-encrusted journey.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

UIViewController States
UIViewController States

1. The Book of the Thrills

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Artist Track Genre

Baauer

Harlem Shake

Hip Hop

The Lumineers

Ho Hey

Folk Rock

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

UIResponder Hierarchy Diagram
UIResponder Hierarchy Diagram

1.1. Conclusion

Chapter one is over. But before we leave, a checklist of stuff not to forget:

  • buy milk

  • buy bread

  • call mum

More About Jane

Chapter two has just begun.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Mathematics

This are very important equations; make sure you learn them by heart.

$$k_{n+1} = n^2 + k_n^2 - k_{n-1}$$
$$\cos (2\theta) = \cos^2 \theta - \sin^2 \theta$$
$$f(n) = n^5 + 4n^2 + 2 |_{n=17}$$
$$\frac{n!}{k!(n-k)!} = \binom{n}{k}$$
$$  x = a_0 + \cfrac{1}{a_1
          + \cfrac{1}{a_2
          + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }$$
$$M = \begin{bmatrix}
       \frac{5}{6} & \frac{1}{6} & 0           \\[0.3em]
       \frac{5}{6} & 0           & \frac{1}{6} \\[0.3em]
       0           & \frac{5}{6} & \frac{1}{6}
     \end{bmatrix}$$
$$\left(\!
    \begin{array}{c}
      n \\
      r
    \end{array}
  \!\right) = \frac{n!}{r!(n-r)!}$$

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The Pragmatic Programmer [prag] should be required reading for all developers.

image
Figure 1. Some image here

Some code samples

This is section 1 of chapter 2. We are going to add more JavaScript code, but before, some Swift.

 func test() -> String { (1)
 	return "Yeah"
 }
1 This is very important!
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

More code:

 function test() {
     var boom = "boom";
     alert(boom);
 }

Epigraph

Thanks for reading!

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Appendix B: Shortcuts

Shortcut Purpose

F11

Toggle fullscreen

Ctrl+T

Open a new tab

Cmd+Option+N

New incognito window

Cmd++

Increase zoom

Glossary

mud

wet, cold dirt

rain

water falling from the sky

Questions And Answers

  1. What is Asciidoctor?

    An implementation of the AsciiDoc processor in Ruby.

  2. What is the answer to the Ultimate Question?

    42

Table 1. Applications
Name Category Description

Firefox

Browser

Mozilla Firefox is an open-source web browser. It’s designed for standards compliance, performance, portability.

Arquillian

Testing

An innovative and highly extensible testing platform. Empowers developers to easily create real, automated tests.

Bibliography

Books