diff --git a/generate.coffee b/generate.coffee index be37224..2298465 100644 --- a/generate.coffee +++ b/generate.coffee @@ -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) -> diff --git a/guide.pdf b/guide.pdf index 470c3c8..26362ae 100644 Binary files a/guide.pdf and b/guide.pdf differ diff --git a/test.coffee.md b/test.coffee.md index f4abaa0..907f1f9 100644 --- a/test.coffee.md +++ b/test.coffee.md @@ -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. diff --git a/todo.md b/todo.md index 097a847..7c3c3a0 100644 --- a/todo.md +++ b/todo.md @@ -1,9 +1,8 @@ # Todo -* new paragraphs -* blockquotes -* pretty quotes * headings * works cited page * document name; embed document author -* citations? \ No newline at end of file +* pretty quotes? +* citations? +* block quote with immediately following paragraph? \ No newline at end of file