Thursday, January 28, 2016

pwo/grs - prepare PPT-12 content


grs-pvt-course-defn-01-08-16.yaml references PPT chaps 1-12.
other files not needed.

rename so filenames match existing content files

[smr@smr 01-renamed]$ rename --dry-run s/PPT-12/PPT/ *.html
'PPT-12_Ch01.html' would be renamed to 'PPT_Ch01.html'
'PPT-12_Ch02.html' would be renamed to 'PPT_Ch02.html'
'PPT-12_Ch03.html' would be renamed to 'PPT_Ch03.html'
'PPT-12_Ch04.html' would be renamed to 'PPT_Ch04.html'
'PPT-12_Ch05.html' would be renamed to 'PPT_Ch05.html'
'PPT-12_Ch06.html' would be renamed to 'PPT_Ch06.html'
'PPT-12_Ch07.html' would be renamed to 'PPT_Ch07.html'
'PPT-12_Ch08.html' would be renamed to 'PPT_Ch08.html'
'PPT-12_Ch09.html' would be renamed to 'PPT_Ch09.html'
'PPT-12_Ch10.html' would be renamed to 'PPT_Ch10.html'
'PPT-12_Ch11.html' would be renamed to 'PPT_Ch11.html'
'PPT-12_Ch12.html' would be renamed to 'PPT_Ch12.html'

'PPT-12_intro.html' would be renamed to 'PPT_intro.html'

extract body and change image src to point to S3 location

#!/usr/bin/env ruby
# coding: utf-8
# usage:
# ./extract.rb *.html
require 'open-uri'
require "nokogiri"

output_dir = "output";
if !Dir.exists?(output_dir)
  Dir.mkdir(output_dir)
end


ARGV.each do|filename|
  puts "processing #{filename}"
  content = File.read(filename)
  doc = Nokogiri::HTML(content)

  # extract the body
  body_contents = doc.at_css("body").inner_html

  # use a regex to point to S3 images
  body_contents_s3_images = body_contents.gsub(/"images/, '"http://images.prepware.com/ppt-12')

  # write a new html file
  outfile = File.join(output_dir, filename)
  aFile = File.new(outfile, "w")
  aFile.write(body_contents_s3_images)
  aFile.close
end





add styles to ground_school.scss

/Users/smr/current_projects/pws2016/app/assets/stylesheets/ground_school.scss

// ##################################################
// # PPT-12 
// ##################################################

// @page {
//   margin : 0.5em;
// }
// tbody, thead, tfoot, tr, td, th {
//   border-style : inherit;
//   border-width : inherit;
//   border-color : inherit;
// }
.leftFloat {
  float : left;
}
.rightFloat {
  float : right;
}
div.figcap {
  page-break-inside:avoid;
  margin: 1.5em 0em 1.5em 0em;
}
div.figcap img{
  max-width: 100%;
}
div.figbox {
  margin: 1.5em 0em 0em 0em;
  padding: .5em;
  border:thin solid black;
}
// ul {
//   margin: .12em 0em .8em 1em;
// }
// sub {
//   font-size: 70%;
//   vertical-align: text-bottom;
// }
// sup {
//   font-size: 70%;
//   vertical-align: text-top;
// }
strong.bolditalic {
  font-weight : bold;
  font-style : italic;
}
span.smallcaps {
  font-variant : small-caps;
}
span.strikethrough {
  text-decoration:line-through;
}
p.appendixbody {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .37em 0em;
}
p.appendixbody-lessspace {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .125em 0em;
}
p.appendix-numlist-L1 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : -.8em;
  margin : 0em 0em .125em .8em;
}
p.appendix-numlist-L1last {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : -.8em;
  margin : 0em 0em .37em .8em;
}
p.appendix-numlist-L2 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : -.8em;
  margin : 0em 0em .125em 1.6em;
}
p.appendix-numlist-L3 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : -.8em;
  margin : 0em 0em .125em 2.4em;
}
p.appendixtitle {
  font-family : Helvetica, sans-serif;
  font-weight : 300;
  font-style : normal;
  font-size : 2.33em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em 1em 0em;
}
p.body {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .6em 0em;
}
p.body-nospace {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em;
}
p.body-spaceb4 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : .5em 0em 0em 0em;
}
li.bullet {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .25em 0em;
}
p.caption {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : italic;
  font-size : 0.88em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : .12em 0em .5em 0em;
}
p.caption2 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : italic;
  font-size : 0.88em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : .12em 0em 1.5em 0em;
}
p.chapternumber {
  font-family : Helvetica, sans-serif;
  font-weight : 900;
  font-style : normal;
  font-size : 1.46em;
  text-decoration : none;
  text-transform : uppercase;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 1em 0em 0em 0em;
}
p.chaptertitle {
  font-family : Helvetica, sans-serif;
  font-weight : 300;
  font-style : normal;
  font-size : 2.5em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em 1em 0em;
}
p.copyright {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.8em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .56em 0em;
}
p.copyrightnote {
  font-family : serif;
  font-weight : bold;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : center;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .87em 0em;
}
p.footnote {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.8em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : -.56em;
  margin : 0em 0em .5em .56em;
}
p.fpsubhead {
  font-family : Helvetica, sans-serif;
  font-weight : 900;
  font-style : italic;
  font-size : 1.58em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em 1.5em 0em;
}
p.index-L1 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : -.56em;
  margin : 0em 1.12em 0em .56em;
}
p.index-L2 {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : -.62em;
  margin : 0em 0em 0em 1.25em;
}
p.inline-figure {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em;
}
li.numbered {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .19em 0em;
}
p.reviewanswers {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.85em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em;
}
p.reviewanswersubhead {
  font-family : "Times New Roman", serif;
  font-weight : bold;
  font-style : normal;
  font-size : 0.85em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 1.69em 0em 0em 0em;
}
p.reviewquestion {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : -1.12em;
  margin : 1em 0em .25em 1.12em;
}
p.reviewquestionchoices {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : justify;
  color : #000000;
  text-indent : 0em;
  margin : .2em 0em 0em 1.12em;
}
p.reviewsubhead {
  font-family : Helvetica, sans-serif;
  font-weight : 900;
  font-style : italic;
  font-size : 1.58em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 1.5em 0em 0em 0em;
}
p.subhead1 {
  font-family : Helvetica, sans-serif;
  font-weight : 900;
  font-style : italic;
  font-size : 1.5em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  page-break-after:avoid;
  text-indent : 0em;
  margin : 1.25em 0em .125em 0em;
}
p.subhead1-nospace {
  font-family : Helvetica, sans-serif;
  font-weight : 900;
  font-style : italic;
  font-size : 1.5em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  page-break-after:avoid;
  text-indent : 0em;
  margin : 0em 0em .125em 0em;
}
p.subhead2 {
  font-family : Helvetica, sans-serif;
  font-weight : 900;
  font-style : normal;
  font-size : 1.2em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  page-break-after:avoid;
  text-indent : 0em;
  margin : 0.5em 0em 0em 0em;
}
p.subhead3 {
  font-family : Helvetica, sans-serif;
  font-weight : bold;
  font-style : italic;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  page-break-after:avoid;
  text-indent : 0em;
  margin : .125em 0em 0em 0em;
}
p.tabletext {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .19em 0em;
}
p.tabletext-right {
  font-family : "Times New Roman", serif;
  font-weight : normal;
  font-style : normal;
  font-size : 0.9em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : right;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .19em 0em;
}
p.toc {
  font-family : Helvetica, sans-serif;
  font-weight : normal;
  font-style : italic;
  font-size : 1em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0.5em 0em 0em 0em;
}
p.weather {
  font-family : Courier, serif;
  font-weight : normal;
  font-style : normal;
  font-size : .75em;
  text-decoration : none;
  font-variant : normal;
  line-height : 1.2;
  text-align : left;
  color : #000000;
  text-indent : 0em;
  margin : 0em 0em .3em 0em;
}
table.Basic-Table {
  margin-top: .5em;
  margin-bottom: .5em;
  border: 1px solid black;
  border-collapse:collapse;
}
// td, th {
//   padding-right: .37em;
//   padding-left: .37em;
//   padding-bottom: .12em;
//   padding-top: .12em;
//   border: 1px solid black;
//   vertical-align:top;
//   text-align : left;
//   text-indent : 0em;
//   margin : 0em;
// }
// div.Basic-Text-Frame {
// }