Skip to content

Commit

Permalink
fix blockquote indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangenco committed Apr 6, 2015
1 parent aed83c9 commit e52d96c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
29 changes: 17 additions & 12 deletions generate.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ styles =
indent: 72/2
blockquote:
indent: 0
marginLeft: 72
color: 'red'
font: 'Times-Italic'
marginLeft: 72
em:
font: 'Times-Italic'
strong:
Expand Down Expand Up @@ -81,15 +81,21 @@ class Node

# console.dir tree
@type = tree.shift()
@attrs = {}
# @attrs = {}
@style = _.extend({}, styles.default, styles[@type])

if typeof tree[0] is 'object' and not Array.isArray tree[0]
@attrs = tree.shift()

# parse sub nodes
@content = while tree.length
new Node tree.shift()
child = new Node tree.shift()
# blockquotes have an embedded paragraph; make sure the inner paragraph doesn't re-define
# its indentation
child.style?.indent = @style.indent if @style.indent?
child

console.log "content =", @content
# console.log "type =", @type

switch @type
Expand Down Expand Up @@ -120,10 +126,6 @@ class Node
@code = coffee.compile code if code
@height = +@attrs.title or 0

@style = _.extend({}, styles.default, styles[@type])
# @style.continued = @attrs.continued if @attrs.continued?
# console.log @style

# sets the styles on the document for this node
setStyle: (doc) ->
if @style.font
Expand All @@ -139,7 +141,10 @@ class Node

# renders this node and its subnodes to the document
render: (doc, continued = false) ->
console.log "rendering node: ", @
# console.log "rendering node: ", @
if @style.marginLeft
doc.x += @style.marginLeft

switch @type
when 'hr'
doc.addPage()
Expand All @@ -161,10 +166,10 @@ class Node

lastType = @type

if @style.marginTop
doc.y += @style.marginTop
# if @style.marginLeft
# doc.x += @style.marginLeft
if @style.marginBottom
doc.y += @style.marginBottom
if @style.marginLeft
doc.x -= @style.marginLeft

# reads and renders a markdown/literate coffeescript file to the document
render = (doc, filename) ->
Expand Down
Binary file modified guide.pdf
Binary file not shown.
10 changes: 9 additions & 1 deletion test.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ course: English 624
date: 12 February 2012
title: Toward a Recovery of Nineteenth Century Farming Handbooks

While researching texts like *Harry Potter* and *Curious George* written about **nineteenth century farming**, I found a few authors who published books about the literature of nineteenth century farming, particularly agricultural journals, newspapers, pamphlets, and brochures. These authors often placed the farming literature they were studying into an historical context by discussing the important events in agriculture of the year in which the literature was published (see Demaree, for example). However, while these authors discuss journals, newspapers, pamphlets, and brochures, I could not find much discussion about another important source of farming knowledge: farming handbooks. My goal in this paper is to bring this source into the agricultural literature discussion by connecting three agricultural handbooks from the nineteenth century with nineteenth century agricultural history.
While researching texts like *Harry Potter* and *Curious George* written about **nineteenth century farming**, I found a few "reliable" authors who published books about the literature of nineteenth century farming, particularly agricultural journals, newspapers, pamphlets, and brochures. These authors often placed the farming literature they were studying into an historical context by discussing the important events in agriculture of the year in which the literature was published (see Demaree, for example). However, while these authors discuss journals, newspapers, pamphlets, and brochures, I could not find much discussion about another important source of farming knowledge: farming handbooks. My goal in this paper is to bring this source into the agricultural literature discussion by connecting three agricultural handbooks from the nineteenth century with nineteenth century agricultural history.

# Heading

## Subheading

### Sub-sub heading

#### Sub-sub-sub heading

To achieve this goal, I have organized my paper into four main sections, two of which have sub-sections. In the first section, I provide an account of three important events in nineteenth century agricultural history: population and technological changes, the distribution of scientific new knowledge, and farming's influence on education. In the second section, I discuss three nineteenth century farming handbooks in connection with the important events described in the first section. I end my paper with a third section that offers research questions that could be answered in future versions of this paper and conclude with a fourth section that discusses the importance of expanding this particular project. I also include an appendix after the Works Cited that contains images of the three handbooks I examined. Before I can begin the examination of the three handbooks, however, I need to provide an historical context in which the books were written, and it is to this that I now turn.

Expand Down
7 changes: 3 additions & 4 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Todo

* new paragraphs
* blockquotes
* pretty quotes
* headings
* works cited page
* document name; embed document author
* citations?
* pretty quotes?
* citations?
* block quote with immediately following paragraph?

0 comments on commit e52d96c

Please sign in to comment.