private static string ReadFile(string path)
{
var content = File.ReadAllText(path);
// todo; <para> tag
// dirty filthy regexes
var summaryRegex = new Regex(@"<summary>(.*)<\/summary>");
var returnsRegex = new Regex(@"<returns>(.*)<\/returns>");
var crefRegex = new Regex(@"<(c|paramref|see|seealso|typeparamref) cref="".:([^""]*)""\/>");
var summaryMatches = summaryRegex.Matches(content).Cast<Match>().Concat(returnsRegex.Matches(content).Cast<Match>());
foreach (Match summaryMatch in summaryMatches)
{
var originalSummary = summaryMatch.Captures[0].Value;
var tagMatches = crefRegex.Matches(originalSummary);
var newSummary = originalSummary;
foreach (Match tagMatch in tagMatches)
{
var replacement = tagMatch.Groups[2].Captures
.Cast<Group>()
.Single().Value
.Split('`').First()
.Split('.').Last();
newSummary = newSummary.Replace(tagMatch.Value, replacement);
}
content = content.Replace(originalSummary, newSummary);
}
return content;
}