Example #1
0
        public void SaveDocItem(Document doc)
        {
            var outputPath = Path.Combine(OutputPath, doc.Trail);
            if (!Directory.Exists(outputPath))
            {
                Directory.CreateDirectory(outputPath);
            }

                var contents = doc.Content;
                File.WriteAllText(Path.Combine(outputPath, doc.Slug + ".markdown"), contents);
        }
Example #2
0
        public void SaveDocItem(Document doc)
        {
            var outputPath = Path.Combine(OutputPath, doc.Trail);
            if (!Directory.Exists(outputPath))
            {
                Directory.CreateDirectory(outputPath);
            }

            var contents = string.Format(PageTemplate, doc.Title, doc.Content);
            File.WriteAllText(Path.Combine(outputPath, doc.Slug + ".html"), contents);
        }
Example #3
0
 /// <summary>
 /// Compile a document.
 /// </summary>
 /// <param name="versionUrl">
 /// The version url.
 /// </param>
 /// <param name="document">
 /// The document.
 /// </param>
 /// <param name="fullPath">
 /// The full path.
 /// </param>
 /// <returns>
 /// The <see cref="string"/>.
 /// </returns>
 private string CompileDocument(string versionUrl, Document document, string fullPath)
 {
     var strippedSlug = document.Slug.Replace(".markdown", string.Empty);
     string path = Path.Combine(fullPath, document.Slug);
     document.Content = DocumentationParser.Parse(this, null, path, document.Trail, versionUrl);
     document.Slug = strippedSlug;
     this.Output.SaveDocItem(document);
     return document.Content;
 }