Skip to content

Commit

Permalink
Implement Screen Text [Packt] style
Browse files Browse the repository at this point in the history
* Use asciidoc italics as signal to turn on Screen Text [Packt]
* Update README with new materials

Resolves #20
  • Loading branch information
gregturn committed Jul 2, 2014
1 parent 1519fa4 commit b0d121b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
51 changes: 51 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
<text:p text:style-name="Normal_20_5b_PACKT_5d_">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.</text:p>
<text:p text:style-name="Normal_20_5b_PACKT_5d_">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.</text:p>
<text:p text:style-name="Normal_20_5b_PACKT_5d_">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?</text:p>
</office:text>
</office:body>
</office:document>
----

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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions doc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

asciidoctor README.adoc
asciidoctor -T slim -b packt README.adoc
4 changes: 2 additions & 2 deletions slim/packt/inline_quoted.fodt.slim
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b0d121b

Please sign in to comment.