spectre.console/docs/src/Pipelines/ColorsPipeline.cs
Khalid Abuhakmeh 672faa131f Update Docs Readme
Added some more context to the docs readme for
folks looking to contribute. Also added the license
so its clear what the license of the docs site is. As
a small tweak I removed a duplicate string value and
use the Constant.
2020-10-01 20:51:32 +02:00

34 lines
886 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Docs.Models;
using Statiq.Common;
using Statiq.Core;
namespace Docs.Pipelines
{
public class ColorsPipeline : Pipeline
{
public ColorsPipeline()
{
InputModules = new ModuleList
{
new ExecuteConfig(
Config.FromContext(ctx => {
return new ReadWeb(Constants.Colors.Url);
}))
};
ProcessModules = new ModuleList
{
new ExecuteConfig(
Config.FromDocument(async (doc, ctx) =>
{
var data = Color.Parse(await doc.GetContentStringAsync()).ToList();
return data.ToDocument(Constants.Colors.Root);
}))
};
}
}
}