From 78eef140a1be2a067d37f1c28a28ea03c95a5433 Mon Sep 17 00:00:00 2001 From: paultremblay Date: Thu, 5 Apr 2012 02:42:15 +0000 Subject: [PATCH] Needed files for examples. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@7393 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- sandbox/docbook/examples/glossary1/docbook_fo.xsl | 45 +++++++++ sandbox/docbook/examples/glossary1/document.rst | 74 ++++++++++++++ sandbox/docbook/examples/glossary1/makefile | 18 ++++ sandbox/docbook/examples/glossary1/rst_docbook.xsl | 11 +++ sandbox/docbook/examples/graphics/.Rprofile | 34 +++++++ sandbox/docbook/examples/graphics/make_x_axis.R | 5 + .../{report1/charts => graphics}/problem_solve.R | 2 +- sandbox/docbook/examples/report1/.configure | 75 +++++++++++++++ .../examples/report1/charts/problem_solve.R | 21 +--- .../report1/charts/receive_rates_with_adj.R | 21 +--- sandbox/docbook/examples/report1/docbook_fo.xsl | 2 +- .../docbook/examples/report1/make_title_page.xsl | 3 + sandbox/docbook/examples/report1/makefile | 106 +++++++-------------- sandbox/docbook/examples/report2/.configure | 75 +++++++++++++++ sandbox/docbook/examples/report2/docbook_fo.xsl | 5 +- .../docbook/examples/report2/make_title_page.xsl | 2 +- sandbox/docbook/examples/report2/makefile | 2 +- sandbox/docbook/examples/report2/report.rst | 6 +- 18 files changed, 386 insertions(+), 121 deletions(-) create mode 100644 sandbox/docbook/examples/glossary1/docbook_fo.xsl create mode 100644 sandbox/docbook/examples/glossary1/document.rst create mode 100644 sandbox/docbook/examples/glossary1/makefile create mode 100644 sandbox/docbook/examples/glossary1/rst_docbook.xsl create mode 100644 sandbox/docbook/examples/graphics/.Rprofile create mode 100644 sandbox/docbook/examples/graphics/make_x_axis.R copy sandbox/docbook/examples/{report1/charts => graphics}/problem_solve.R (97%) create mode 100644 sandbox/docbook/examples/report1/.configure rewrite sandbox/docbook/examples/report1/makefile (60%) create mode 100644 sandbox/docbook/examples/report2/.configure diff --git a/sandbox/docbook/examples/glossary1/docbook_fo.xsl b/sandbox/docbook/examples/glossary1/docbook_fo.xsl new file mode 100644 index 000000000..78d8df9b0 --- /dev/null +++ b/sandbox/docbook/examples/glossary1/docbook_fo.xsl @@ -0,0 +1,45 @@ + + + + 1 + + 1in + 1cm + + + + bold + + + + 1in + 0.8em + 1.2in + + + + + 1in + + + + + + bold + 5mm + + + + + + + + + + + + diff --git a/sandbox/docbook/examples/glossary1/document.rst b/sandbox/docbook/examples/glossary1/document.rst new file mode 100644 index 000000000..5ae2f4c30 --- /dev/null +++ b/sandbox/docbook/examples/glossary1/document.rst @@ -0,0 +1,74 @@ +Text before glossary. + +.. class:: Glossary + +======== +Glossary +======== + +:CLT: Zappos Customer Loyalty Team, the team devoted to providing service to + Zappos customers. + +:Cutover: The transition from Zappos warehouse management to Amazon warehouse + management. + +:Diamond Phoenix: Company that provides software for ZFC’s moving carousel. + +:Dropping: Releasing an item from a queue in a database to a floor so + the units can be processed. Syngamous with picking. + +:FCSW: Fulfillment Center Software. In the context of this document, Amazon’s + software, as opposed to Zappos’s software. + +:Intelligrated: Company that provided the hardware and support for ZFC. + +:Job aids: Posters hung by work stations to guide Zappos team members + on how to perform certain tasks. + +:Licence Plate Number: A number assigned by Zappos to route and track its + products. Unlike other systems, an LPN is unique to each product, even + identical products. + +:Multilation: A station in a Zappos warehouse that handles goods for multiple + orders. + +:OOPS: A trouble shooting tool. + +:P-slip: A packaging slip Zappos includes with each order. [Beef this + up!] + +:PANDA: Print and Apply label. The machines used by ZFC before switching to + SLAM. + +:Picking: Retrieving an item from the warehouse. + +:Put-To-Light: A system of lights in the multis station that directs a + worker to the right bin. + +:SICK: Scanner used by Zappos warehouse. + +:Singles: Items consisting of a single order, shipped and processed by + themselves. + +:Singulation: A station in Zappos warehouse that separates items in totes and + routes them to their correct location. + +:SLAM: Ship Label and Apply Manifest. The SLAM lines ae machines that + apply labels and created manifests for items shipping from the Zappos + warehouse. + +:SPOO: A SPOO label connects different boxes shipped from the same + order. + +:Tool: In the context of this document, any software (usually the interface of that + software, such as a web interface) to facilitate a task. For example, a scanning + tool means the software loaded on a gun that allows a worker to scan items, pick + items, etc. + +:Throughput rate: The rate found by dividing the total units shipped + divided by the number of man hours required to ship those items. + +:Waving: See “picking.” + +:ZFC: Zappos Fulfilment Center in Shepherdsville, KY. Syngamous with Zappos for + the most part, except where specifically noted. diff --git a/sandbox/docbook/examples/glossary1/makefile b/sandbox/docbook/examples/glossary1/makefile new file mode 100644 index 000000000..190518ae5 --- /dev/null +++ b/sandbox/docbook/examples/glossary1/makefile @@ -0,0 +1,18 @@ +all: document.pdf + +document.xml: document.rst + rst2xml.py --no-doctype --no-doc-title --trim-footnote-reference-space --input-encoding utf8 document.rst document.xml + + +document_docbook.xml: document.xml + xsltproc rst_docbook.xsl document.xml > document_docbook.xml + +document_docbook.fo: document_docbook.xml + xsltproc docbook_fo.xsl document_docbook.xml > document_docbook.fo + + +document.pdf: document_docbook.fo + fop -fo document_docbook.fo -pdf document.pdf + +clean: + rm -f document.xml document_docbook.xml document_docbook.fo document.pdf *~ diff --git a/sandbox/docbook/examples/glossary1/rst_docbook.xsl b/sandbox/docbook/examples/glossary1/rst_docbook.xsl new file mode 100644 index 000000000..d3bf56486 --- /dev/null +++ b/sandbox/docbook/examples/glossary1/rst_docbook.xsl @@ -0,0 +1,11 @@ + + + + article + 0 + 0 + + diff --git a/sandbox/docbook/examples/graphics/.Rprofile b/sandbox/docbook/examples/graphics/.Rprofile new file mode 100644 index 000000000..d40124c75 --- /dev/null +++ b/sandbox/docbook/examples/graphics/.Rprofile @@ -0,0 +1,34 @@ +lwd=3 +font_size = .8 +res = 100 +tick_multiplier = 1 +lwd_grid = .3 +width=5.5 +margins=c(4, 4, .5, 0.5) +mgp = c(4, 1, 0) +legend_font_size = 0.8 +default_grid_color = "lightgray" +ax_col = default_grid_color +box_col = default_grid_color +rec_col = default_grid_color +bar_label_size = .8 +margins_bar=c(2, 4, .5, 0.5) +base_line_type = 2 +months.font = .6 +at = c(0,1,2,3,4,5,6,7,8,9,10,11,12) +at = at /12 * 52 +months = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") +at2 = c(0,1,2,3,4,5,6,7,8,9,10,11) +at2 = at2 /12 * 52 +at2 = at2 + .5 * 52/12 +months.grid = T +make.title= F +bottom.margin = 4 +top.margin=.5 +box.lwd=1 +line_types = c(1,1,1,1,1,1) +line_colors = c("red","blue", "green", "orange") +bar_color = c("#330099", "#FF6600") +base_line_col = "green" +base_line_col = c(654) + diff --git a/sandbox/docbook/examples/graphics/make_x_axis.R b/sandbox/docbook/examples/graphics/make_x_axis.R new file mode 100644 index 000000000..e5bb723e9 --- /dev/null +++ b/sandbox/docbook/examples/graphics/make_x_axis.R @@ -0,0 +1,5 @@ +if(months.grid == T) mtext(side = 1, xlab.text, line=2) +if(months.grid == T) axis(1, at=at, labels=F, line=4, +cex.axis=months.font, lab=NULL ) +if(months.grid == T) axis(1, at=at2, labels=months, line=4, +cex.axis=months.font, lab=NULL, tick=F, mgp=c(3,0,0)) diff --git a/sandbox/docbook/examples/report1/charts/problem_solve.R b/sandbox/docbook/examples/graphics/problem_solve.R similarity index 97% copy from sandbox/docbook/examples/report1/charts/problem_solve.R copy to sandbox/docbook/examples/graphics/problem_solve.R index 89b6aaa04..2fc775a9a 100644 --- a/sandbox/docbook/examples/report1/charts/problem_solve.R +++ b/sandbox/docbook/examples/graphics/problem_solve.R @@ -19,7 +19,7 @@ if (length(opt$bw) > 0 && opt$bw == T){ bar_color = c("black", "lightgray") base_line_col = "black" } -rates <- read.csv("../tables/all.csv") +rates <- read.csv("../tables/warehouse_data.csv") title = "Problem Solving, 2010, 2011" x <- rates$week y1 <- rates$hours.problem.solve.2010 diff --git a/sandbox/docbook/examples/report1/.configure b/sandbox/docbook/examples/report1/.configure new file mode 100644 index 000000000..53172ce1f --- /dev/null +++ b/sandbox/docbook/examples/report1/.configure @@ -0,0 +1,75 @@ +set -e -u +# check for options with arguments +Usage() { + echo 'this is the help' + exit 1 +} +length=0 +BW=False +RES=100 +while [ $# -gt 0 ] +do + case "$1" in + + --) shift; break;; # ====> standard in + -h) Usage;; # ==> Help message. + --help) Usage;; + --bw) BW=True;; + --res) shift; RES=$1;; + -*) Usage;; # ===> illegal help + *) Usage;; # first argument not legal + esac + shift +done + +cd charts +( +cat << EOF +lwd=3 +font_size = .8 +tick_multiplier = 1 +lwd_grid = .3 +width=5.5 +margins=c(4, 4, .5, 0.5) +mgp = c(4, 1, 0) +legend_font_size = 0.8 +default_grid_color = "lightgray" +ax_col = default_grid_color +box_col = default_grid_color +rec_col = default_grid_color +bar_label_size = .8 +margins_bar=c(2, 4, .5, 0.5) +base_line_type = 2 +months.font = .6 +at = c(0,1,2,3,4,5,6,7,8,9,10,11,12) +at = at /12 * 52 +months = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") +at2 = c(0,1,2,3,4,5,6,7,8,9,10,11) +at2 = at2 /12 * 52 +at2 = at2 + .5 * 52/12 +months.grid = T +make.title= F +bottom.margin = 4 +top.margin=.5 +box.lwd=1 +line_types = c(1,1,1,1,1,1) +line_colors = c("red","blue", "green", "orange") +bar_color = c("#330099", "#FF6600") +base_line_col = "green" +base_line_col = c(654) +EOF +) > .Rprofile + +echo res = $RES >> .Rprofile + +if [ "$BW" == "True" ]; then +( +cat << EOF +line_types = c(2,1,3,4,5,6) +line_colors = c(rep("black", 10)) +bar_color = c("black", "lightgray") +base_line_col = "black" +EOF +) >> .Rprofile +fi +cd .. diff --git a/sandbox/docbook/examples/report1/charts/problem_solve.R b/sandbox/docbook/examples/report1/charts/problem_solve.R index 89b6aaa04..bcda16f29 100644 --- a/sandbox/docbook/examples/report1/charts/problem_solve.R +++ b/sandbox/docbook/examples/report1/charts/problem_solve.R @@ -1,25 +1,6 @@ # load("rates") -library('getopt') -spec = matrix(c( - 'draft' , 'd', 0, "logical", - 'make.title' , 't', 0, "logical", - 'bw' , 'b', 0, "logical" -), ncol=4, byrow=T) -opt = getopt(spec) -if (length(opt$draft) > 0 && opt$draft == T){ - res = 100 - path = 'problem_solve_2010_2011_draft.png' -}else{ - res = 500 - path = 'problem_solve_2010_2011.png' -} -if (length(opt$bw) > 0 && opt$bw == T){ - line_types = c(2,1,3,4,5,6) - line_colors = c(rep("black", 10)) - bar_color = c("black", "lightgray") - base_line_col = "black" -} rates <- read.csv("../tables/all.csv") +path = 'problem_solve_2010_2011.png' title = "Problem Solving, 2010, 2011" x <- rates$week y1 <- rates$hours.problem.solve.2010 diff --git a/sandbox/docbook/examples/report1/charts/receive_rates_with_adj.R b/sandbox/docbook/examples/report1/charts/receive_rates_with_adj.R index 8659d4c8b..5b2394e4d 100644 --- a/sandbox/docbook/examples/report1/charts/receive_rates_with_adj.R +++ b/sandbox/docbook/examples/report1/charts/receive_rates_with_adj.R @@ -1,23 +1,4 @@ -library('getopt') -spec = matrix(c( - 'draft' , 'd', 0, "logical", - 'make.title' , 't', 0, "logical", - 'bw' , 'b', 0, "logical" -), ncol=4, byrow=T) -opt = getopt(spec) -if (length(opt$draft) > 0 && opt$draft == T){ - res = 100 - path = 'receive_rate_adjusted_draft.png' -}else{ - res = 500 - path = 'receive_rate_adjusted.png' -} -if (length(opt$bw) > 0 && opt$bw == T){ - line_types = c(2,1,3,4,5,6) - line_colors = c(rep("black", 10)) - bar_color = c("black", "lightgray") - base_line_col = "black" -} +path = 'receive_rate_adjusted_draft.png' rates <- read.csv("../tables/all.csv") x = rates$week direct.hours <- rates$direct.hours.receive.2011 diff --git a/sandbox/docbook/examples/report1/docbook_fo.xsl b/sandbox/docbook/examples/report1/docbook_fo.xsl index 8f6586213..a0ab84440 100644 --- a/sandbox/docbook/examples/report1/docbook_fo.xsl +++ b/sandbox/docbook/examples/report1/docbook_fo.xsl @@ -7,7 +7,7 @@ - + appendix toc,title diff --git a/sandbox/docbook/examples/report1/make_title_page.xsl b/sandbox/docbook/examples/report1/make_title_page.xsl index 56fe6bcd3..ff064927d 100644 --- a/sandbox/docbook/examples/report1/make_title_page.xsl +++ b/sandbox/docbook/examples/report1/make_title_page.xsl @@ -4,5 +4,8 @@ version="1.1"> + + diff --git a/sandbox/docbook/examples/report1/makefile b/sandbox/docbook/examples/report1/makefile dissimilarity index 60% index 802d2db19..6a881c32d 100644 --- a/sandbox/docbook/examples/report1/makefile +++ b/sandbox/docbook/examples/report1/makefile @@ -1,71 +1,35 @@ -all: title_page.xsl charts/problem_solve_2010_2011.png charts/receive_rate_adjusted.png\ - report.pdf - -draft:title_page.xsl charts/receive_rate_adjusted_draft.png charts/problem_solve_2010_2011_draft.png report_draft\ - report.pdf - -bw: title_page.xsl charts/receive_rate_adjusted_bw.png charts/problem_solve_2010_2011_bw.png\ - report_bw.pdf - -bwdraft: title_page.xsl charts/receive_rate_adjusted_bw_draft.png charts/problem_solve_2010_2011_bw_draft.png\ - report_draft report_bw.pdf - - -title_page.xsl: title_page.xml - xsltproc make_title_page.xsl title_page.xml > title_page.xsl - -charts/problem_solve_2010_2011.png: charts/problem_solve.R - cd charts; Rscript problem_solve.r - -charts/problem_solve_2010_2011_draft.png: charts/problem_solve.R - cd charts; Rscript problem_solve.r --draft - -charts/problem_solve_2010_2011_bw.png: charts/problem_solve.R - cd charts; Rscript problem_solve.r --bw;\ - cp problem_solve_2010_2011.png problem_solve_2010_2011_bw.png - -charts/problem_solve_2010_2011_bw_draft.png: charts/problem_solve.R - cd charts; Rscript problem_solve.r --bw --draft;\ - cp problem_solve_2010_2011_draft.png problem_solve_2010_2011_bw_draft.png - -charts/receive_rate_adjusted.png: charts/problem_solve.R - cd charts; Rscript receive_rates_with_adj.R - -charts/receive_rate_adjusted_draft.png: charts/problem_solve.R - cd charts; Rscript receive_rates_with_adj.R --draft - -charts/receive_rate_adjusted_bw.png: charts/problem_solve.R - cd charts; Rscript receive_rates_with_adj.R --bw;\ - cp receive_rate_adjusted.png receive_rate_adjusted_bw.png - -charts/receive_rate_adjusted_bw_draft.png: charts/problem_solve.R - cd charts; Rscript receive_rates_with_adj.R --bw --draft;\ - cp receive_rate_adjusted_draft.png receive_rate_adjusted_bw_draft.png - -report.xml: report.rst - rst2xml.py --no-doctype --trim-footnote-reference-space report.rst |rstxml2xml.py > report.xml - xsltproc format_numbers.xsl report.xml > tmp - cat tmp > report.xml - rm tmp - xsltproc long_tables.xsl report.xml > tmp - cat tmp > report.xml - rm tmp - - -report_docbook.xml: report.xml - xsltproc rst_docbook.xsl report.xml > report_docbook.xml - -report_draft: report.xml - xsltproc rst_docbook_draft.xsl report.xml > report_docbook.xml - -report_docbook.fo: report_docbook.xml - xsltproc docbook_fo.xsl report_docbook.xml > report_docbook.fo - -report.pdf: report_docbook.fo - fop -fo report_docbook.fo -pdf report.pdf - -report_bw.pdf: report_docbook.fo - fop -fo report_docbook.fo -pdf report_bw.pdf - -clean: - rm -f charts/*png report.xml report_docbook.xml report_docbook.fo report.pdf report_bw.pdf title_page.xsl +all: title_page.xsl charts/problem_solve_2010_2011.png charts/receive_rate_adjusted.png\ + report.pdf + +title_page.xsl: title_page.xml + xsltproc make_title_page.xsl title_page.xml > title_page.xsl + +charts/problem_solve_2010_2011.png: charts/problem_solve.R + cd charts; Rscript problem_solve.r + + +charts/receive_rate_adjusted.png: charts/problem_solve.R + cd charts; Rscript receive_rates_with_adj.R + +report.xml: report.rst + rst2xml.py --no-doctype --trim-footnote-reference-space report.rst |rstxml2xml.py > report.xml + xsltproc format_numbers.xsl report.xml > tmp + cat tmp > report.xml + rm tmp + xsltproc long_tables.xsl report.xml > tmp + cat tmp > report.xml + rm tmp + + +report_docbook.xml: report.xml + xsltproc rst_docbook.xsl report.xml > report_docbook.xml + +report_docbook.fo: report_docbook.xml + xsltproc docbook_fo.xsl report_docbook.xml > report_docbook.fo + +report.pdf: report_docbook.fo + fop -fo report_docbook.fo -pdf report.pdf + +clean: + rm -f charts/*png report.xml report_docbook.xml report_docbook.fo report.pdf report_bw.pdf title_page.xsl\ + charts/.Rhistory charts/.Rprofile diff --git a/sandbox/docbook/examples/report2/.configure b/sandbox/docbook/examples/report2/.configure new file mode 100644 index 000000000..53172ce1f --- /dev/null +++ b/sandbox/docbook/examples/report2/.configure @@ -0,0 +1,75 @@ +set -e -u +# check for options with arguments +Usage() { + echo 'this is the help' + exit 1 +} +length=0 +BW=False +RES=100 +while [ $# -gt 0 ] +do + case "$1" in + + --) shift; break;; # ====> standard in + -h) Usage;; # ==> Help message. + --help) Usage;; + --bw) BW=True;; + --res) shift; RES=$1;; + -*) Usage;; # ===> illegal help + *) Usage;; # first argument not legal + esac + shift +done + +cd charts +( +cat << EOF +lwd=3 +font_size = .8 +tick_multiplier = 1 +lwd_grid = .3 +width=5.5 +margins=c(4, 4, .5, 0.5) +mgp = c(4, 1, 0) +legend_font_size = 0.8 +default_grid_color = "lightgray" +ax_col = default_grid_color +box_col = default_grid_color +rec_col = default_grid_color +bar_label_size = .8 +margins_bar=c(2, 4, .5, 0.5) +base_line_type = 2 +months.font = .6 +at = c(0,1,2,3,4,5,6,7,8,9,10,11,12) +at = at /12 * 52 +months = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") +at2 = c(0,1,2,3,4,5,6,7,8,9,10,11) +at2 = at2 /12 * 52 +at2 = at2 + .5 * 52/12 +months.grid = T +make.title= F +bottom.margin = 4 +top.margin=.5 +box.lwd=1 +line_types = c(1,1,1,1,1,1) +line_colors = c("red","blue", "green", "orange") +bar_color = c("#330099", "#FF6600") +base_line_col = "green" +base_line_col = c(654) +EOF +) > .Rprofile + +echo res = $RES >> .Rprofile + +if [ "$BW" == "True" ]; then +( +cat << EOF +line_types = c(2,1,3,4,5,6) +line_colors = c(rep("black", 10)) +bar_color = c("black", "lightgray") +base_line_col = "black" +EOF +) >> .Rprofile +fi +cd .. diff --git a/sandbox/docbook/examples/report2/docbook_fo.xsl b/sandbox/docbook/examples/report2/docbook_fo.xsl index 8f6586213..2411b346f 100644 --- a/sandbox/docbook/examples/report2/docbook_fo.xsl +++ b/sandbox/docbook/examples/report2/docbook_fo.xsl @@ -4,10 +4,7 @@ xmlns:d="http://docbook.org/ns/docbook" version="1.1"> - - + appendix toc,title diff --git a/sandbox/docbook/examples/report2/make_title_page.xsl b/sandbox/docbook/examples/report2/make_title_page.xsl index 56fe6bcd3..d0d4ae757 100644 --- a/sandbox/docbook/examples/report2/make_title_page.xsl +++ b/sandbox/docbook/examples/report2/make_title_page.xsl @@ -4,5 +4,5 @@ version="1.1"> - + diff --git a/sandbox/docbook/examples/report2/makefile b/sandbox/docbook/examples/report2/makefile index 478018f23..09a7db9f4 100644 --- a/sandbox/docbook/examples/report2/makefile +++ b/sandbox/docbook/examples/report2/makefile @@ -148,4 +148,4 @@ report.pdf: report_docbook.fo fop -fo report_docbook.fo -pdf report.pdf clean: - rm -f charts/*png title_page.xsl report.xml report_docbook.xml report_docbook.fo report.pdf + rm -f charts/*png title_page.xsl report.xml report_docbook.xml report_docbook.fo report.pdf charts/.Rprofile diff --git a/sandbox/docbook/examples/report2/report.rst b/sandbox/docbook/examples/report2/report.rst index 8911d0a03..a6ecce6f5 100644 --- a/sandbox/docbook/examples/report2/report.rst +++ b/sandbox/docbook/examples/report2/report.rst @@ -109,11 +109,12 @@ there are fewer shipping stations. Hence the rate is much higer. :height: 2.6in :width: 5.73in :alt: Shipping Rate, 2010 + :name: shipping-graph Units shipped per hour over weeks, with a trend line. The first decline occurred during week 31, at the start of August, when ZFC had to close down PANDA stations to install SLAM lines. The second - decline, in the shaded area, occurred during the cutover. _`shipping-graph` + decline, in the shaded area, occurred during the cutover. Here are the other processes, compared with the previous year, included for completeness. @@ -440,9 +441,10 @@ requires more labor, hurting efficiency rates. :height: 3.6in :width: 5.73in :alt: Return Rates for 2010 + :name: returns-graph Units Processed per hour over weeks, for returns, in 2011. - _`returns-graph` + The percentage of indirect labor also increased at the same time. -- 2.11.4.GIT