Skip to content

Commit 43dcb92

Browse files
authored
Add docs folder for hosting pages on github. (#221)
1 parent 4767cff commit 43dcb92

File tree

527 files changed

+8568
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

527 files changed

+8568
-38
lines changed

System.Linq.Dynamic.Core.sln

+24
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsUniversalTestApp1439
6767
{D3804228-91F4-4502-9595-39584E510002} = {D3804228-91F4-4502-9595-39584E510002}
6868
EndProjectSection
6969
EndProject
70+
Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "System.Linq.Dynamic.Core", "doc\System.Linq.Dynamic.Core.shfbproj", "{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}"
71+
ProjectSection(ProjectDependencies) = postProject
72+
{D3804228-91F4-4502-9595-39584E510000} = {D3804228-91F4-4502-9595-39584E510000}
73+
{D3804228-91F4-4502-9595-39584E510001} = {D3804228-91F4-4502-9595-39584E510001}
74+
{D3804228-91F4-4502-9595-39584E510002} = {D3804228-91F4-4502-9595-39584E510002}
75+
EndProjectSection
76+
EndProject
7077
Global
7178
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7279
Debug|Any CPU = Debug|Any CPU
@@ -369,6 +376,22 @@ Global
369376
{926D446C-8358-465A-AFAC-2F9078C22262}.Release|x86.ActiveCfg = Release|x86
370377
{926D446C-8358-465A-AFAC-2F9078C22262}.Release|x86.Build.0 = Release|x86
371378
{926D446C-8358-465A-AFAC-2F9078C22262}.Release|x86.Deploy.0 = Release|x86
379+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
380+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
381+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|ARM.ActiveCfg = Debug|Any CPU
382+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|ARM.Build.0 = Debug|Any CPU
383+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|x64.ActiveCfg = Debug|Any CPU
384+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|x64.Build.0 = Debug|Any CPU
385+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|x86.ActiveCfg = Debug|Any CPU
386+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Debug|x86.Build.0 = Debug|Any CPU
387+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
388+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|Any CPU.Build.0 = Release|Any CPU
389+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|ARM.ActiveCfg = Release|Any CPU
390+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|ARM.Build.0 = Release|Any CPU
391+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|x64.ActiveCfg = Release|Any CPU
392+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|x64.Build.0 = Release|Any CPU
393+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|x86.ActiveCfg = Release|Any CPU
394+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF}.Release|x86.Build.0 = Release|Any CPU
372395
EndGlobalSection
373396
GlobalSection(SolutionProperties) = preSolution
374397
HideSolutionNode = FALSE
@@ -392,6 +415,7 @@ Global
392415
{E4286D1D-A98C-4516-9E47-CBF9739448DA} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
393416
{F1880F07-238F-4A3A-9E58-141350665E1F} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
394417
{926D446C-8358-465A-AFAC-2F9078C22262} = {ECA5702B-5D32-4888-A34E-9461FC533F23}
418+
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF} = {1384C18E-DCF3-4A5B-9560-2BF5DD8C51CE}
395419
EndGlobalSection
396420
GlobalSection(ExtensibilityGlobals) = postSolution
397421
SolutionGuid = {94C56722-194E-4B8B-BC23-B3F754E89A20}

doc/System.Linq.Dynamic.Core.shfbproj

