Skip to content

Commit

Permalink
Additional doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonkenl committed May 10, 2016
1 parent 04dd1e3 commit 56aee90
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 111 deletions.
21 changes: 10 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
Major changes in version 1.0.0 (non-backwards compatible) to improve performance and incorporate new functionality, including:

- Refactored the `Unzip` module to extract `.xlsx` contents to file instead of memory to improve memory usage. The following functions were created to support this functionality:
..- `Xlsxir.Unzip.extract_to_file/2` - Extracts necessary files to a `./temp` directory for use during extraction
..- `Xlsxir.delete_temp_dir/1` - Deletes './temp' directory and all of its contents
- Implemented Simple API for XML (SAX) parsing functionalty via the [Erlsom](https://github.com/willemdj/erlsom) Erlang library to improve performance and allow support for large `.xlsx` files
..- `SweetXml` parsing library has been deprcated from `Xlsxir` and is no longer utilized in v1.0.0
- `Xlsxir.Unzip.extract_to_file/2` - Extracts necessary files to a `./temp` directory for use during extraction
- `Xlsxir.delete_dir/1` - Deletes './temp' directory and all of its contents
- Implemented Simple API for XML (SAX) parsing functionalty via the [Erlsom](https://github.com/willemdj/erlsom) Erlang library to improve performance and allow support for large `.xlsx` files. `SweetXml` parsing library has been deprcated from `Xlsxir` and is no longer utilized in v1.0.0
- Implemented Erlang Term Storage (ETS) for temporary storage of extracted data
- Removed `option` argument from the initial extract function (`Xlsxir.extract/3` is now `Xlsxir.extract/2`). Data is no longer returned via `Xlsxir.extract` and is instead written to an ETS table.
- Replaced `option` argument from the initial extract function (`Xlsxir.extract/3`) with `timer` which is a boolean flag that controls `Xlsxir.Timer` functionality. Data is no longer returned via `Xlsxir.extract/3` and is instead written to an ETS table.
- Implemented various functions for accessing the extracted data:
..- `Xlsxir.get_list/0` - Return entire worksheet data in the form of a list of row lists
..- `Xlsxir.get_map/0` - Return entire worksheet data in the form of a map of cell names and values
..- `Xlsxir.get_cell/1` - Return value of specified cell
..- `Xlsxir.get_row/1` - Return values of specified row
..- `Xlsxir.get_column/1` - Return values of specified column
- Implemented `Xlsxir.close/0` function to allow the deletion of the ETS table containing extracted worksheet data to free up memory
- `Xlsxir.get_list/0` - Return entire worksheet data in the form of a list of row lists
- `Xlsxir.get_map/0` - Return entire worksheet data in the form of a map of cell names and values
- `Xlsxir.get_cell/1` - Return value of specified cell
- `Xlsxir.get_row/1` - Return values of specified row
- `Xlsxir.get_col/1` - Return values of specified column
- Implemented `Xlsxir.close/0` function to allow the deletion of the ETS table containing extracted worksheet data to free up memory
- Implemented `Xlsxir.Timer` module for tracking elapsed time of extraction process
- Changed cell references from `atoms` to `strings` due to Elixir `atom` limitations (i.e. `:A1` to `"A1"`)
- Updated documentation and testing to incorporate changes
Expand Down
10 changes: 5 additions & 5 deletions doc/Xlsxir.Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>
Xlsxir.Index


<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L113" title="View Source" class="view-source" rel="help">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L116" title="View Source" class="view-source" rel="help">
<i class="icon-code"></i>
</a>

Expand Down Expand Up @@ -144,7 +144,7 @@ <h1 class="section-heading">
</a>
<span class="signature">delete()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L131" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L134" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -161,7 +161,7 @@ <h1 class="section-heading">
</a>
<span class="signature">get()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L127" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L130" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -178,7 +178,7 @@ <h1 class="section-heading">
</a>
<span class="signature">increment_1()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L123" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L126" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -195,7 +195,7 @@ <h1 class="section-heading">
</a>
<span class="signature">new()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L119" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L122" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand Down
4 changes: 2 additions & 2 deletions doc/Xlsxir.ParseWorksheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ <h1 class="section-heading">
which contains an ETS table that was started by <a href="Xlsxir.SaxParser.html#parse/2"><code class="inline">Xlsxir.SaxParser.parse/2</code></a>. </p>
<h2>Parameters</h2>
<ul>
<li>pattern - the XML pattern of the event to match upon
<li><code class="inline">arg1</code> - the XML pattern of the event to match upon
</li>
<li>state - the state of the <code class="inline">%RowState{}</code> struct which temporarily holds applicable data of the current row being parsed
<li><code class="inline">state</code> - the state of the <code class="inline">%RowState{}</code> struct which temporarily holds applicable data of the current row being parsed
</li>
</ul>
<h2>Example</h2>
Expand Down
28 changes: 14 additions & 14 deletions doc/Xlsxir.SaxParser.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,20 @@ <h2>Example</h2>
<li><p>cell ‘E1’ -&gt; date of 1/1/2016 or Excel date serial of 42370
The <code class="inline">.xlsx</code> file contents have been extracted to <code class="inline">./test/test_data/test</code>. For purposes of this example, we utilize the <code class="inline">get_at/1</code> function of each ETS module to pull a sample of the parsed
data. Keep in mind that the worksheet data is saved to the ETS table as a list of row lists, so the <a href="Xlsxir.Worksheet.html#get_at/1"><code class="inline">Xlsxir.Worksheet.get_at/1</code></a> function will return a full row of values.</p>
<p> iex&gt; Xlsxir.SaxParser.parse(./test/test_data/test/xl/styles.xml, :style)
:ok
iex&gt; Xlsxir.Style.get_at(0)
nil
iex&gt; Xlsxir.SaxParser.parse(./test/test_data/test/xl/sharedStrings.xml, :string)
:ok
iex&gt; Xlsxir.SharedString.get_at(0)
string one
iex&gt; Xlsxir.SaxParser.parse(./test/test_data/test/xl/worksheets/sheet1.xml, :worksheet)
:ok
iex&gt; Xlsxir.Worksheet.get_at(0)
[["A1", "string one"], ["B1", "string two"], ["C1", 10], ["D1", 20], ["E1", {2016, 1, 1}]]
iex&gt; Xlsxir.Worksheet.delete
true</p>
<pre><code class="iex elixir">iex&gt; Xlsxir.SaxParser.parse(&quot;./test/test_data/test/xl/styles.xml&quot;, :style)
:ok
iex&gt; Xlsxir.Style.get_at(0)
nil
iex&gt; Xlsxir.SaxParser.parse(&quot;./test/test_data/test/xl/sharedStrings.xml&quot;, :string)
:ok
iex&gt; Xlsxir.SharedString.get_at(0)
&quot;string one&quot;
iex&gt; Xlsxir.SaxParser.parse(&quot;./test/test_data/test/xl/worksheets/sheet1.xml&quot;, :worksheet)
:ok
iex&gt; Xlsxir.Worksheet.get_at(0)
[[&quot;A1&quot;, &quot;string one&quot;], [&quot;B1&quot;, &quot;string two&quot;], [&quot;C1&quot;, 10], [&quot;D1&quot;, 20], [&quot;E1&quot;, {2016, 1, 1}]]
iex&gt; Xlsxir.Worksheet.delete
true</code></pre>
</li>
</ul>

Expand Down
12 changes: 6 additions & 6 deletions doc/Xlsxir.SharedString.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>
Xlsxir.SharedString


<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L37" title="View Source" class="view-source" rel="help">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L40" title="View Source" class="view-source" rel="help">
<i class="icon-code"></i>
</a>

Expand Down Expand Up @@ -150,7 +150,7 @@ <h1 class="section-heading">
</a>
<span class="signature">add_shared_string(shared_string, index)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L47" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L50" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -167,7 +167,7 @@ <h1 class="section-heading">
</a>
<span class="signature">alive?()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L62" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L65" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -184,7 +184,7 @@ <h1 class="section-heading">
</a>
<span class="signature">delete()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L58" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L61" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -201,7 +201,7 @@ <h1 class="section-heading">
</a>
<span class="signature">get_at(index)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L51" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L54" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -218,7 +218,7 @@ <h1 class="section-heading">
</a>
<span class="signature">new()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L43" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L46" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand Down
18 changes: 9 additions & 9 deletions doc/Xlsxir.Style.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>
Xlsxir.Style


<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L67" title="View Source" class="view-source" rel="help">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L70" title="View Source" class="view-source" rel="help">
<i class="icon-code"></i>
</a>

Expand Down Expand Up @@ -169,7 +169,7 @@ <h1 class="section-heading">
</a>
<span class="signature">add_id(num_fmt_id)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L80" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L83" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -186,7 +186,7 @@ <h1 class="section-heading">
</a>
<span class="signature">add_style(style, index)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L93" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L96" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -203,7 +203,7 @@ <h1 class="section-heading">
</a>
<span class="signature">alive?()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L108" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L111" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -220,7 +220,7 @@ <h1 class="section-heading">
</a>
<span class="signature">delete()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L104" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L107" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -237,7 +237,7 @@ <h1 class="section-heading">
</a>
<span class="signature">delete_id()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L88" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L91" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -254,7 +254,7 @@ <h1 class="section-heading">
</a>
<span class="signature">get_at(index)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L97" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L100" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -271,7 +271,7 @@ <h1 class="section-heading">
</a>
<span class="signature">get_id()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L84" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L87" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -288,7 +288,7 @@ <h1 class="section-heading">
</a>
<span class="signature">new()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L74" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L77" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand Down
6 changes: 3 additions & 3 deletions doc/Xlsxir.Timer.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>
Xlsxir.Timer


<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L136" title="View Source" class="view-source" rel="help">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L139" title="View Source" class="view-source" rel="help">
<i class="icon-code"></i>
</a>

Expand Down Expand Up @@ -132,7 +132,7 @@ <h1 class="section-heading">
</a>
<span class="signature">start()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L142" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L145" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -149,7 +149,7 @@ <h1 class="section-heading">
</a>
<span class="signature">stop()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L148" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L151" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand Down
16 changes: 10 additions & 6 deletions doc/Xlsxir.Worksheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ <h2>
<a href="#new/0">new()</a>
</div>

<div class="summary-synopsis"><p>Initialize new ETS table with <code class="inline">[:set, :protected, :named_table]</code> options</p>
</div>

</div>

</div>
Expand Down Expand Up @@ -150,7 +153,7 @@ <h1 class="section-heading">
</a>
<span class="signature">add_row(row, index)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L11" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L14" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -167,7 +170,7 @@ <h1 class="section-heading">
</a>
<span class="signature">alive?()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L32" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L35" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -184,7 +187,7 @@ <h1 class="section-heading">
</a>
<span class="signature">delete()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L28" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L31" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -201,7 +204,7 @@ <h1 class="section-heading">
</a>
<span class="signature">get_at(index)</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L15" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L18" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

Expand All @@ -218,14 +221,15 @@ <h1 class="section-heading">
</a>
<span class="signature">new()</span>

<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L7" class="view-source" rel="help" title="View Source">
<a href="https://github.com/kennellroxco/xlsxir/blob/master/lib/xlsxir/state_manager.ex#L10" class="view-source" rel="help" title="View Source">
<i class="icon-code"></i>
</a>

</div>

<section class="docstring">

<p>Initialize new ETS table with <code class="inline">[:set, :protected, :named_table]</code> options.</p>

</section>
</div>

Expand Down
Loading

0 comments on commit 56aee90

Please sign in to comment.