From b0d121b3d4b9ab594d87fb447adb34745e71952a Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Tue, 1 Jul 2014 22:04:53 -0500 Subject: [PATCH] Implement Screen Text [Packt] style * Use asciidoc italics as signal to turn on Screen Text [Packt] * Update README with new materials Resolves #20 --- README.adoc | 51 ++++++++++++++++++++++++++++++ doc | 4 +++ slim/packt/inline_quoted.fodt.slim | 4 +-- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100755 doc diff --git a/README.adoc b/README.adoc index 878de6a..6bfb40f 100644 --- a/README.adoc +++ b/README.adoc @@ -94,6 +94,51 @@ include::samples/app.groovy[] This chunk of code is Groovy (http://groovy.codehaus.org). It contains the `@RestController` to flag the entire class as being a controller that returns values directly back to the client, without invoking any views. +Every line of a code listing is marked **Code [Packt]** except the last. It's marked **Code End [Packt]**. + +==== Console outputs + +Create a listing block, but don't prefix it with a source flag, and this backend will instead mark it up with **Command Line[Packt]**. + +---- +$ asciidoctor -T slim -b packt README.adoc +$ xmllint -format README.fodt | tail -10 + This README page is structured in the theme of Packt. It might not render perfectly on GitHub, but when viewed through a text editor, +and certainly when converted by this backend to LibreOffice, it should provide a nice example of writing a manuscript for Packt. + Be advised, the nature of this doc is Packt-like, but don’t assume it represents the proper formatting of a book. This is how to +style things. Formatting governs what sections you’ll have in a chapter. When to use tips, quotes, etc. is strictly editorial and +YOUR responsibility. + NOTHING is done to make it look good on GitHub, because that is not the target. BUT…why waste a keen opportunity to document both +environments? + + + +---- + +Every line of a code listing is marked **Command Line [Packt]** except the last. It's marked **Command Line End [Packt]**. + +==== Screen Text + +Text seen on the screen must be wrapped with **Screen Text [Packt]**. + +[options="header"] +|==== +| Field | Value +| _Group_ | `learningspringboot` +| _Artifact_ | `issue-manager` +| _Name_ | `Issue Manager` +| _Description_ | `Learning Spring Boot` +| _Package Name_ | `learningspringboot` +| _Styles_ | _Thymeleaf_ +| _Type_ | _Maven Project_ +| _Packaging_ | _Jar_ +| _Java Version_ | _1.7_ +| _Language_ | _Java_ +|==== +{empty} + +This table contains embedded options picked from the screen as well as things typed in. + ===== Subsections Yes, we handle subsections, but so far, only levels 2-5. @@ -124,8 +169,14 @@ following table. ==== Images +Images are embedded through base64 encoding. They are NOT linked to external files. + image::samples/cat.jpg[width="65%" height="30%"] +The backend also embeds a Layout[Packt] tag afterwards with the basename of the file. + +NOTE: It's up to YOU to properly name the images according to Packt guidelines. + ==== What are some of the things you don't cover? Well, there are actually a lot of other styles provided by Packt not handled here. diff --git a/doc b/doc new file mode 100755 index 0000000..f2bbba5 --- /dev/null +++ b/doc @@ -0,0 +1,4 @@ +#!/bin/bash + +asciidoctor README.adoc +asciidoctor -T slim -b packt README.adoc diff --git a/slim/packt/inline_quoted.fodt.slim b/slim/packt/inline_quoted.fodt.slim index 2a79b9a..26356f3 100644 --- a/slim/packt/inline_quoted.fodt.slim +++ b/slim/packt/inline_quoted.fodt.slim @@ -1,13 +1,13 @@ - case @type - when :strong - / the double underscore is escaped so it doesn't get interpretted as an unconstrained emphasis text:span text:style-name="Key_20_Word_20_5b_PACKT_5d_" =text - when :monospaced text:span text:style-name="Code_20_In_20_Text_20_5b_PACKT_5d_" =text - when :emphasis - =text + text:span text:style-name="Screen_20_Text_20_5b_PACKT_5d_" + =text - else text:span text:style="strong" data-style="else" =text