+47-11
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
88
<SchemaVersion>2.0</SchemaVersion>
99
<ProjectGuid>{591f9224-a8d6-49cf-8af8-f9b383c1f9ff}</ProjectGuid>
10-
<SHFBSchemaVersion>2015.6.5.0</SHFBSchemaVersion>
10+
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
1111
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
1212
<AssemblyName>Documentation</AssemblyName>
1313
<RootNamespace>Documentation</RootNamespace>
1414
<Name>Documentation</Name>
1515
<!-- SHFB properties -->
16-
<FrameworkVersion>.NET Framework 4.6.1</FrameworkVersion>
17-
<OutputPath>System.Linq.Dynamic.Core.SandCastle\wwwroot\</OutputPath>
16+
<FrameworkVersion>Cross-platform (.NET Core/.NET Standard)</FrameworkVersion>
17+
<OutputPath>..\docs\</OutputPath>
1818
<HtmlHelpName>Documentation</HtmlHelpName>
1919
<Language>en-US</Language>
2020
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
@@ -25,12 +25,12 @@
2525
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
2626
<CleanIntermediates>True</CleanIntermediates>
2727
<DocumentationSources>
28-
<DocumentationSource sourceFile="..\src\System.Linq.Dynamic.Core\bin\Release\net45\System.Linq.Dynamic.Core.dll" />
29-
<DocumentationSource sourceFile="..\src\System.Linq.Dynamic.Core\bin\Release\net45\System.Linq.Dynamic.Core.xml" />
30-
<DocumentationSource sourceFile="..\src\EntityFramework.DynamicLinq\bin\Release\net45\EntityFramework.DynamicLinq.dll" />
31-
<DocumentationSource sourceFile="..\src\EntityFramework.DynamicLinq\bin\Release\net45\EntityFramework.DynamicLinq.xml" />
32-
<DocumentationSource sourceFile="..\src\Microsoft.EntityFrameworkCore.DynamicLinq\bin\Release\net451\Microsoft.EntityFrameworkCore.DynamicLinq.dll" />
33-
<DocumentationSource sourceFile="..\src\Microsoft.EntityFrameworkCore.DynamicLinq\bin\Release\net451\Microsoft.EntityFrameworkCore.DynamicLinq.xml" />
28+
<DocumentationSource sourceFile="..\src\System.Linq.Dynamic.Core\bin\Release\netstandard2.0\System.Linq.Dynamic.Core.dll" />
29+
<DocumentationSource sourceFile="..\src\System.Linq.Dynamic.Core\bin\Release\netstandard2.0\System.Linq.Dynamic.Core.xml" />
30+
<DocumentationSource sourceFile="..\src\EntityFramework.DynamicLinq\bin\Release\net46\EntityFramework.DynamicLinq.dll" />
31+
<DocumentationSource sourceFile="..\src\EntityFramework.DynamicLinq\bin\Release\net46\EntityFramework.DynamicLinq.xml" />
32+
<DocumentationSource sourceFile="..\src\Microsoft.EntityFrameworkCore.DynamicLinq\bin\Release\netstandard2.0\Microsoft.EntityFrameworkCore.DynamicLinq.dll" />
33+
<DocumentationSource sourceFile="..\src\Microsoft.EntityFrameworkCore.DynamicLinq\bin\Release\netstandard2.0\Microsoft.EntityFrameworkCore.DynamicLinq.xml" />
3434
</DocumentationSources>
3535
<WebsiteSdkLinkType>Msdn</WebsiteSdkLinkType>
3636
<HtmlSdkLinkType>Msdn</HtmlSdkLinkType>
@@ -54,8 +54,44 @@
5454
<NamingMethod>Guid</NamingMethod>
5555
<HelpTitle>System.Linq.Dynamic.Core, EntityFramework.DynamicLinq and Microsoft.EntityFrameworkCore.DynamicLinq</HelpTitle>
5656
<ContentPlacement>BelowNamespaces</ContentPlacement>
57-
<WorkingPath>System.Linq.Dynamic.Core.SandCastle.tmp\</WorkingPath>
58-
<VisibleItems>InheritedMembers, InheritedFrameworkMembers, Protected, ProtectedInternalAsProtected, PublicCompilerGenerated</VisibleItems>
57+
<WorkingPath>
58+
</WorkingPath>
59+
<VisibleItems>InheritedMembers, InheritedFrameworkMembers, Protected, ProtectedInternalAsProtected, PublicCompilerGenerated, EditorBrowsableNever, NonBrowsable</VisibleItems>
60+
<WarnOnMissingSourceContext>False</WarnOnMissingSourceContext>
61+
<ComponentConfigurations>
62+
<ComponentConfig id="Code Block Component" enabled="True" xmlns="">
63+
<component id="Code Block Component">
64+
<basePath value="{@HtmlEncProjectFolder}" />
65+
<outputPaths>{@HelpFormatOutputPaths}</outputPaths>
66+
<allowMissingSource value="false" />
67+
<removeRegionMarkers value="false" />
68+
<colorizer syntaxFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xml" styleFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xsl" stylesheet="{@SHFBFolder}PresentationStyles\Colorizer\highlight.css" scriptFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.js" disabled="{@DisableCodeBlockComponent}" language="cs" tabSize="0" numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
69+
</component>
70+
</ComponentConfig>
71+
<ComponentConfig id="Syntax Component" enabled="True" xmlns=""><component id="Syntax Component">
72+
<syntax input="/document/reference" output="/document/syntax" renderReferenceLinks="false" />
73+
<generators>
74+
{@SyntaxFilters}
75+
</generators>
76+
<containerElement name="codeSnippetGroup" addNoExampleTabs="true" includeOnSingleSnippets="false" groupingEnabled="{@CodeSnippetGrouping}" />
77+
<configurations>
78+
<generator id="C#" />
79+
<generator id="Visual Basic">
80+
<includeLineContinuation value="false" />
81+
</generator>
82+
<generator id="Visual Basic Usage">
83+
<includeLineContinuation value="false" />
84+
</generator>
85+
<generator id="Managed C++" />
86+
<generator id="F#" />
87+
<generator id="J#" />
88+
<generator id="JScript" />
89+
<generator id="JavaScript" />
90+
<generator id="XAML Usage" />
91+
<generator id="ASP.NET" />
92+
<generator id="X#" />
93+
</configurations>
94+
</component></ComponentConfig></ComponentConfigurations>
5995
</PropertyGroup>
6096
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
6197
the build. The others are optional common platform types that may appear. -->

