Esempio n. 1
0
        public virtual DirectoryReadmeSettings CreateDirectoryReadmeSettings(SnippetGeneratorResult result)
        {
            var settings = new DirectoryReadmeSettings()
            {
                Environment       = this,
                IsDevelopment     = result.IsDevelopment,
                Header            = result.DirectoryName,
                AddLinkToTitle    = true,
                AddQuickReference = !result.IsDevelopment && !result.HasTag(KnownTags.NoQuickReference),
                Language          = result.Language,
                DirectoryPath     = result.Path,
                GroupShortcuts    = true
            };

            if (!settings.IsDevelopment)
            {
                //TODO: ?
                string filePath = $@"..\..\..\..\..\text\{result.DirectoryName}.md";

                if (File.Exists(filePath))
                {
                    settings.QuickReferenceText = File.ReadAllText(filePath, Encoding.UTF8);
                }

                settings.Shortcuts.AddRange(Shortcuts);
            }

            return(settings);
        }
Esempio n. 2
0
 protected virtual void SaveSnippets(List <Snippet> snippets, SnippetGeneratorResult result)
 {
     IOUtility.SaveSnippets(snippets, result.Path);
 }