From e059e0dd419b5dbbf4d0c6f94c030433348f8203 Mon Sep 17 00:00:00 2001 From: Christian Genco Date: Mon, 6 Apr 2015 15:21:18 -0500 Subject: [PATCH] really hacky works cited page --- generate.coffee | 62 +++++++++++++++++++++++++++++++++++------------- guide.pdf | Bin 4617 -> 5869 bytes test.coffee.md | 20 ++++++++++++---- todo.md | 2 -- 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/generate.coffee b/generate.coffee index 2298465..079e781 100644 --- a/generate.coffee +++ b/generate.coffee @@ -39,6 +39,23 @@ styles = font: 'Times-Italic' strong: font: 'Times-Bold' + h1: + font: 'Times-Bold' + h2: + font: 'Times-Italic' + h3: + font: 'Times-Bold' + align: 'center' + h4: + font: 'Times-Italic' + align: 'center' + h5: + underline: true + citationHeader: + align: 'center' + citation: + indent: -72/2 + marginLeft: 72/2 # syntax highlighting colors # based on Github's theme @@ -79,25 +96,12 @@ class Node @text = tree return - # console.dir tree @type = tree.shift() - # @attrs = {} - @style = _.extend({}, styles.default, styles[@type]) + @attrs = {} if typeof tree[0] is 'object' and not Array.isArray tree[0] @attrs = tree.shift() - # parse sub nodes - @content = while tree.length - 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 when 'header' @type = 'h' + @attrs.level @@ -126,6 +130,20 @@ class Node @code = coffee.compile code if code @height = +@attrs.title or 0 + @style = _.extend({}, styles.default, styles[@type]) + + # parse sub nodes + @content = while tree.length + 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 + + # sets the styles on the document for this node setStyle: (doc) -> if @style.font @@ -212,19 +230,29 @@ render = (doc, filename) -> console.log tree tree.shift() # ignore 'markdown' first element + onWorksCited = false while tree.length - node = new Node tree.shift() + node = new Node(tree.shift()) + console.log "node =", node + if node.type == "h1" && node.content?.first()?.text?.toLowerCase() == "works cited" + onWorksCited = true + node.style = _.extend({}, styles.default, styles.citationHeader) + + if onWorksCited && node.type == "para" + node.style = _.extend({}, styles.default, styles.citation) + node.render(doc) # add page numbers range = doc.bufferedPageRange() # => { start: 0, count: 2 } + # todo: make more generic "draw text" function that sets the document properities based on provided styles + doc.font styles.default.font for i in [range.start...range.start + range.count] doc.switchToPage(i) doc.y = 72/2 doc.x = 72 - doc.text "#{metadata.lastName} #{i + 1}", - align: 'right' + doc.text "#{metadata.lastName} #{i + 1}", _.extend({}, styles.default, {align: 'right'}) doc.flushPages() doc diff --git a/guide.pdf b/guide.pdf index 26362aee9f5d1b9775b69f542d9dddcb6bfe09c0..d488bd71082e61de8358f0ea0de020ed6bf6873c 100644 GIT binary patch delta 4248 zcmZu#c{o(>-;P42ne0n7F^Oz3i!n?hJCP;Xmq_+KGnB2dgb{{}HCt*#*6hm=N%jcY zmqA&x?;&3LUGMV!_MX2!*ZrLP{@m9&pYvSje!_T{M53jr;bJcs!PE+JMWQuS!cY|q z0sg#Tv;Rvw@pHmIv3|$e#TIJ^5l6#_AQ~QA zrmhKr1G8{_0!KS#Y46 zUGrgC<&PUZ@RO`D$N8lWbnQHLkvTuU9kmfP>4pO?uSp(&8%h$%_Kfb#4Tiq%y$G<3 zGDnNX$SR7aAL_;y!&w*I+;%1u)#pk|N03-P?XE8DE2t6pA_bp$9~Sgj zF$j^0B5;PtT#Ja` zc8E^$0lvLuQEwANANXL7X3%=~(ied@S;8(YMs65=Y>1`UXjVg-`nxCoWr@~p;fo*R zfL9k;Iv5#j^VaO26~SDzZSR@6{D^kEoYW@9JhKT5VSM};*>j4SboFabsxmx#Fwvvi zsPvSSR|LoDi`$6FP9>G=bF{ckRvvZ{Fy20+rPy98Y>BVrHk9Jrn5g{RS0m3*r%yMz z}xP%)Ay5ta?>Gtl!Ul)wlQKdD-Qr{;lb=y*`sJVTN(kC=OZ7 z7q_c#8QT;y#hsix(3$7=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wUnNvQpwz)qQic{r G;Qs=(4BGzy diff --git a/test.coffee.md b/test.coffee.md index 907f1f9..5886924 100644 --- a/test.coffee.md +++ b/test.coffee.md @@ -6,13 +6,15 @@ 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 "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 +# Heading 1 -## Subheading +## Heading 2 -### Sub-sub heading +### Heading 3 -#### Sub-sub-sub heading +#### Heading 4 + +##### Heading 5 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. @@ -21,4 +23,12 @@ By the 1860s, the need for this knowledge was strong enough to affect education. > Perhaps it would be well, if some institution were devised, and supported at the expense of the State, which would be so organized as would tend most effectually to produce a due degree of emulation among Farmers, by rewards and honorary distinctions conferred by those who, by their successful experimental efforts and improvements, should render themselves duly entitled to them. (92) -Here's my final paragraph. \ No newline at end of file +Here's my final paragraph. + +--- + +# Works Cited + +Allen, R.L. *The American Farm Book; or Compend of American Agriculture; Being a Practical Treatise on Soils, Manures, Draining, Irrigation, Grasses, Grain, Roots, Fruits, Cotton, Tobacco, Sugar Cane, Rice, and Every Staple Product of the United States with the Best Methods of Planting, Cultivating, and Preparation for Market*. New York: Saxton, 1849. Print. + +Baker, Gladys L., Wayne D. Rasmussen, Vivian Wiser, and Jane M. Porter. *Century of Service: The First 100 Years of the United States Department of Agriculture*. Federal Government, 1996. Print. diff --git a/todo.md b/todo.md index 7c3c3a0..a515ec7 100644 --- a/todo.md +++ b/todo.md @@ -1,7 +1,5 @@ # Todo -* headings -* works cited page * document name; embed document author * pretty quotes? * citations?