From 49526499ad2861694fef639136d45f878df1ff1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20de=20Vandi=C3=A8re?= Date: Thu, 21 Nov 2019 13:41:40 +0100 Subject: [PATCH] v1.0.0 +semver: major --- README.md | 2 ++ docs/README.md | 15 ++++++++++++++- docs/_config.yml | 3 ++- .../MyClassLib.SubNamespace/GenericClass{T}.md | 2 +- docs/sample/MyClassLib.SubNamespace/SubClass.md | 2 +- docs/sample/README.md | 10 ---------- docs/sample/_config.yml | 5 +++++ docs/sample/index.md | 6 +++--- src/XMLDoc2Markdown/MarkdownGenerator.cs | 2 +- src/XMLDoc2Markdown/Program.cs | 12 ++++++------ 10 files changed, 35 insertions(+), 24 deletions(-) delete mode 100644 docs/sample/README.md create mode 100644 docs/sample/_config.yml diff --git a/README.md b/README.md index a884686..83b16d1 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,5 @@ Tool to generate markdown from C# XML documentation, based on [MarkdownGenerator ```shell > xmldoc2md -h ``` + +See complete documentation [here](https://charlesdevandiere.github.io/xmldoc2md/). diff --git a/docs/README.md b/docs/README.md index fc2c962..4191f99 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ Tool to generate markdown from C# XML documentation, based on [MarkdownGenerator](https://github.com/neuecc/MarkdownGenerator) project. -See generated sample documentation [here](sample). +See sample generated documentation [here](sample). ## How to use @@ -28,4 +28,17 @@ See generated sample documentation [here](sample). ```shell > xmldoc2md -h + +Usage: xmldoc2md [arguments] [options] + +Arguments: + src DLL source path + out Output directory + +Options: + -v|--version Show version information + -?|-h|--help Show help information + --namespace-match Regex pattern to select namespaces + --index-page-name Name of the index page (default: "index") + ``` diff --git a/docs/_config.yml b/docs/_config.yml index c419263..fb8cd1c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1,2 @@ -theme: jekyll-theme-cayman \ No newline at end of file +theme: jekyll-theme-cayman +show_downloads: true \ No newline at end of file diff --git a/docs/sample/MyClassLib.SubNamespace/GenericClass{T}.md b/docs/sample/MyClassLib.SubNamespace/GenericClass{T}.md index cb78d50..8e72c8c 100644 --- a/docs/sample/MyClassLib.SubNamespace/GenericClass{T}.md +++ b/docs/sample/MyClassLib.SubNamespace/GenericClass{T}.md @@ -16,4 +16,4 @@ public class GenericClass --- -[`< Back`](./) +[`< Back`](../) diff --git a/docs/sample/MyClassLib.SubNamespace/SubClass.md b/docs/sample/MyClassLib.SubNamespace/SubClass.md index f366e58..0dbb0d6 100644 --- a/docs/sample/MyClassLib.SubNamespace/SubClass.md +++ b/docs/sample/MyClassLib.SubNamespace/SubClass.md @@ -17,4 +17,4 @@ public class SubClass --- -[`< Back`](./) +[`< Back`](../) diff --git a/docs/sample/README.md b/docs/sample/README.md deleted file mode 100644 index 3c1f1fc..0000000 --- a/docs/sample/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# MyClassLib - -## `MyClassLib` - -- [`Class1`](MyClassLib/Class1) - -## `MyClassLib.SubNamespace` - -- [`GenericClass`](MyClassLib.SubNamespace/GenericClass{T}) -- [`SubClass`](MyClassLib.SubNamespace/SubClass) diff --git a/docs/sample/_config.yml b/docs/sample/_config.yml new file mode 100644 index 0000000..3b9acc4 --- /dev/null +++ b/docs/sample/_config.yml @@ -0,0 +1,5 @@ +theme: jekyll-theme-cayman +title: MyClassLib +description: +github.is_project_page: false +show_downloads: false \ No newline at end of file diff --git a/docs/sample/index.md b/docs/sample/index.md index 0f1cc4d..3c1f1fc 100644 --- a/docs/sample/index.md +++ b/docs/sample/index.md @@ -1,10 +1,10 @@ -# References +# MyClassLib -## MyClassLib +## `MyClassLib` - [`Class1`](MyClassLib/Class1) -## MyClassLib.SubNamespace +## `MyClassLib.SubNamespace` - [`GenericClass`](MyClassLib.SubNamespace/GenericClass{T}) - [`SubClass`](MyClassLib.SubNamespace/SubClass) diff --git a/src/XMLDoc2Markdown/MarkdownGenerator.cs b/src/XMLDoc2Markdown/MarkdownGenerator.cs index 2adb8f8..c58af5c 100644 --- a/src/XMLDoc2Markdown/MarkdownGenerator.cs +++ b/src/XMLDoc2Markdown/MarkdownGenerator.cs @@ -206,7 +206,7 @@ public override string ToString() mb.AppendLine("---"); mb.AppendLine(); - mb.Link(MarkdownBuilder.MarkdownCodeQuote("< Back"), "./"); + mb.Link(MarkdownBuilder.MarkdownCodeQuote("< Back"), "../"); mb.AppendLine(); return mb.ToString(); diff --git a/src/XMLDoc2Markdown/Program.cs b/src/XMLDoc2Markdown/Program.cs index 102ea18..f03d900 100644 --- a/src/XMLDoc2Markdown/Program.cs +++ b/src/XMLDoc2Markdown/Program.cs @@ -12,7 +12,7 @@ class Program static void Main(string[] args) { var app = new CommandLineApplication(); - app.Name = "MarkdownGenerator"; + app.Name = "xmldoc2md"; app.VersionOption("-v|--version", () => { @@ -33,9 +33,9 @@ static void Main(string[] args) "Regex pattern to select namespaces", CommandOptionType.SingleValue); - CommandOption homePageNameOption = app.Option( - "--home-page-name ", - "Name of the home page", + CommandOption indexPageNameOption = app.Option( + "--index-page-name ", + "Name of the index page (default: \"index\")", CommandOptionType.SingleValue); app.OnExecute(() => @@ -43,7 +43,7 @@ static void Main(string[] args) string src = srcArg.Value; string @out = outArg.Value; string namespaceMatch = namespaceMatchOption.Value(); - string homePageName = homePageNameOption.HasValue() ? homePageNameOption.Value() : "README"; + string indexPageName = indexPageNameOption.HasValue() ? indexPageNameOption.Value() : "index"; var xmlDocumentation = new XmlDocumentation(src, namespaceMatch); @@ -73,7 +73,7 @@ static void Main(string[] args) } } - File.WriteAllText(Path.Combine(@out, $"{homePageName}.md"), indexBuilder.ToString()); + File.WriteAllText(Path.Combine(@out, $"{indexPageName}.md"), indexBuilder.ToString()); return 0; });