docs/SearchHelp.aspx

+233
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
<%@ Page Language="C#" EnableViewState="False" %>
2+
3+
<script runat="server">
4+
//===============================================================================================================
5+
// System : Sandcastle Help File Builder
6+
// File : SearchHelp.aspx
7+
// Author : Eric Woodruff ([email protected])
8+
// Updated : 05/15/2014
9+
// Note : Copyright 2007-2015, Eric Woodruff, All rights reserved
10+
// Compiler: Microsoft C#
11+
//
12+
// This file contains the code used to search for keywords within the help topics using the full-text index
13+
// files created by the help file builder.
14+
//
15+
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
16+
// distributed with the code. It can also be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
17+
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
18+
// and source files.
19+
//
20+
// Date Who Comments
21+
// ==============================================================================================================
22+
// 06/24/2007 EFW Created the code
23+
// 02/17/2012 EFW Switched to JSON serialization to support websites that use something other than ASP.NET
24+
// such as PHP.
25+
// 05/15/2014 EFW Updated for use with the lightweight website presentation styles
26+
//===============================================================================================================
27+
28+
/// <summary>
29+
/// This class is used to track the results and their rankings
30+
/// </summary>
31+
private class Ranking
32+
{
33+
public string Filename, PageTitle;
34+
public int Rank;
35+
36+
public Ranking(string file, string title, int rank)
37+
{
38+
Filename = file;
39+
PageTitle = title;
40+
Rank = rank;
41+
}
42+
}
43+
44+
/// <summary>
45+
/// Render the search results
46+
/// </summary>
47+
/// <param name="writer">The writer to which the results are written</param>
48+
protected override void Render(HtmlTextWriter writer)
49+
{
50+
JavaScriptSerializer jss = new JavaScriptSerializer();
51+
string searchText, ftiFile;
52+
char letter;
53+
bool sortByTitle = false;
54+
55+
jss.MaxJsonLength = Int32.MaxValue;
56+
57+
// The keywords for which to search should be passed in the query string
58+
searchText = this.Request.QueryString["Keywords"];
59+
60+
if(String.IsNullOrEmpty(searchText))
61+
{
62+
writer.Write("<strong>Nothing found</strong>");
63+
return;
64+
}
65+
66+
// An optional SortByTitle option can also be specified
67+
if(this.Request.QueryString["SortByTitle"] != null)
68+
sortByTitle = Convert.ToBoolean(this.Request.QueryString["SortByTitle"]);
69+
70+
List<string> keywords = this.ParseKeywords(searchText);
71+
List<char> letters = new List<char>();
72+
List<string> fileList;
73+
Dictionary<string, List<long>> ftiWords, wordDictionary = new Dictionary<string,List<long>>();
74+
75+
// Load the file index
76+
using(StreamReader sr = new StreamReader(Server.MapPath("fti/FTI_Files.json")))
77+
{
78+
fileList = jss.Deserialize<List<string>>(sr.ReadToEnd());
79+
}
80+
81+
// Load the required word index files
82+
foreach(string word in keywords)
83+
{
84+
letter = word[0];
85+
86+
if(!letters.Contains(letter))
87+
{
88+
letters.Add(letter);
89+
ftiFile = Server.MapPath(String.Format(CultureInfo.InvariantCulture, "fti/FTI_{0}.json", (int)letter));
90+
91+
if(File.Exists(ftiFile))
92+
{
93+
using(StreamReader sr = new StreamReader(ftiFile))
94+
{
95+
ftiWords = jss.Deserialize<Dictionary<string, List<long>>>(sr.ReadToEnd());
96+
}
97+
98+
foreach(string ftiWord in ftiWords.Keys)
99+
wordDictionary.Add(ftiWord, ftiWords[ftiWord]);
100+
}
101+
}
102+
}
103+
104+
// Perform the search and return the results as a block of HTML
105+
writer.Write(this.Search(keywords, fileList, wordDictionary, sortByTitle));
106+
}
107+
108+
/// <summary>
109+
/// Split the search text up into keywords
110+
/// </summary>
111+
/// <param name="keywords">The keywords to parse</param>
112+
/// <returns>A list containing the words for which to search</returns>
113+
private List<string> ParseKeywords(string keywords)
114+
{
115+
List<string> keywordList = new List<string>();
116+
string checkWord;
117+
string[] words = Regex.Split(keywords, @"\W+");
118+
119+
foreach(string word in words)
120+
{
121+
checkWord = word.ToLower(CultureInfo.InvariantCulture);
122+
123+
if(checkWord.Length > 2 && !Char.IsDigit(checkWord[0]) && !keywordList.Contains(checkWord))
124+
keywordList.Add(checkWord);
125+
}
126+
127+
return keywordList;
128+
}
129+
130+
/// <summary>
131+
/// Search for the specified keywords and return the results as a block of HTML
132+
/// </summary>
133+
/// <param name="keywords">The keywords for which to search</param>
134+
/// <param name="fileInfo">The file list</param>
135+
/// <param name="wordDictionary">The dictionary used to find the words</param>
136+
/// <param name="sortByTitle">True to sort by title, false to sort by ranking</param>
137+
/// <returns>A block of HTML representing the search results</returns>
138+
private string Search(List<string> keywords, List<string> fileInfo,
139+
Dictionary<string, List<long>> wordDictionary, bool sortByTitle)
140+
{
141+
StringBuilder sb = new StringBuilder(10240);
142+
Dictionary<string, List<long>> matches = new Dictionary<string, List<long>>();
143+
List<long> occurrences;
144+
List<int> matchingFileIndices = new List<int>(), occurrenceIndices = new List<int>();
145+
List<Ranking> rankings = new List<Ranking>();
146+
147+
string filename, title;
148+
string[] fileIndex;
149+
bool isFirst = true;
150+
int idx, wordCount, matchCount;
151+
152+
foreach(string word in keywords)
153+
{
154+
if(!wordDictionary.TryGetValue(word, out occurrences))
155+
return "<strong>Nothing found</strong>";
156+
157+
matches.Add(word, occurrences);
158+
occurrenceIndices.Clear();
159+
160+
// Get a list of the file indices for this match
161+
foreach(long entry in occurrences)
162+
occurrenceIndices.Add((int)(entry >> 16));
163+
164+
if(isFirst)
165+
{
166+
isFirst = false;
167+
matchingFileIndices.AddRange(occurrenceIndices);
168+
}
169+
else
170+
{
171+
// After the first match, remove files that do not appear for
172+
// all found keywords.
173+
for(idx = 0; idx < matchingFileIndices.Count; idx++)
174+
if(!occurrenceIndices.Contains(matchingFileIndices[idx]))
175+
{
176+
matchingFileIndices.RemoveAt(idx);
177+
idx--;
178+
}
179+
}
180+
}
181+
182+
if(matchingFileIndices.Count == 0)
183+
return "<strong>Nothing found</strong>";
184+
185+
// Rank the files based on the number of times the words occurs
186+
foreach(int index in matchingFileIndices)
187+
{
188+
// Split out the title, filename, and word count
189+
fileIndex = fileInfo[index].Split('\x0');
190+
191+
title = fileIndex[0];
192+
filename = fileIndex[1];
193+
wordCount = Convert.ToInt32(fileIndex[2]);
194+
matchCount = 0;
195+
196+
foreach(string word in keywords)
197+
{
198+
occurrences = matches[word];
199+
200+
foreach(long entry in occurrences)
201+
if((int)(entry >> 16) == index)
202+
matchCount += (int)(entry & 0xFFFF);
203+
}
204+
205+
rankings.Add(new Ranking(filename, title, matchCount * 1000 / wordCount));
206+
207+
if(rankings.Count > 99)
208+
break;
209+
}
210+
211+
// Sort by rank in descending order or by page title in ascending order
212+
rankings.Sort(delegate (Ranking x, Ranking y)
213+
{
214+
if(!sortByTitle)
215+
return y.Rank - x.Rank;
216+
217+
return x.PageTitle.CompareTo(y.PageTitle);
218+
});
219+
220+
// Format the file list and return the results
221+
sb.Append("<ol>");
222+
223+
foreach(Ranking r in rankings)
224+
sb.AppendFormat("<li><a href=\"{0}\" target=\"_blank\">{1}</a></li>", r.Filename, r.PageTitle);
225+
226+
sb.Append("</ol>");
227+
228+
if(rankings.Count < matchingFileIndices.Count)
229+
sb.AppendFormat("<p>Omitted {0} more results</p>", matchingFileIndices.Count - rankings.Count);
230+
231+
return sb.ToString();
232+
}
233+
</script>

0 commit comments

Comments
 (0)