Skip to content

Commit

Permalink
Code Cleanup, documentation, bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin kotynia committed Jul 11, 2017
1 parent 3e0c298 commit 767fdb9
Show file tree
Hide file tree
Showing 26 changed files with 569 additions and 766 deletions.
4 changes: 0 additions & 4 deletions ExcelToHtml.Test/packages.config

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CEA40B00-BF81-4005-8715-EA196476FDBA}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ExcelToHtml.Test</RootNamespace>
<AssemblyName>ExcelToHtml.Test</AssemblyName>
<RootNamespace>ExcelToHtml.console</RootNamespace>
<AssemblyName>ExcelToHtml.console</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -32,6 +34,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.2.7.2\lib\net40\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -40,6 +49,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="YamlDotNet, Version=4.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.4.2.1\lib\net35\YamlDotNet.dll</HintPath>
</Reference>
Expand All @@ -58,5 +68,17 @@
<Name>ExcelToHtml</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="FodyWeavers.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets" Condition="Exists('..\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.1.0\build\netstandard1.0\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" />
</Project>
4 changes: 4 additions & 0 deletions ExcelToHtml.console/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura />
</Weavers>
40 changes: 23 additions & 17 deletions ExcelToHtml.Test/Program.cs → ExcelToHtml.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@
using System.Collections.Generic;
using System.IO;

namespace ExcelToHtmlConsole
namespace ExcelToHtml.CL
{
class Program
{
static void Main(string[] args)
{


//string localRepository = Directory.GetCurrentDirectory();
//string fullPath = String.Join("", args);

//TEST!!!
string ExcelPath = @"c:\git\ExcelToHtml\Test\Book1.xlsx";
// string ExcelPath = @"c:\git\ExcelToHtml\Test\Book1.xlsx";
string ExcelPath = String.Join("", args);
string DataPath = ExcelPath + ".yaml";
string HtmlPath = ExcelPath + ".html";

Console.WriteLine("ExcelToHtml https://github.com/marcinKotynia/ExcelToHtml ");
Console.WriteLine("Usage: ExcelToHtml.exe [Path] ");
Console.WriteLine("Usage: ExcelToHtml.exe c:\\book.xls ");

//try
//{


try
{
//Read Excel File
FileInfo ExcelFile = new FileInfo(ExcelPath);


var WorksheetHtml = new ExcelToHtml(ExcelFile);
var WorksheetHtml = new ExcelToHtml.ToHtml(ExcelFile);


//Read Data Simple JSON cell,value
Expand All @@ -39,11 +40,16 @@ static void Main(string[] args)
}
else
{
//Read Data From Yaml
Dictionary<string, string> values = new Dictionary<string, string>();

//Dictionary<string, string> Cells = new Dictionary<string, string>();
//InputOutput.Add("A1", "Hello World"); //set hello world
//InputOutput.Add("A2", "=2+1"); //set formula
//InputOutput.Add("[[TemplateField]]", "HelloTemplate"); //FillTempalte Filed
//InputOutput.Add(".A2", null); //Output value form A2

string Data = File.ReadAllText(DataPath);

//Read Data From Yaml
var DeSerializer = new YamlDotNet.Serialization.Deserializer();
Dictionary<string, string> Cells = DeSerializer.Deserialize<Dictionary<string, string>>(Data);

Expand All @@ -54,21 +60,21 @@ static void Main(string[] args)
string Yaml = Serializer.Serialize(output);

//For Debug Purpose output
File.WriteAllText(DataPath,Yaml);
File.WriteAllText(DataPath, Yaml);

}


string html = WorksheetHtml.ToHtml();
string html = WorksheetHtml.Execute();

File.WriteAllText(HtmlPath, html);

//}
//catch (Exception ex)
//{
// Console.WriteLine("ERROR " + ex.Message);
// Console.ReadKey();
//}
}
catch (Exception ex)
{
Console.WriteLine("ERROR " + ex.Message);
Console.ReadKey();
}


}
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions ExcelToHtml.console/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="1.6.2" targetFramework="net452" developmentDependency="true" />
<package id="DocumentFormat.OpenXml" version="2.7.2" targetFramework="net452" />
<package id="Fody" version="2.1.0" targetFramework="net452" developmentDependency="true" />
<package id="YamlDotNet" version="4.2.1" targetFramework="net452" />
</packages>
2 changes: 1 addition & 1 deletion ExcelToHtml.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.26403.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelToHtml", "ExcelToHtml\ExcelToHtml.csproj", "{3C6476A8-A156-4DB7-8ED5-6CD18DA32708}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelToHtmlConsole", "ExcelToHtml.Test\ExcelToHtmlConsole.csproj", "{CEA40B00-BF81-4005-8715-EA196476FDBA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelToHtml.console", "ExcelToHtml.console\ExcelToHtml.console.csproj", "{CEA40B00-BF81-4005-8715-EA196476FDBA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
119 changes: 0 additions & 119 deletions ExcelToHtml/CellHelper.cs

This file was deleted.

Loading

0 comments on commit 767fdb9

Please sign in to comment.