Skip to content

Commit

Permalink
v1.0.0 +semver: major
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdevandiere authored Nov 21, 2019
1 parent b31eb9c commit 9beecb7
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 24 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
15 changes: 14 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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> Regex pattern to select namespaces
--index-page-name <regex> Name of the index page (default: "index")

```
3 changes: 2 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
show_downloads: true
2 changes: 1 addition & 1 deletion docs/sample/MyClassLib.SubNamespace/GenericClass{T}.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public class GenericClass<T>

---

[`< Back`](./)
[`< Back`](../)
2 changes: 1 addition & 1 deletion docs/sample/MyClassLib.SubNamespace/SubClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public class SubClass

---

[`< Back`](./)
[`< Back`](../)
10 changes: 0 additions & 10 deletions docs/sample/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions docs/sample/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
theme: jekyll-theme-cayman
title: MyClassLib
description:
github.is_project_page: false
show_downloads: false
6 changes: 3 additions & 3 deletions docs/sample/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# References
# MyClassLib

## MyClassLib
## `MyClassLib`

- [`Class1`](MyClassLib/Class1)

## MyClassLib.SubNamespace
## `MyClassLib.SubNamespace`

- [`GenericClass<T>`](MyClassLib.SubNamespace/GenericClass{T})
- [`SubClass`](MyClassLib.SubNamespace/SubClass)
2 changes: 1 addition & 1 deletion src/XMLDoc2Markdown/MarkdownGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions src/XMLDoc2Markdown/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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", () =>
{
Expand All @@ -33,17 +33,17 @@ static void Main(string[] args)
"Regex pattern to select namespaces",
CommandOptionType.SingleValue);

CommandOption homePageNameOption = app.Option(
"--home-page-name <regex>",
"Name of the home page",
CommandOption indexPageNameOption = app.Option(
"--index-page-name <regex>",
"Name of the index page (default: \"index\")",
CommandOptionType.SingleValue);

app.OnExecute(() =>
{
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);

Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit 9beecb7

Please sign in to comment.