Beispiel #1
0
        private void Render <T>(ControlDocumentationCreator <T> creator) where T : FrameworkElement, new()
        {
            var reader = new Mock <IAssemblyDocumentationReader>();
            var writer = new TypeDocumentationMarkdownWriter(reader.Object, typeof(T));

            creator.RenderTo(_filesystem, RootDirectory, writer);
        }
Beispiel #2
0
        public void RenderTo(IFilesystem filesystem, string basePath)
        {
            var path = Path.GetFullPath(basePath);

            Log.InfoFormat("Rendering documentation to '{0}'...", path);

            foreach (var typeCreator in _types)
            {
                var documentationWriter = new TypeDocumentationMarkdownWriter(_assemblyDocumentationReader, typeCreator.Type);

                var directory = Path.Combine(path, typeCreator.Type.FullName);
                var fileName  = Path.Combine(directory, "README.md");


                typeCreator.RenderTo(filesystem, directory, documentationWriter);

                var stream       = new MemoryStream();
                var streamWriter = new StreamWriter(stream);
                documentationWriter.WriteTo(streamWriter);
                streamWriter.Flush();

                stream.Position = 0;
                WriteDocumentationTo(filesystem, fileName, stream);
            }

            Log.InfoFormat("Rendering documentation finished!");
        }
Beispiel #3
0
        private string Render <T>(ITypeDocumentationCreator <T> creator)
        {
            var writer = new TypeDocumentationMarkdownWriter(_documentationReader, typeof(T));
            var folder = typeof(T).Name;

            creator.RenderTo(_filesystem, folder, writer);
            var stringWriter = new StringWriter();

            writer.WriteTo(stringWriter);
            return(stringWriter.ToString());
        }