Exemplo n.º 1
0
        /// <summary>
        /// Create documentation output specification.
        /// </summary>
        /// <param name="rootPath">
        /// The root path.
        /// </param>
        /// <param name="outputPath">
        /// The output path.
        /// </param>
        /// <param name="outputType">
        /// The output type.
        /// </param>
        /// <param name="debugMode"></param>
        /// <returns>
        /// The <see cref="IDocsOutput"/>.
        /// </returns>
        private static IDocsOutput CreateDocumentationOutputSpecification(string rootPath, string outputPath, OutputType outputType, VersionInfo version, bool debugMode)
        {
            //var rootUrl = @"http://ravendb.net/docs/" + version.VersionAlias + "/";
            var rootUrl = @"http://localhost/RavenDoc/version_3/html-compiled/";

            if (outputType == OutputType.Markdown)
            {
                return(new MarkdownDocsOutput
                {
                    ContentType = OutputType.Markdown,
                    OutputPath = outputPath,
                    RootUrl = rootUrl,
                    CompilationMode = version.CompilationMode
                });
            }

            if (outputType == OutputType.Html)
            {
                IDocsOutput output = new HtmlDocsOutput
                {
                    ContentType  = OutputType.Html,
                    OutputPath   = outputPath,
                    PageTemplate =
                        File.ReadAllText(
                            Path.Combine(rootPath, version.VersionPath, @"html-template.html")),
                    RootUrl         = rootUrl,
                    ImagesPath      = debugMode ? "images/" : null,
                    CompilationMode = version.CompilationMode,
                    DebugMode       = debugMode
                };
                return(output);
            }

            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create documentation output specification.
        /// </summary>
        /// <param name="rootPath">
        /// The root path.
        /// </param>
        /// <param name="outputPath">
        /// The output path.
        /// </param>
        /// <param name="outputType">
        /// The output type.
        /// </param>
        /// <returns>
        /// The <see cref="IDocsOutput"/>.
        /// </returns>
        private static IDocsOutput CreateDocumentationOutputSpecification(
            string rootPath, string outputPath, OutputType outputType)
        {
            if (outputType == OutputType.Markdown)
            {
                return(new MarkdownDocsOutput
                {
                    ContentType = OutputType.Markdown,
                    OutputPath = outputPath,
                    RootUrl = "http://ravendb.net/docs/",
                });
            }

            if (outputType == OutputType.Html)
            {
                IDocsOutput output = new HtmlDocsOutput
                {
                    ContentType  = OutputType.Html,
                    OutputPath   = outputPath,
                    PageTemplate =
                        File.ReadAllText(
                            Path.Combine(rootPath, @"Tools\html-template.html")),
                    RootUrl = "http://ravendb.net/docs/",
                };
                return(output);
            }

            return(null);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            const string basePath = @"z:\Projects\RavenDB\RavenDB-docs\";

            IDocsOutput output = new HtmlDocsOutput
            {
                OutputPath   = Path.Combine(basePath, "html-compiled"),
                PageTemplate = File.ReadAllText(Path.Combine(basePath, @"Tools\html-template.html")),
                RootUrl      = "http://ravendb.net/docs/",
            };

            try
            {
                Compiler.CompileFolder(output, basePath, "Home");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }