diff --git a/.gitignore b/.gitignore index 8a6b9e46..1bbf2832 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,7 @@ $RECYCLE.BIN/ # Mac desktop service store files .DS_Store /packages +.idea/ +.vs/ +.vscode/ +nuget.exe \ No newline at end of file diff --git a/.nuget/ExCSS.nupkg b/.nuget/ExCSS.nupkg deleted file mode 100644 index 3e92eed9..00000000 Binary files a/.nuget/ExCSS.nupkg and /dev/null differ diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe deleted file mode 100644 index 34ad49b4..00000000 Binary files a/.nuget/NuGet.exe and /dev/null differ diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets index 25380fea..092337b6 100644 --- a/.nuget/NuGet.targets +++ b/.nuget/NuGet.targets @@ -32,13 +32,33 @@ $(BuildDependsOn); BuildPackage; + + + true + https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - + - + + + + + + + + - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ExCSS.sln b/ExCSS.sln index 1e203a0a..4cc13e1a 100644 --- a/ExCSS.sln +++ b/ExCSS.sln @@ -2,6 +2,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ED10223D-313C-4760-B378-2B3C7DCE3B94}" +ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.targets = .nuget\NuGet.targets +EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExCSS.Tests", "ExCSS.Tests\ExCSS.Tests.csproj", "{5FBCD1EE-C5B6-4734-9FE0-3BA2CD14E85A}" EndProject diff --git a/ExCSS/ExCSS.csproj b/ExCSS/ExCSS.csproj index f8e64555..e470c92d 100644 --- a/ExCSS/ExCSS.csproj +++ b/ExCSS/ExCSS.csproj @@ -34,6 +34,7 @@ ..\..\ExCSS\ true + true true @@ -190,7 +191,7 @@ $(ExCSSAssemblyVersion.SubString(0, $(ExCSSAssemblyVersion.LastIndexOf('.')))) - - + + \ No newline at end of file diff --git a/NuSpec/ExCSS.nuspec b/NuSpec/SIL.ExCSS.nuspec similarity index 86% rename from NuSpec/ExCSS.nuspec rename to NuSpec/SIL.ExCSS.nuspec index cebe91c2..9bbfc942 100644 --- a/NuSpec/ExCSS.nuspec +++ b/NuSpec/SIL.ExCSS.nuspec @@ -1,13 +1,13 @@  - ExCSS + SIL.ExCSS $version$ ExCSS Stylesheet Parser Tyler Brinks Tyler Brinks - https://github.com/TylerBrinks/ExCSS - https://github.com/TylerBrinks/ExCSS/raw/master/ExCSS.png + https://github.com/jasonleenaylor/ExCSS + MIT false ExCSS reads and parses stylesheets using CSS 3 and CSS 2 selector specifications, and is easily queryable from LINQ using its simple and readable object model. Parse CSS 3 and CSS 2 stylesheets into an easily usable and LINQ-friendly object model. It's #BADA55! diff --git a/readme.md b/readme.md index 305b5366..c0d82458 100644 --- a/readme.md +++ b/readme.md @@ -1,39 +1,40 @@ -#ExCSS StyleSheet Parser for .NET - It's \#BADA55!# +# ExCSS StyleSheet Parser for .NET - It's _BADA55!_ ExCSS (Pronoundec Excess) is a CSS 2.1 and CSS 3 parser for .NET. The goal of ExCSS is to make it easy to read and parse stylesheets into a friendly object model with full LINQ support. -#Version 2.0# -Version 2 has been rewritten from the ground up! Unlike v1 which used Coco/r to generate a lexer and parser, version 2 is +## Version 2.0 + +Version 2 has been rewritten from the ground up! Unlike v1 which used Coco/r to generate a lexer and parser, version 2 is written entirely by hand. This gives the new parser an incredibly fine grained level of detail when parsing some of the more unusual edge cases for CSS 3 selectors. -#NuGet# +## NuGet + Install the pagckage from the NuGet Package Manager or via command line - Install-Package ExCSS + Install-Package SIL.ExCSS + +## Lexing and Parsing - How it all Works -#Lexing and Parsing - How it all Works# -ExCSS uses a Lexer and a Parser based on a CSS3-specific grammar. The Lexer and Parser read CSS text and parse each -character as individual tokens run against a complex set of rules that define what CSS segment each token represents. +ExCSS uses a Lexer and a Parser based on a CSS3-specific grammar. The Lexer and Parser read CSS text and parse each +character as individual tokens run against a complex set of rules that define what CSS segment each token represents. Once parsed, the input styles sheet is turned into a standard .NET object model. That means it's fully queryable using Linq to objects. -##A basic example:## +### A basic example - var parser = Parser(); - var stylesheet = parser.Parse(".someClass{color: red; background-image: url('/images/logo.png')"); - - var imageUrl = stylesheet.Rulesets + var parser = Parser(); + var stylesheet = parser.Parse(".someClass{color: red; background-image: url('/images/logo.png')"); + + var imageUrl = stylesheet.Rulesets .SelectMany(r => r.Declarations) .FirstOrDefault(d => d.Name.Equals("background-image", StringComparison.InvariantCultureIgnoreCase)) .Term .ToString(); // Finds the url('/images/logo.png') image url - -##CSS 3 Compatible## -The project has a growing suite of tests. Currently the tests account for and pass all CSS Level 3 selector definitions -found in [the W3 CSS 3 Release Candidate documentation](http://www.w3.org/TR/2001/CR-css3-selectors-20011113/) - +## CSS 3 Compatible +The project has a growing suite of tests. Currently the tests account for and pass all CSS Level 3 selector definitions +found in [the W3 CSS 3 Release Candidate documentation](http://www.w3.org/TR/2001/CR-css3-selectors-20011113/)