Skip to content

markdown links broken under Github #12

@ciarandavies7191

Description

@ciarandavies7191

The tool output produces files that have ".md" files that work well under Github but generated links are broken because of file extensions.

Example, produced output:

[`ClassDocs`](Namespace.Class#myanchor)

whereas it should produce:

[`ClassDocs`](Namespace.Class.md#myanchor)

Fix can be easily fixed by updating the following loop in Program.cs:43

            foreach (var g in types.GroupBy(x => x.Namespace).OrderBy(x => x.Key))
            {
                if (!Directory.Exists(dest)) Directory.CreateDirectory(dest);

                homeBuilder.HeaderWithLink(2, g.Key + ".md", g.Key + ".md");
                homeBuilder.AppendLine();

                var sb = new StringBuilder();
                foreach (var item in g.OrderBy(x => x.Name))
                {
                    homeBuilder.ListLink(MarkdownBuilder.MarkdownCodeQuote(item.BeautifyName), g.Key + ".md" + "#" + item.BeautifyName.Replace("<", "").Replace(">", "").Replace(",", "").Replace(" ", "-").ToLower());

                    sb.Append(item.ToString());
                }

                File.WriteAllText(Path.Combine(dest, g.Key + ".md"), sb.ToString());
                homeBuilder.AppendLine();
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions