remove extra project

This commit is contained in:
Tommy Parnell
2015-10-07 22:40:52 -04:00
parent c155f9541e
commit 60f8d800b0
5 changed files with 0 additions and 242 deletions

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>e68542ee-79d4-47a1-bc66-bfb4b78856a1</ProjectGuid>
<RootNamespace>DotNetMashup</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@@ -1,169 +0,0 @@
//This code came from https://raw.githubusercontent.com/robvolk/Helpers.Net/master/Src/Helpers.Net/StringHtmlExtensions.cs
namespace DotNetMashup.Extensions
{
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
public static class StringHtmlExtensions
{
/// <summary>
/// Truncates a string containing HTML to a number of text characters, keeping whole words.
/// The result contains HTML and any tags left open are closed.
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static string TruncateHtml(this string html, int maxCharacters, string trailingText)
{
if(string.IsNullOrEmpty(html))
return html;
// find the spot to truncate
// count the text characters and ignore tags
var textCount = 0;
var charCount = 0;
var ignore = false;
foreach(char c in html)
{
charCount++;
if(c == '<')
ignore = true;
else if(!ignore)
textCount++;
if(c == '>')
ignore = false;
// stop once we hit the limit
if(textCount >= maxCharacters)
break;
}
// Truncate the html and keep whole words only
var trunc = new StringBuilder(html.TruncateWords(charCount));
// keep track of open tags and close any tags left open
var tags = new Stack<string>();
var matches = Regex.Matches(trunc.ToString(),
@"<((?<tag>[^\s/>]+)|/(?<closeTag>[^\s>]+)).*?(?<selfClose>/)?\s*>",
RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Multiline);
foreach(Match match in matches)
{
if(match.Success)
{
var tag = match.Groups["tag"].Value;
var closeTag = match.Groups["closeTag"].Value;
// push to stack if open tag and ignore it if it is self-closing, i.e. <br />
if(!string.IsNullOrEmpty(tag) && string.IsNullOrEmpty(match.Groups["selfClose"].Value))
tags.Push(tag);
// pop from stack if close tag
else if(!string.IsNullOrEmpty(closeTag))
{
// pop the tag to close it.. find the matching opening tag
// ignore any unclosed tags
while(tags.Pop() != closeTag && tags.Count > 0)
{ }
}
}
}
if(html.Length > charCount)
// add the trailing text
trunc.Append(trailingText);
// pop the rest off the stack to close remainder of tags
while(tags.Count > 0)
{
trunc.Append("</");
trunc.Append(tags.Pop());
trunc.Append('>');
}
return trunc.ToString();
}
/// <summary>
/// Truncates a string containing HTML to a number of text characters, keeping whole words.
/// The result contains HTML and any tags left open are closed.
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static string TruncateHtml(this string html, int maxCharacters)
{
return html.TruncateHtml(maxCharacters, null);
}
/// <summary>
/// Strips all HTML tags from a string
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static string StripHtml(this string html)
{
if(string.IsNullOrEmpty(html))
return html;
return Regex.Replace(html, @"<(.|\n)*?>", string.Empty);
}
/// <summary>
/// Truncates text to a number of characters
/// </summary>
/// <param name="text"></param>
/// <param name="maxCharacters"></param>
/// <param name="trailingText"></param>
/// <returns></returns>
public static string Truncate(this string text, int maxCharacters)
{
return text.Truncate(maxCharacters, null);
}
/// <summary>
/// Truncates text to a number of characters and adds trailing text, i.e. elipses, to the end
/// </summary>
/// <param name="text"></param>
/// <param name="maxCharacters"></param>
/// <param name="trailingText"></param>
/// <returns></returns>
public static string Truncate(this string text, int maxCharacters, string trailingText)
{
if(string.IsNullOrEmpty(text) || maxCharacters <= 0 || text.Length <= maxCharacters)
return text;
else
return text.Substring(0, maxCharacters) + trailingText;
}
/// <summary>
/// Truncates text and discars any partial words left at the end
/// </summary>
/// <param name="text"></param>
/// <param name="maxCharacters"></param>
/// <param name="trailingText"></param>
/// <returns></returns>
public static string TruncateWords(this string text, int maxCharacters)
{
return text.TruncateWords(maxCharacters, null);
}
/// <summary>
/// Truncates text and discars any partial words left at the end
/// </summary>
/// <param name="text"></param>
/// <param name="maxCharacters"></param>
/// <param name="trailingText"></param>
/// <returns></returns>
public static string TruncateWords(this string text, int maxCharacters, string trailingText)
{
if(string.IsNullOrEmpty(text) || maxCharacters <= 0 || text.Length <= maxCharacters)
return text;
// trunctate the text, then remove the partial word at the end
return Regex.Replace(text.Truncate(maxCharacters),
@"\s+[^\s]+$", string.Empty, RegexOptions.IgnoreCase | RegexOptions.Compiled) + trailingText;
}
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace DotNetMashup.Model
{
public class BlogPost
{
public string Title { get; set; }
public string Content { get; set; }
public DateTime PublishedDate { get; set; }
public string Summary { get; set; }
public string Localink { get; set; }
public string OriginalLink { get; set; }
public string Author { get; set; }
public string AuthorEmail { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace DotNetMashup
{
//stolen idea from: https://github.com/NancyFx/Nancy.Blog/blob/master/src/Nancy.Blog/Model/MetaData.cs
public class MetaData
{
public string FeedUrl { get; set; }
public string Author { get; set; }
public string AuthorEmail { get; set; }
public string GravatarUrl { get; set; }
public string Id { get; set; }
}
}

View File

@@ -1,22 +0,0 @@
{
"version": "1.0.0-*",
"description": "DotNetMashup Class Library",
"authors": [ "Tommy Parnell" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23225",
"System.Collections": "4.0.11-beta-23225",
"System.Linq": "4.0.1-beta-23225",
"System.Runtime": "4.0.21-beta-23225",
"System.Threading": "4.0.11-beta-23225",
"System.Text.RegularExpressions": "4.0.11-beta-23225"
}
}
}
}