lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [01/11] lucenenet git commit: Created JavaDocToMarkdownConverter utility.
Date Thu, 14 Sep 2017 05:48:22 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 0aac3702f -> 6a95ad434


Created JavaDocToMarkdownConverter utility.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/eab94373
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/eab94373
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/eab94373

Branch: refs/heads/master
Commit: eab943737b78dad4278795e27fe6a7a2d758fbb0
Parents: 0aac370
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu Sep 14 11:50:02 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Sep 14 11:50:02 2017 +0700

----------------------------------------------------------------------
 .../JavaDocToMarkdownConverter.sln              |  22 ++
 .../JavaDocToMarkdownConverter/App.config       |  22 ++
 .../JavaDocToMarkdownConverter/DocConverter.cs  | 366 +++++++++++++++++++
 .../JavaDocToMarkdownConverter.csproj           | 114 ++++++
 .../JavaDocToMarkdownConverter/Program.cs       |  39 ++
 .../Properties/AssemblyInfo.cs                  |  36 ++
 .../JavaDocToMarkdownConverter/packages.config  |  51 +++
 7 files changed, 650 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.sln
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.sln b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.sln
new file mode 100644
index 0000000..db3cd1a
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.15
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JavaDocToMarkdownConverter", "JavaDocToMarkdownConverter\JavaDocToMarkdownConverter.csproj",
"{874179E7-FDA4-4E5B-9F86-54917BB6F74F}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{874179E7-FDA4-4E5B-9F86-54917BB6F74F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{874179E7-FDA4-4E5B-9F86-54917BB6F74F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{874179E7-FDA4-4E5B-9F86-54917BB6F74F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{874179E7-FDA4-4E5B-9F86-54917BB6F74F}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/App.config
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/App.config
b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/App.config
new file mode 100644
index 0000000..5326edb
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/App.config
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"
culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/DocConverter.cs
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/DocConverter.cs
b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/DocConverter.cs
new file mode 100644
index 0000000..8d186e9
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/DocConverter.cs
@@ -0,0 +1,366 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace JavaDocToMarkdownConverter
+{
+    public class DocConverter
+    {
+        private static Regex LinkRegex = new Regex(@"{@link (?<cref>org\.apache\.lucene\.[^}
]*)\s?(?<text>[^}]*)}", RegexOptions.Compiled);
+        private static Regex RepoLinkRegex = new Regex(@"(?<=\()(?<cref>src-html/[^)]*)",
RegexOptions.Compiled);
+
+        private static Regex JavaCodeExtension = new Regex(@".java$", RegexOptions.Compiled);
+        private static Regex DocType = new Regex(@"<!doctype[^>]*>", RegexOptions.Compiled);
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="inputDirectory">The /lucene directory in the Java source code.</param>
+        /// <param name="rootOutputDirectory">The root directory of the Lucene.Net
repository.</param>
+        public void Convert(string inputDirectory, string rootOutputDirectory)
+        {
+            var dir = new DirectoryInfo(inputDirectory);
+            if (!dir.Exists)
+            {
+                Console.WriteLine("Directory Doesn't Exist: '" + dir.FullName + "'");
+                return;
+            }
+
+            foreach (var file in dir.EnumerateFiles("overview.html", SearchOption.AllDirectories))
+            {
+                ConvertDoc(file.FullName, rootOutputDirectory);
+            }
+            foreach (var file in dir.EnumerateFiles("package.html", SearchOption.AllDirectories))
+            {
+                ConvertDoc(file.FullName, rootOutputDirectory);
+            }
+        }
+
+        public void ConvertDoc(string inputDoc, string rootOutputDirectory)
+        {
+            var outputDir = GetOutputDirectory(inputDoc, rootOutputDirectory);
+            var outputFile = Path.Combine(outputDir, GetOuputFilename(inputDoc));
+
+            if (!Directory.Exists(outputDir))
+            {
+                Console.WriteLine("Output Directory Doesn't Exist: '" + outputDir + "'");
+                return;
+            }
+            if (!File.Exists(inputDoc))
+            {
+                Console.WriteLine("Input File Doesn't Exist: '" + inputDoc + "'");
+                return;
+            }
+
+            var converter = new Html2Markdown.Converter();
+            var markdown = converter.ConvertFile(inputDoc);
+
+            markdown = ReplaceCodeLinks(markdown);
+            markdown = ReplaceRepoLinks(markdown);
+
+            // Remove <doctype>
+            markdown = DocType.Replace(markdown, string.Empty);
+
+            File.WriteAllText(outputFile, markdown, Encoding.UTF8);
+        }
+
+        private string ReplaceCodeLinks(string markdown)
+        {
+            Match link = LinkRegex.Match(markdown);
+            if (link.Success)
+            {
+                do
+                {
+                    string cref = CorrectCRef(link.Groups["cref"].Value);
+                    string newLink;
+                    if (!string.IsNullOrWhiteSpace(link.Groups["text"].Value))
+                    {
+                        string linkText = link.Groups[2].Value;
+                        linkText = JavaCodeExtension.Replace(linkText, ".cs");
+                        //newLink = "<see cref=\"" + cref + "\">" + linkText + "</see>";
+                        newLink = "[" + linkText + "](xref:" + cref + ")";
+                    }
+                    else
+                    {
+                        //newLink = "<see cref=\"" + cref + "\"/>";
+                        newLink = "[](xref:" + cref + ")";
+                    }
+
+                    markdown = LinkRegex.Replace(markdown, newLink, 1);
+
+
+                } while ((link = LinkRegex.Match(markdown)).Success);
+            }
+
+            return markdown;
+        }
+
+        //https://github.com/apache/lucenenet/blob/Lucene.Net_4_8_0_beta00004/src/Lucene.Net.Analysis.Common/Analysis/Ar/ArabicAnalyzer.cs
+        private string ReplaceRepoLinks(string markdown)
+        {
+            Match link = RepoLinkRegex.Match(markdown);
+            if (link.Success)
+            {
+                do
+                {
+                    string cref = CorrectRepoCRef(link.Groups["cref"].Value);
+                    cref = "https://github.com/apache/lucenenet/blob/{tag}/src/" + cref;
+
+                    markdown = RepoLinkRegex.Replace(markdown, cref, 1);
+
+
+                } while ((link = RepoLinkRegex.Match(markdown)).Success);
+            }
+
+            return markdown;
+        }
+
+        private IDictionary<string, string> packageToProjectName = new Dictionary<string,
string>()
+        {
+            { "analysis.common" , "Lucene.Net.Analysis.Common"},
+            { "analysis.icu" , "Lucene.Net.Analysis.ICU"},
+            { "analysis.kuromoji" , "Lucene.Net.Analysis.Kuromoji"},
+            { "analysis.morfologik" , "Lucene.Net.Analysis.Morfologik"},
+            { "analysis.phonetic" , "Lucene.Net.Analysis.Phonetic"},
+            { "analysis.smartcn" , "Lucene.Net.Analysis.SmartCn"},
+            { "analysis.stempel" , "Lucene.Net.Analysis.Stempel"},
+            { "analysis.uima" , "Lucene.Net.Analysis.UIMA"},
+            { "benchmark" , "Lucene.Net.Benchmark"},
+            { "classification" , "Lucene.Net.Classification"},
+            { "codecs" , "Lucene.Net.Codecs"},
+            { "core" , "Lucene.Net"},
+            { "demo" , "Lucene.Net.Demo"},
+            { "expressions" , "Lucene.Net.Expressions"},
+            { "facet" , "Lucene.Net.Facet"},
+            { "grouping" , "Lucene.Net.Grouping"},
+            { "highlighter" , "Lucene.Net.Highlighter"},
+            { "join" , "Lucene.Net.Join"},
+            { "memory" , "Lucene.Net.Memory"},
+            { "misc" , "Lucene.Net.Misc"},
+            { "queries" , "Lucene.Net.Queries"},
+            { "queryparser" , "Lucene.Net.QueryParser"},
+            { "replicator" , "Lucene.Net.Replicator"},
+            { "sandbox" , "Lucene.Net.Sandbox"},
+            { "spatial" , "Lucene.Net.Spatial"},
+            { "suggest" , "Lucene.Net.Suggest"},
+            { "test-framework" , "Lucene.Net.TestFramework"},
+        };
+
+        private string CorrectRepoCRef(string cref)
+        {
+            string temp = cref;
+            if (temp.StartsWith("src-html"))
+            {
+                temp = temp.Replace("src-html/", "");
+            }
+
+            temp = temp.Replace("/", ".");
+            temp = temp.Replace(".html", ".cs");
+
+            var segments = temp.Split('.');
+
+            if (temp.StartsWith("analysis"))
+            {
+                string project;
+                if (packageToProjectName.TryGetValue(segments[3] + "." + segments[4], out
project))
+                    temp = project + "/" + string.Join("/", segments.Skip(5).ToArray());
+            }
+            else
+            {
+                string project;
+                if (packageToProjectName.TryGetValue(segments[3], out project))
+                    temp = project + "/" + string.Join("/", segments.Skip(4).ToArray());
+            }
+
+            temp = CorrectCRefCase(temp);
+            foreach (var item in namespaceCorrections)
+            {
+                if (!item.Key.StartsWith("Lucene.Net"))
+                    temp = temp.Replace(item.Key, item.Value);
+            }
+
+            temp = Regex.Replace(temp, "/[Cc]s", ".cs");
+
+            return temp;
+        }
+
+        private string CorrectCRef(string cref)
+        {
+            var caseCorrected = CorrectCRefCase(cref);
+            var temp = caseCorrected.Replace("org.Apache.Lucene.", "Lucene.Net.");
+            foreach (var item in namespaceCorrections)
+            {
+                temp = temp.Replace(item.Key, item.Value);
+            }
+
+            return temp;
+        }
+
+        private IDictionary<string, string> namespaceCorrections = new Dictionary<string,
string>()
+        {
+            { "Lucene.Net.Document", "Lucene.Net.Documents" },
+            { "Lucene.Net.Benchmark", "Lucene.Net.Benchmarks" },
+            { "Lucene.Net.Queryparser", "Lucene.Net.QueryParsers" },
+            { ".Tokenattributes", ".TokenAttributes" },
+            { ".Charfilter", ".CharFilter" },
+            { ".Commongrams", ".CommonGrams" },
+            { ".Ngram", ".NGram" },
+            { ".Hhmm", ".HHMM" },
+            { ".Blockterms", ".BlockTerms" },
+            { ".Diskdv", ".DiskDV" },
+            { ".Intblock", ".IntBlock" },
+            { ".Simpletext", ".SimpleText" },
+            { ".Postingshighlight", ".PostingsHighlight" },
+            { ".Vectorhighlight", ".VectorHighlight" },
+            { ".Complexphrase", ".ComplexPhrase" },
+            { ".Valuesource", ".ValueSources" },
+        };
+
+        private string CorrectCRefCase(string cref)
+        {
+            var sb = new StringBuilder(cref);
+            for (int i = 0; i < sb.Length - 1; i++)
+            {
+                if (sb[i] == '.')
+                    sb[i + 1] = char.ToUpper(sb[i + 1]);
+            }
+            return sb.ToString();
+        }
+
+
+        private string GetOuputFilename(string inputDoc)
+        {
+            return Path.GetFileNameWithoutExtension(inputDoc) + ".md";
+        }
+
+        private string GetOutputDirectory(string inputDoc, string rootOutputDirectory)
+        {
+            string project = Path.Combine(rootOutputDirectory, @"src\Lucene.Net");
+            var file = new FileInfo(inputDoc);
+            var dir = file.Directory.FullName;
+            var segments = dir.Split(Path.DirectorySeparatorChar);
+            int i;
+            bool inLucene = false;
+            string lastSegment = string.Empty;
+            for (i = 0; i < segments.Length; i++)
+            {
+                var segment = segments[i];
+                if (segment.Equals("lucene"))
+                {
+                    inLucene = true;
+                    continue;
+                }
+                if (!inLucene)
+                    continue;
+                if (segment.Equals("core"))
+                    break;
+                project += "." + segment;
+                lastSegment = segment;
+
+                if (segment.Equals("analysis"))
+                    continue;
+                break;
+            }
+
+            //if (project.EndsWith("analysis.icu", StringComparison.OrdinalIgnoreCase))
+            //{
+            //    project = project.Replace("Lucene.Net.analysis.icu", @"dotnet\Lucene.Net.ICU");
+            //}
+
+            if (project.EndsWith("test-framework", StringComparison.OrdinalIgnoreCase))
+            {
+                project = project.Replace("test-framework", "TestFramework");
+            }
+
+            // Now we have the project directory and segment that it equates to.
+            // We need to walk up the tree and ignore the java-ish deep directories.
+            var ignore = new List<string>() { "src", "java", "org", "apache", "lucene"
};
+            string path = project;
+
+            for (int j = i + 1; j < segments.Length; j++)
+            {
+                var segment = segments[j];
+                if (ignore.Contains(segment))
+                {
+                    continue;
+                }
+
+                // Special Cases
+                switch (lastSegment.ToLower())
+                {
+                    case "stempel":
+                        if (segment.Equals("analysis")) continue;
+                        if (segment.Equals("egothor")) segment = "Egothor.Stemmer";
+                        if (segment.Equals("stemmer")) continue;
+                        break;
+                    case "kuromoji":
+                        if (segment.Equals("analysis") || segment.Equals("ja")) continue;
+                        break;
+                    case "phonetic":
+                        if (segment.Equals("analysis") || segment.Equals("phonetic")) continue;
+                        break;
+                    case "smartcn":
+                        if (segment.Equals("analysis") || segment.Equals("cn") || segment.Equals("smart"))
continue;
+                        break;
+                    case "benchmark":
+                        if (segment.Equals("benchmark")) continue;
+                        break;
+                    case "classification":
+                        if (segment.Equals("classification")) continue;
+                        break;
+                    case "codecs":
+                        if (segment.Equals("codecs")) continue;
+                        break;
+                    case "demo":
+                        if (segment.Equals("demo")) continue;
+                        break;
+                    case "expressions":
+                        if (segment.Equals("expressions")) continue;
+                        break;
+                    case "facet":
+                        if (segment.Equals("facet")) continue;
+                        break;
+                    case "grouping":
+                        if (segment.Equals("search") || segment.Equals("grouping")) continue;
+                        break;
+                    case "highlighter":
+                        if (segment.Equals("search")) continue;
+                        break;
+                    case "join":
+                        if (segment.Equals("search") || segment.Equals("join")) continue;
+                        break;
+                    case "memory":
+                        if (segment.Equals("index") || segment.Equals("memory")) continue;
+                        break;
+                    case "queries":
+                        if (segment.Equals("queries")) continue;
+                        if (segment.Equals("valuesource")) segment = "ValueSources";
+                        break;
+                    case "queryparser":
+                        if (segment.Equals("queryparser")) continue;
+                        break;
+                    case "replicator":
+                        if (segment.Equals("replicator")) continue;
+                        break;
+                    case "sandbox":
+                        if (segment.Equals("sandbox")) continue;
+                        break;
+                    case "spatial":
+                        if (segment.Equals("spatial")) continue;
+                        break;
+                    case "suggest":
+                        if (segment.Equals("search")) continue;
+                        break;
+                }
+
+                path = Path.Combine(path, segment);
+            }
+
+            return path;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj
b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj
new file mode 100644
index 0000000..81f1f4c
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{874179E7-FDA4-4E5B-9F86-54917BB6F74F}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>JavaDocToMarkdownConverter</RootNamespace>
+    <AssemblyName>JavaDocToMarkdownConverter</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Html2Markdown, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\Html2Markdown.3.0.0.223\lib\netstandard1.4\Html2Markdown.dll</HintPath>
+    </Reference>
+    <Reference Include="HtmlAgilityPack.NetCore, Version=1.5.0.1, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\HtmlAgilityPack.NetCore.1.5.0.1\lib\net45\HtmlAgilityPack.NetCore.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
+    </Reference>
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Core" />
+    <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
+    </Reference>
+    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
+    </Reference>
+    <Reference Include="System.IO.Compression.FileSystem" />
+    <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
+    </Reference>
+    <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
+    </Reference>
+    <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Numerics" />
+    <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DocConverter.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Program.cs
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Program.cs
b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Program.cs
new file mode 100644
index 0000000..cbec5a4
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Program.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JavaDocToMarkdownConverter
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            if (args == null || args.Length < 2)
+            {
+                Usage();
+            }
+
+            Console.WriteLine(string.Format("Converting '{0}' to '{1}'...", args[0], args[1]));
+
+            //new DocConverter().ConvertDoc(@"F:\Projects\_Test\lucene-solr-4.8.0\lucene\demo\src\java\overview.html",
@"F:\Projects\lucenenet\");
+            new DocConverter().Convert(args[0], args[1]);
+
+            Console.WriteLine("Conversion complete!");
+
+#if DEBUG
+            Console.ReadKey();
+#endif
+        }
+
+        private static void Usage()
+        {
+            Console.WriteLine("Usage: JavaDocToMarkdownConverter[.exe] <LUCENE DIRECTORY>
<LUCENENET DIRECTORY>");
+            Console.WriteLine();
+            Console.WriteLine(" Arguments:");
+            Console.WriteLine(@"   LUCENE DIRECTORY: The root directory of the lucene project
to convert (excluding SOLR). Example: F:\lucene-solr-4.8.0\lucene\");
+            Console.WriteLine(@"   LUCENENET DIRECTORY: The root directory of Lucene.Net.
Example: F:\Projects\lucenenet\");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Properties/AssemblyInfo.cs
b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..c715516
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("JavaDocToMarkdownConverter")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("JavaDocToMarkdownConverter")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("874179e7-fda4-4e5b-9f86-54917bb6f74f")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eab94373/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/packages.config
----------------------------------------------------------------------
diff --git a/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/packages.config
b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/packages.config
new file mode 100644
index 0000000..a81433d
--- /dev/null
+++ b/src/dotnet/tools/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter/packages.config
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Html2Markdown" version="3.0.0.223" targetFramework="net461" />
+  <package id="HtmlAgilityPack.NetCore" version="1.5.0.1" targetFramework="net461" />
+  <package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />
+  <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" />
+  <package id="NETStandard.Library" version="1.6.1" targetFramework="net461" />
+  <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
+  <package id="System.Collections" version="4.3.0" targetFramework="net461" />
+  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Console" version="4.3.0" targetFramework="net461" />
+  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
+  <package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
+  <package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" />
+  <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
+  <package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.IO" version="4.3.0" targetFramework="net461" />
+  <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
+  <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
+  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Linq" version="4.3.0" targetFramework="net461" />
+  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
+  <package id="System.Net.Http" version="4.3.0" targetFramework="net461" />
+  <package id="System.Net.Primitives" version="4.3.0" targetFramework="net461" />
+  <package id="System.Net.Sockets" version="4.3.0" targetFramework="net461" />
+  <package id="System.ObjectModel" version="4.3.0" targetFramework="net461" />
+  <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
+  <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Runtime" version="4.3.0" targetFramework="net461" />
+  <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" />
+  <package id="System.Runtime.Handles" version="4.3.0" targetFramework="net461" />
+  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
+  <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
+  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net461"
/>
+  <package id="System.Threading" version="4.3.0" targetFramework="net461" />
+  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
+  <package id="System.Threading.Timer" version="4.3.0" targetFramework="net461" />
+  <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" />
+  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" />
+</packages>
\ No newline at end of file


Mime
View raw message