Beispiel #1
0
        internal static void WriteWorkspace(DocWorkspace docWorkspace)
        {
            // Build index
            StringBuilder sb = new StringBuilder();

            sb.AppendLine($"# {docWorkspace.Name} Workspace");
            sb.AppendLine("## Modules");

            foreach (var module in docWorkspace.Modules.OrderBy(m => m.Name))
            {
                sb.AppendLine($"* {CreateLink(module)}");
            }

            // Write out the index
            WriteToDoc(IndexFileNameWithoutExtension, sb);

            // Handle all modules under this namespace
            foreach (var module in docWorkspace.Modules)
            {
                WriteModule(module);
            }

            var fileNameArray = Directory.GetFiles(s_rootFolder)
                                .Where(f => !f.Equals(OrderFileName, StringComparison.OrdinalIgnoreCase))
                                .Select(Path.GetFileNameWithoutExtension)
                                .OrderBy(s => !s.Equals(IndexFileNameWithoutExtension, StringComparison.OrdinalIgnoreCase))
                                .ThenBy(s => s)
                                .ToList();

            if (fileNameArray.Count > 0)
            {
                File.WriteAllLines(Path.Combine(s_rootFolder, OrderFileName), fileNameArray);
            }
        }
Beispiel #2
0
 private static string CreateLink(DocWorkspace workspace)
 {
     return(CreateLink(workspace.Name, CreateFileName(workspace), null));
 }
Beispiel #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="docWorkspace">Workspace the module belongs to.</param>
 /// <param name="name">Name of the module.</param>
 /// <param name="version">Version of the module.</param>
 public Module(DocWorkspace docWorkspace, string name, string version)
 {
     DocWorkspace = docWorkspace;
     Name         = name;
     Version      = version;
 }
Beispiel #4
0
 private static string CreateFileName(DocWorkspace workspace)
 {
     return("index");
 }