Skip to content

Commit

Permalink
Merge pull request #104 from quintusm/gh-pages
Browse files Browse the repository at this point in the history
Use r:nuget to reference the Provider.
  • Loading branch information
quintusm authored May 10, 2024
2 parents 8fc8783 + cbfe90d commit eabb047
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 27 deletions.
9 changes: 4 additions & 5 deletions cells.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ <h1><a name="Accessing-Cells" class="anchor" href="#Accessing-Cells">Accessing C
<h2><a name="Example" class="anchor" href="#Example">Example</a></h2>
<p><img src="images/MultSheets.png" alt="alt text" title="Excel sample file with multiple sheets" /></p>
<p>This example demonstrates referencing the first column (with name <code>Fourth</code>) on row 4:</p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider dll</span>
<span class="pp">#r</span> <span class="s">&quot;ExcelProvider.dll&quot;</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider</span>
<span class="k">open</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">FSharp</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">Interop</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">Excel</span>

<span class="c">// Let the type provider do it&#39;s work</span>
Expand All @@ -157,14 +156,14 @@ <h2><a name="Example" class="anchor" href="#Example">Example</a></h2>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs11', 13)" onmouseover="showTip(event, 'fs11', 13)" class="id">test</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 14)" onmouseover="showTip(event, 'fs7', 14)" class="id">rows</span><span class="pn">.</span><span class="pn">[</span><span class="n">2</span><span class="pn">]</span><span class="pn">.</span><span class="id">Fourth</span>
</code></pre>
<p>And the variable <code>test</code> has the following value:</p>
<table class="pre"><tr><td><pre><code>No value returned by any evaluator</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code>4.2</code></pre></td></tr></table>
<p>Cells can be accessed dynamically using the zero-based column index or case-sensitive header name:</p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs12', 15)" onmouseover="showTip(event, 'fs12', 15)" class="id">testByIndex</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 16)" onmouseover="showTip(event, 'fs7', 16)" class="id">rows</span><span class="pn">.</span><span class="pn">[</span><span class="n">2</span><span class="pn">]</span><span class="pn">.</span><span class="id">GetValue</span> <span class="n">0</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs13', 17)" onmouseover="showTip(event, 'fs13', 17)" class="id">testByHeader</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 18)" onmouseover="showTip(event, 'fs7', 18)" class="id">rows</span><span class="pn">.</span><span class="pn">[</span><span class="n">2</span><span class="pn">]</span><span class="pn">.</span><span class="id">GetValue</span> <span class="s">&quot;Fourth&quot;</span>
</code></pre>
<p>The variables <code>testByIndex</code> and <code>testByHeader</code> have the respective values:</p>
<table class="pre"><tr><td><pre><code>No value returned by any evaluator</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code>No value returned by any evaluator</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code>4.2</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code>4.2</code></pre></td></tr></table>
<p>Accessing cell values by index or string header sacrifices type safety; the result signature is <code>obj</code>.</p>

<div class="fsdocs-tip" id="fs1">Multiple items<br />namespace FSharp<br /><br />--------------------<br />namespace Microsoft.FSharp</div>
Expand Down
21 changes: 16 additions & 5 deletions getting-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,21 @@
<div id="content">

<h1><a name="Getting-Started" class="anchor" href="#Getting-Started">Getting Started</a></h1>
<p>To get started simply add ExcelProvider.dll as a reference to your project.</p>
<p>If you are using F# scripts then just add the dll using the <code>#r</code> option.</p>
<p>If you then open <code>FSharp.Interop.Excel</code> you will have access to the Type Provider functionality.</p>
<p>You can then create a type for an individual workbook. The simplest option is to specify just the name of the workbook.
<p>To start using ExcelProvider simply reference the ExcelProvider NuGet Package.</p>
<div class="row">
<div class="span1"></div>
<div class="span6">
<div class="well well-small" id="nuget">
<p>For use in a project, use the following command in the Package Manager Console:</p>
<pre>PM> Install-Package ExcelProvider</pre>
<p>For use in an F# script, use the following directive:</p>
<pre>#r "nuget: ExcelProvider"</pre>
</div>
</div>
<div class="span1"></div>
</div>
<p>After referencing the package, open <code>FSharp.Interop.Excel</code> and you will have access to the Type Provider functionality.</p>
<p>You can create a type for an individual workbook. The simplest option is to specify just the name of the workbook.
You will then be given typed access to the data held in the first sheet.
The first row of the sheet will be treated as field names and the subsequent rows will be treated as values for these fields.</p>
<h2><a name="Parameters" class="anchor" href="#Parameters">Parameters</a></h2>
Expand All @@ -167,7 +178,7 @@ <h2><a name="Parameters" class="anchor" href="#Parameters">Parameters</a></h2>
<h2><a name="Example" class="anchor" href="#Example">Example</a></h2>
<p>This example shows the use of the type provider in an F# script on a sheet containing three rows of data:</p>
<p><img src="images/DataTypes.png" alt="alt text" title="Excel sample file with different types" /></p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider dll</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider</span>
<span class="k">open</span> <span onmouseout="hideTip(event, 'fs7', 8)" onmouseover="showTip(event, 'fs7', 8)" class="id">FSharp</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs2', 9)" onmouseover="showTip(event, 'fs2', 9)" class="id">Interop</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 10)" onmouseover="showTip(event, 'fs3', 10)" class="id">Excel</span>

<span class="c">// Let the type provider do it&#39;s work</span>
Expand Down
5 changes: 2 additions & 3 deletions headers.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ <h1><a name="Without-Headers" class="anchor" href="#Without-Headers">Without Hea
<h2><a name="Example" class="anchor" href="#Example">Example</a></h2>
<p>This example shows the use of the type provider in an F# script on a sheet containing no headers:</p>
<p><img src="images/DataTypesNoHeader.png" alt="alt text" title="Excel sample file with different types and no headers" /></p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider dll</span>
<span class="pp">#r</span> <span class="s">&quot;ExcelProvider.Runtime.dll&quot;</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider</span>
<span class="k">open</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">FSharp</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">Interop</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">Excel</span>

<span class="c">// Let the type provider do it&#39;s work</span>
Expand All @@ -159,7 +158,7 @@ <h2><a name="Example" class="anchor" href="#Example">Example</a></h2>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs11', 13)" onmouseover="showTip(event, 'fs11', 13)" class="id">test</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 14)" onmouseover="showTip(event, 'fs7', 14)" class="id">row</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 15)" onmouseover="showTip(event, 'fs12', 15)" class="id">Column2</span>
</code></pre>
<p>And the variable <code>test</code> has the following value:</p>
<table class="pre"><tr><td><pre><code>No value returned by any evaluator</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code>1.0</code></pre></td></tr></table>

<div class="fsdocs-tip" id="fs1">Multiple items<br />namespace FSharp<br /><br />--------------------<br />namespace Microsoft.FSharp</div>
<div class="fsdocs-tip" id="fs2">namespace FSharp.Interop</div>
Expand Down
14 changes: 11 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,17 @@
<main>
<div id="content">
<h1><a name="ExcelProvider" class="anchor" href="#ExcelProvider">ExcelProvider</a></h1>
<p>This library is for the .NET platform implementing a Excel type provider.</p>
<h2><a name="Introduction" class="anchor" href="#Introduction">Introduction</a></h2>
<p>ExcelProvider is a library for F# that is designed to make importing or processing data from Excel files easy. It provides a type provider which provides type-safe read-only access to the contents of Excel files. The provider can access data organized in rows and columns in specified sheets or ranges.</p>
<div class="row">
<div class="span1"></div>
<div class="span6">
<div class="well well-small" id="nuget">
The library can be <a href="https://nuget.org/packages/ExcelProvider">installed from NuGet</a>:
The library can be <a href="https://nuget.org/packages/ExcelProvider">installed from NuGet in the usual ways</a>:
<p>For use in a project, use the following command in the Package Manager Console:</p>
<pre>PM> Install-Package ExcelProvider</pre>
<p>For use in an F# script, use the following directive:</p>
<pre>#r "nuget: ExcelProvider"</pre>
</div>
</div>
<div class="span1"></div>
Expand All @@ -159,7 +163,6 @@ <h2><a name="Example" class="anchor" href="#Example">Example</a></h2>
<p>This example demonstrates the use of the type provider:</p>
<p><img src="images/DataTypes.png" alt="alt text" title="Excel sample file with different types" /></p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// reference the type provider dll</span>
<span class="pp">#r</span> <span class="s">&quot;ExcelProvider.Runtime.dll&quot;</span>
<span class="k">open</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">FSharp</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">Interop</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">Excel</span>

<span class="c">// Let the type provider do it&#39;s work</span>
Expand Down Expand Up @@ -227,6 +230,11 @@ <h2><a name="Contributing-and-copyright" class="anchor" href="#Contributing-and-
ExcelProvider
</a>
</li>
<li class="level-2">
<a href="#Introduction">
Introduction
</a>
</li>
<li class="level-2">
<a href="#Example">
Example
Expand Down
Loading

0 comments on commit eabb047

Please sign in to comment.