fix blockquote indentation

This commit is contained in:
Christian Genco 2015-04-06 14:24:51 -05:00
parent aed83c9e3f
commit e52d96c5e3
4 changed files with 29 additions and 17 deletions

View File

@ -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:
@ -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
@ -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
@ -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()
@ -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) ->

BIN
guide.pdf

Binary file not shown.

View File

@ -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.

View File

@ -1,9 +1,8 @@
# Todo
* new paragraphs
* blockquotes
* pretty quotes
* headings
* works cited page
* document name; embed document author
* pretty quotes?
* citations?
* block quote with immediately following paragraph?