Permalink
Browse files

Convert documentation from Idiopidae to Gorgyrella.

  • Loading branch information...
1 parent 72faa11 commit 7a71ebc1237ab66dc2d69959a06075c7c3f5813e @ananelson ananelson committed Jul 1, 2009
View
@@ -115,6 +115,7 @@ def add(style)
if style.nil?
0x10 # Return the index of the default style.
else
+ # TODO find way to freeze style so if someone modifies a StyleFormat instance it won't affect previously formatted cells.
add_style(style)[1] # Return the index of the style just stored.
end
end
View
@@ -26,10 +26,13 @@ title: #{File.basename(n)}
layout: web
filter:
- erb
- - idio
---
-<%= idio("/Users/ana/work/surpass/lib/#{File.basename(n)}") %>
+<%= gorg("/Users/ana/work/surpass/lib/#{File.basename(n)}") %>
}
end
end
end
+
+
+require "gorgyrella"
+require "surpass"
Binary file not shown.
View
@@ -4,10 +4,8 @@ author: Ana Nelson
layout: web
filter:
- erb
- - idio
- textile
---
-<% require "surpass" %>
h1. <%= @page.title %>
Homepage of the Surpass project. Surpass is software for creating Excel spreadsheets in pure native Ruby. Surpass is currently on version <%= Surpass::VERSION %> and is not yet ready for production use, however there are plenty of working examples for those who can't wait for a more stable 0.1.0 release.
@@ -21,6 +19,6 @@ You'll need "bazaar":http://bazaar-vcs.org, of course.
Download the "manual":surpass-manual-<%= Surpass::VERSION.gsub(".", "-") %>.pdf
View "examples":examples
-<%= idio("examples/formatting.rb") %>
+<%= gorg("content/examples/formatting.rb", "1", "latex") %>
<img src="examples/formatting.png" />
@@ -5,11 +5,8 @@ created_at: 2009-01-30 13:08:32.468894 +00:00
layout: book
filter:
- erb
- - idio
---
-<% require "../lib/surpass" -%>
-
-To compile this documentation requires \LaTeX, \href{http://pypi.python.org/pypi/idiopidae}{Idiopidae}, and my branch of \href{http://webby.rubyforge.org/}{webby}, which is available from a bzr repository at http://ananelson.com/code/webby/.
+To compile this documentation requires \LaTeX and the gems Gorgyrella and Webby.
This documentation refers to Surpass version <%= Surpass::VERSION %>.
@@ -45,7 +42,7 @@ Let's do a minimal "Hello World" script. We'll need to take care of any imports,
\subsection{Surpass}
-<%= lidio("examples/hello-world.rb")%>
+<%= gorgl("content/examples/hello-world.rb")%>
\subsection{Result}
@@ -63,7 +60,7 @@ And, here's how it looks.
The basic method for writing data to cells is the worksheet's write method.
-<%= lidio("../../lib/worksheet.rb", "write-method")%>
+<%= gorgl("../lib/worksheet.rb", "write-method")%>
There are two required arguments, the row and column. These are zero-based indexes for the row and column. To write to the first cell in the spreadsheet, you would pass 0, 0. The next argument is the label, this is the value you want written in the cell. This defaults to an empty string (for no particular reason). You can write nil, a String, a Boolean, a Numeric or a Date format. If you pass an object belonging to an unsupported class, you will get an error message, and in this case you should call some method on your object which will return a String or whatever the appropriate label is. The fourth argument is for style, which should be either nil, true, a hash or an instance of the StyleFormat class. See the chapter on Formatting for more information. The style parameter defaults to nil, which means that the default Excel format will be applied.
@@ -72,7 +69,7 @@ There are two required arguments, the row and column. These are zero-based index
Frequently, you may want to write more than one value at a time, and so Surpass has convenience methods which handle arrays for you. In the background, these are just looping over the array and calling write() for each value you pass. There's no magic here and, for now at least, no clever optimization. The available methods are write\_array\_to\_row, write\_array\_to\_column, and write\_arrays. The write\_arrays method expects an array of arrays, the first two expect a single array.
-<%= lidio("../../lib/worksheet.rb", "write-arrays") %>
+<%= gorgl("../lib/worksheet.rb", "write-arrays") %>
% section writing_arrays_of_data (end)
@@ -85,14 +82,14 @@ Frequently, you may want to write more than one value at a time, and so Surpass
Autoformats are number formats which are automatically applied to Dates, Floats and similar classes. To have autoformats applied, then pass true as the style parameter to the write function.
Here is the relevant code from row.rb:
-<%= lidio("../../lib/row.rb", "autoformats") %>
+<%= gorgl("../lib/row.rb", "autoformats") %>
And here are the default formats being defined in style.rb:
-<%= lidio("../../lib/style.rb", "autoformats") %>
+<%= gorgl("../lib/style.rb", "autoformats") %>
If you use any of the array-writing methods, then autoformatting will be applied by default. To override this behaviour you can pass your own StyleFormat or nil to use the generic default format.
-<%= lidio("examples/autoformat.rb") %>
+<%= gorgl("content/examples/autoformat.rb") %>
\includegraphics[width=15cm]{examples/autoformat.png}
@@ -108,13 +105,17 @@ If you use any of the array-writing methods, then autoformatting will be applied
There is a command line tool included with Surpass which provides some useful reference data:
-<%= lidio("examples/surpass-info.sh") %>
-<%= latex_verbatim IO.popen("cd ..; bash webby/content/examples/surpass-info.sh").read %>
+<%= gorgl("content/examples/surpass-info.sh") %>
+\begin{verbatim}
+ <%= IO.popen("cd ..; bash webby/content/examples/surpass-info.sh").read %>
+\end{verbatim}
And since you are running this on the command line, you can save or pipe the output to other commands:
-<%= lidio("examples/show-greens.sh") %>
-<%= latex_verbatim IO.popen("cd ..; bash webby/content/examples/show-greens.sh").read %>
+<%= gorgl("content/examples/show-greens.sh") %>
+\begin{verbatim}
+ <%= IO.popen("cd ..; bash webby/content/examples/show-greens.sh").read %>
+\end{verbatim}
\section{StyleFormat Class}
@@ -140,7 +141,7 @@ This attribute is a simple string, specifying the numeric/date format to be appl
\newpage
-<%= lidio("examples/number-format-string.rb") %>
+<%= gorgl("content/examples/number-format-string.rb") %>
\includegraphics[width=16cm]{examples/number-format-string.png}
% section number_format_strings (end)
@@ -151,25 +152,31 @@ This attribute is a simple string, specifying the numeric/date format to be appl
Here is a list of available colours:
\begin{multicols}{3}
-<%= latex_verbatim(Formatting::COLOURS.keys.sort.join("\n")) %>
+\begin{verbatim}
+<%= Formatting::COLOURS.keys.sort.join("\n") %>
+\end{verbatim}
\end{multicols}
\includegraphics[width=16cm]{examples/colours.png}
\subsection{Border Formats}
Here is a list of available border line types:
-<%= latex_verbatim(Borders.line_type_directives.join("\n")) %>
+\begin{verbatim}
+ <%= Borders.line_type_directives.join("\n") %>
+\end{verbatim}
\includegraphics[width=16cm]{examples/borders.png}
\subsection{Fill Patterns}
Here is a list of available fill patterns:
-<%= latex_verbatim(Pattern.fill_directives.join("\n")) %>
+\begin{verbatim}
+<%= Pattern.fill_directives.join("\n") %>
+\end{verbatim}
\includegraphics[width=16cm]{examples/patterns.png}
\subsection{Surpass}
-<%= lidio("examples/formatting.rb")%>
+<%= gorgl("content/examples/formatting.rb")%>
And, here's how it looks.
@@ -184,7 +191,7 @@ Typically, you will call the workbook's save() method to write that workbook to
However, you can also call a workbook's data() method, which gives you direct access to a workbook's binary data. You can write this to a file manually, as in this example:
-<%= lidio("examples/data.rb") %>
+<%= gorgl("content/examples/data.rb") %>
Or, you could use this data as an argument to Rails' send\_data method.

0 comments on commit 7a71ebc

Please sign in to comment.