Documentation (CodeName: MathML 4t24)

Greetings from #rdcHQ! This week in the MathML Track, we started our documentation phase. We created a framework for our draft (which may change), and are now working on the content. As we do this, we will test our code to ensure that the processes we have established are repeatable, and package the resulting code on github in the MathML space. Jasper has also coded 60 more equations … cool! … and once the rest are complete we are going to put our theory into practice.

SVG Track – Working With Paths Effectively

Greetings from #rdcHQ! This week in the SVG Track, we completed another directory of diagrams, and continue to invent time saving techniques to make production easier using a clever combination of commands in Inkscape and a public domain graphic we added to the repository a few weeks ago,

Viewing The Source

Our source SVG was comprised of an outline of the contiguous states on the left and an overlay of the boundaries of the states as a series of disjointed lines on the right.

To illustrate the poor quality of the art, the State of Iowa is rendered as six unconnected lines. Using a few of the basic techniques illustrated earlier in the program (Stroke To Path → Union → Break Apart), we transformed the art into a useful collection of graphics in minutes.

Improving The Art

The first step required setting an appropriate line weight and join in Inkscape for the art. Joins come in three flavors: Miter, Round and Bevel, and are important in determining the character of the line in an illustration. We chose a round join for this exercise.

Once a suitable line weight has been determined, The lines can be interconnected using Stroke To Path → Union. This creates a nifty outline of all the states as shown in the resulting SVG.

The next step is to break apart the outline so the graphic becomes a geographic puzzle where each state can be individually selected and used as art:

This exercise results in three production-ready* instantiations of the source art – an outline, a silhouette of the 48 contiguous states, and individual graphics for all 50 states. We added all of the art to our repository and dedicate the improved art to the public domain for others to remix, re-use and enjoy! #w00t!

*albeit not necessarily geographically accurate – sounds like another cool track for #rdcHQ :-)

Hacker Wednesday – Design Takes Center Stage!

Today at Hacker Wednesday … we began a very productive session by working with Oceana’s stage art and rearranging it a bit to be more web friendly. We took a look at some other web sites in the same space (including Disney) and decided to make the target resolution of the splash page 1024 x 768 pixels.

Revised stage mockup by the WordPress Crew at #rdcHQ

The new arrangement leaves ample space for our signature animation and navigation, and we now have a showcase area directly below this visual centerpiece to highlight current shows and photographs from rehearsals and productions (this is a very smart new feature as both Dan and Anita Almich are excellent photographers). We have also chosen an elegant, uncluttered layout in a conscious effort to resist the trend to clutter a design with too many navigational options and too much information. Our goal is to tell a story through photography and build the New Artists Productions brand (by highlighting the excellent logo which was also designed by Dan and Anita Almich). We also have a lot of ideas on how we can use the available space to highlight sponsors and/or build networking opportunities with other area organizations and businesses. There is a lot of room for New Artists Productions to grow into their new website!

MathML Track – Connecting The Code

Greetings from #rdcHQ! This week in the MathML Track, we made a big step towards finalizing how our equations will be integrated into the Title 24 documents. Jasper wrote a Ruby script that will solve that piece of the puzzle by creating a wrapper around each equation. This code will ultimately be published in github during our documentation phase.

Our draft code is below … More news as it develops! (We also have more equations to add to the repository … stay tuned!)

grem.rb (draft)

Note: We are still working out details on how to gracefully degrade to the generated SVG, and in the absence of an SVG, the original JPG image.

name = ARGV.shift #get individual filenames from helper.rb
# grem.rb: grep for MathML
# Jasper Shumaker-Pruitt
# extracts MathML from html files
# see helper.rb for instructions

File.open(name, "w") do |writefile|   #open a new file of the same name
  writefile.puts '<span class="display">
	<span id="equation-item[n]" class="formula">
		<span class="label">
			[EQUATION IDENTIFIER]
		</span>
		<span class="math">' #write some html to that file

  current_state = 0
  while line = gets    #iterate through the lines from original file
    if line.index("<math") #look for an opening math tag
      current_state = 1
    end
    if current_state > 0    #write the content from opening to closing math tags
      writefile.puts line
    end
    if line.index("</math") #quit writing when closing tag is found
      current_state -= 1
    end
  end
  writefile.puts '
		</span>
	</span>
</span>'  #write the rest of the html wrapper
end

helper.rb (draft)

Note: This code could be repurposed to convert an entire directory of xml/mml/html documents to svg with SVGMath.

#helper.rb
#Jasper Shumaker-Pruitt
#usage:
#1) create new destination directory
#2)into the command line type: ruby helper.rb SourceDir DestinationDir
# i.e. ruby helper.rb /home/foo/sourcedir /home/foo/destinationdir for a #computer named foo

origin = ARGV.shift #retrieve and store user input for source and destination
destin = ARGV.shift #directories
fileNameArray=`ls #{origin}`.split #create an array of filenames in source dir
fileNameArray.each do |htmlFile|  #iterate through array
 if !(htmlFile.index("~"))#ignore html backup files
 	system("ruby grem.rb #{destin}/#{htmlFile} < #{origin}/#{htmlFile}")
        #execute grem for each file
 end
end
Return top