Esempio n. 1
0
 /// <summary>
 /// Sets the metadata key <c>WriteFileName</c> to an optimized version of the return value of the delegate.
 /// Also sets the metadata key <c>WritePath</c> to <c>Path.Combine(RelativeFileDir, WriteFileName)</c>.
 /// </summary>
 /// <param name="fileName">A delegate that should return a <c>string</c> with the filename to optimize.</param>
 public FileName(DocumentConfig fileName)
 {
     if (fileName == null)
     {
         throw new ArgumentNullException(nameof(fileName));
     }
     _fileName = fileName;
 }
Esempio n. 2
0
 /// <summary>
 /// Defines the delegate that will be invoked against each input document to get the case comparison value.
 /// </summary>
 /// <param name="value">A delegate that returns an object to compare cases against.</param>
 public Switch(DocumentConfig value)
 {
     if (value == null)
     {
         throw new ArgumentNullException(nameof(value));
     }
     _value = value;
 }
Esempio n. 3
0
 /// <summary>
 /// Limits the documents passed to the child modules to those that satisfy the 
 /// supplied predicate. All original input documents are output without 
 /// modification regardless of whether they satisfy the predicate.
 /// </summary>
 /// <param name="predicate">A delegate that should return a <c>bool</c>.</param>
 public ConcatBranch Where(DocumentConfig predicate)
 {
     Func<IDocument, IExecutionContext, bool> currentPredicate = _predicate;
     _predicate = currentPredicate == null
         ? (Func<IDocument, IExecutionContext, bool>)(predicate.Invoke<bool>)
         : ((x, c) => currentPredicate(x, c) && predicate.Invoke<bool>(x, c));
     return this;
 }
Esempio n. 4
0
 public OrderBy(DocumentConfig key)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     _key = key;
 }
Esempio n. 5
0
 protected ReadWorkspace(DocumentConfig path)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     _path = new ConfigHelper<string>(path);
 }
Esempio n. 6
0
 /// <summary>
 /// Uses a function to determine a text template which is processed and added as metadata for each document. 
 /// This allows you to specify different metadata for each document depending on the input.
 /// </summary>
 /// <param name="key">The metadata key for the generated text.</param>
 /// <param name="template">A delegate that returns the template to use.</param>
 public GenerateMeta(string key, DocumentConfig template) : base(template)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     _key = key;
 }
Esempio n. 7
0
 protected ReadWorkspace(DocumentConfig path)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     _pathDelegate = path;
 }
Esempio n. 8
0
 // This will get documents based on each input document - the result will be the aggregate of all returned documents for each input document
 // The delegate should return a IEnumerable<IDocument>
 public Documents(DocumentConfig documents)
 {
     if (documents == null)
     {
         throw new ArgumentNullException(nameof(documents));
     }
     _documentDocuments = documents;
 }
Esempio n. 9
0
 /// <summary>
 /// Specifies a delegate that should be invoked once for each input document.
 /// This will return the input documents.
 /// </summary>
 /// <param name="execute">A delegate to invoke that should return a <see cref="IEnumerable{IDocument}"/>.</param>
 public Execute(Action<IDocument, IExecutionContext> execute)
 {
     _executeDocument = (doc, ctx) =>
     {
         execute(doc, ctx);
         return null;
     };
 }
Esempio n. 10
0
 /// <summary>
 /// Uses a function to determine an object to be added as metadata for each document. 
 /// This allows you to specify different metadata for each document depending on the input.
 /// </summary>
 /// <param name="key">The metadata key to set.</param>
 /// <param name="metadata">A delegate that returns the object to add as metadata.</param>
 public Meta(string key, DocumentConfig metadata)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     _key = key;
     _metadata = new ConfigHelper<object>(metadata);
 }
Esempio n. 11
0
 /// <summary>
 /// Creates a sitemap using the specified delegate which should return either a <c>string</c> that
 /// contains the location for each input document or a <c>SitemapItem</c> instance with the location
 /// and other information.
 /// </summary>
 /// <param name="sitemapItemOrLocation">A delegate that either returns a <c>SitemapItem</c> instance or a <c>string</c> 
 /// with the desired item location. If the delegate returns <c>null</c>, the input document is not added to the sitemap.</param>
 /// <param name="locationFormatter">A location formatter that will be applied to the location of each input after
 /// getting the value of the specified metadata key.</param>
 public Sitemap(DocumentConfig sitemapItemOrLocation, Func<string, string> locationFormatter = null)
 {
     if (sitemapItemOrLocation == null)
     {
         throw new ArgumentNullException(nameof(sitemapItemOrLocation));
     }
     _sitemapItemOrLocation = sitemapItemOrLocation;
     _locationFormatter = locationFormatter;
 }
Esempio n. 12
0
 public OrderBy ThenBy(DocumentConfig key)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     _thenByList.Add(new ThenByEntry(key));
     return this;
 }
Esempio n. 13
0
 public Meta(string key, DocumentConfig metadata)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     _key = key;
     _metadata = metadata ?? ((x, y) => null);
 }
Esempio n. 14
0
        /// <summary>
        /// Reads all files that match the specified globbing patterns and/or absolute paths. This allows you to 
        /// specify different patterns and/or paths depending on the input.
        /// </summary>
        /// <param name="patterns">A delegate that returns one or more globbing patterns and/or absolute paths.</param>
        public ReadFiles(DocumentConfig patterns)
        {
            if (patterns == null)
            {
                throw new ArgumentNullException(nameof(patterns));
            }

            _patternsDelegate = patterns;
        }
Esempio n. 15
0
        /// <summary>
        /// Reads all files that match the specified path. This allows you to specify different search paths depending on the input.
        /// </summary>
        /// <param name="path">A delegate that returns a <c>string</c> with the search path.</param>
        public ReadFiles(DocumentConfig path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            _path = path;
        }
Esempio n. 16
0
        /// <summary>
        /// Copies all files that match the specified path. This allows you to specify different search paths depending on the input document.
        /// </summary>
        /// <param name="sourcePath">A delegate that returns a <c>string</c> with the desired search path.</param>
        public CopyFiles(DocumentConfig sourcePath)
        {
            if (sourcePath == null)
            {
                throw new ArgumentNullException(nameof(sourcePath));
            }

            _sourcePath = sourcePath;
        }
Esempio n. 17
0
        /// <summary>
        /// Copies all files that match the specified search pattern.
        /// </summary>
        /// <param name="searchPattern">The search pattern to use.</param>
        public CopyFiles(string searchPattern)
        {
            if (searchPattern == null)
            {
                throw new ArgumentNullException(nameof(searchPattern));
            }

            _sourcePath = (x, y) => searchPattern;
        }
Esempio n. 18
0
 public GroupBy(DocumentConfig key, params IModule[] modules)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     _key = key;
     _modules = modules;
 }
Esempio n. 19
0
 /// <summary>
 /// Searches for sidecar files at the same path as the input document SourceFilePath with the specified additional extension.
 /// If a sidecar file is found, it's content is passed to the specified child modules for processing.
 /// </summary>
 /// <param name="extension">The extension to search.</param>
 /// <param name="modules">The modules to execute against the sidecar file.</param>
 public Sidecar(string extension, params IModule[] modules)
 {
     if (string.IsNullOrEmpty(extension))
     {
         throw new ArgumentException("Value cannot be null or empty.", nameof(extension));
     }
     
     _sidecarPath = (d, c) => d.FilePath(Keys.SourceFilePath)?.AppendExtension(extension);
     _modules = modules;
 }
Esempio n. 20
0
        /// <summary>
        /// Uses a delegate to describe where to find the sidecar file for each input document.
        /// If a sidecar file is found, it's content is passed to the specified child modules for processing.
        /// </summary>
        /// <param name="sidecarPath">A delegate that returns a <see cref="FilePath"/> with the desired sidecar path.</param>
        /// <param name="modules">The modules to execute against the sidecar file.</param>
        public Sidecar(DocumentConfig sidecarPath, params IModule[] modules)
        {
            if (sidecarPath == null)
            {
                throw new ArgumentNullException(nameof(sidecarPath));
            }

            _sidecarPath = sidecarPath;
            _modules = modules;
        }
Esempio n. 21
0
        /// <summary>
        /// Uses a delegate to describe where to write the content of each document. 
        /// The output of the function should be either a full path to the disk 
        /// location (including file name) or a path relative to the output folder.
        /// </summary>
        /// <param name="path">A delegate that returns a <c>string</c> with the desired path.</param>
        public WriteFiles(DocumentConfig path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            _path = path;
            _warnOnWriteMetadata = true;
        }
Esempio n. 22
0
        /// <summary>
        /// Partitions the result of the specified modules into groups with matching keys 
        /// based on the value at the specified metadata key.
        /// If a document to group does not contain the specified metadata key, it is not included in any output groups.
        /// The input documents to GroupBy are used as 
        /// the initial input documents to the specified modules.
        /// </summary>
        /// <param name="keyMetadataKey">The key metadata key.</param>
        /// <param name="modules">Modules to execute on the input documents prior to grouping.</param>
        public GroupBy(string keyMetadataKey, params IModule[] modules)
        {
            if (keyMetadataKey == null)
            {
                throw new ArgumentNullException(nameof(keyMetadataKey));
            }

            _key = (doc, ctx) => doc.Get(keyMetadataKey);
            _modules = modules;
            _predicate = (doc, ctx) => doc.ContainsKey(keyMetadataKey);
        }
Esempio n. 23
0
 /// <summary>
 /// Sets the metadata key <c>WriteFileName</c> to an optimized version of the specified input metadata key.
 /// Also sets the metadata key <c>WritePath</c> to <c>Path.Combine(RelativeFileDir, WriteFileName)</c>.
 /// </summary>
 /// <param name="inputKey">The metadata key to use for the input filename.</param>
 public FileName(string inputKey)
 {
     if (inputKey == null)
     {
         throw new ArgumentNullException(nameof(inputKey));
     }
     if (string.IsNullOrWhiteSpace(inputKey))
     {
         throw new ArgumentException(nameof(inputKey));
     }
     _fileName = (d, c) => d.String(inputKey);
 }
Esempio n. 24
0
        public WriteFiles(string extension)
        {
            if (extension == null)
            {
                throw new ArgumentNullException(nameof(extension));
            }

            _path = (x, y) =>
            {
                string fileRelative = x.String(MetadataKeys.RelativeFilePath);
                if (!string.IsNullOrWhiteSpace(fileRelative))
                {
                    return Path.ChangeExtension(fileRelative, extension);
                }
                return null;
            };
        }
Esempio n. 25
0
 /// <summary>
 /// Specifies a model to use for each page.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <returns>The current module instance.</returns>
 public Razor WithModel(object model)
 {
     _model = (doc, ctx) => model;
     return(this);
 }
Esempio n. 26
0
 public Prepend(DocumentConfig content)
     : base(content)
 {
 }
Esempio n. 27
0
 /// <summary>
 /// Transforms input documents using a specified XSLT file from the file system.
 /// </summary>
 /// <param name="xsltPath">The path of the XSLT file to use.</param>
 public Xslt(string xsltPath)
 {
     _xsltPath = (a, b) => xsltPath;
 }
Esempio n. 28
0
 /// <summary>
 /// Specifies a model to use for each page based on the current input
 /// document and context.
 /// </summary>
 /// <param name="model">A delegate that returns the model.</param>
 /// <returns>The current module instance.</returns>
 public Razor WithModel(DocumentConfig model)
 {
     _model = model;
     return(this);
 }
Esempio n. 29
0
 /// <summary>
 /// Sets the item identifier. The default value is the absolute link to the input document.
 /// </summary>
 /// <param name="itemId">A delegate that should return a <c>Uri</c> with
 /// the item identifier.</param>
 public GenerateFeeds WithItemId(DocumentConfig itemId)
 {
     _itemId = itemId;
     return(this);
 }
Esempio n. 30
0
 /// <summary>
 /// Sets the item published time. The default value is the value for the "Published" key
 /// in the input document.
 /// </summary>
 /// <param name="itemPublished">A delegate that should return a <c>DateTime</c> with
 /// the item published time.</param>
 public GenerateFeeds WithItemPublished(DocumentConfig itemPublished)
 {
     _itemPublished = itemPublished;
     return(this);
 }
 /// <summary>
 /// Uses a delegate to describe where to write the content of each document.
 /// The output of the function should be either a full path to the disk
 /// location (including file name) or a path relative to the output folder.
 /// </summary>
 /// <param name="path">A delegate that returns a <c>string</c> with the desired path.</param>
 public UnwrittenFiles(DocumentConfig path)
     : base(path)
 {
 }
Esempio n. 32
0
 /// <summary>
 /// Specifies an alternate ViewStart file to use for all Razor pages processed by this module.
 /// </summary>
 /// <param name="path">The path to the alternate ViewStart file.</param>
 /// <returns>The current module instance.</returns>
 public Razor WithViewStart(FilePath path)
 {
     _viewStartPath = (doc, ctx) => path;
     return(this);
 }
Esempio n. 33
0
 /// <summary>
 /// Specifies an alternate ViewStart file to use for all Razor pages processed by this module. This
 /// lets you specify a different ViewStart file for each document. For example, you could return a
 /// ViewStart based on document location or document metadata. Returning <c>null</c> from the
 /// function reverts back to the default ViewStart search behavior for that document.
 /// </summary>
 /// <param name="path">A delegate that should return the ViewStart path as a <c>FilePath</c>,
 /// or <c>null</c> for the default ViewStart search behavior.</param>
 /// <returns>The current module instance.</returns>
 public Razor WithViewStart(DocumentConfig path)
 {
     _viewStartPath = path;
     return(this);
 }
Esempio n. 34
0
 public MethodConfig(IMethodImpl methodImpl, MethodDef methodDef, MethodType type, DocumentConfig documentConfig, IRegion region = null) :
     this(methodImpl, methodDef, type, documentConfig, region, false)
 {
 }
Esempio n. 35
0
 public MetaFileEntry(DocumentConfig metadataFileName, bool inherited, bool replace)
 {
     MetadataFileName = metadataFileName;
     Inherited        = inherited;
     Replace          = replace;
 }
Esempio n. 36
0
 public static T Invoke <T>(this DocumentConfig config, IDocument document, IExecutionContext context)
 {
     return(Invoke <T>(config, document, context, null));
 }
Esempio n. 37
0
 /// <summary>
 /// Reads the project file at the specified path. This allows you to specify a different project file depending on the input.
 /// </summary>
 /// <param name="path">A delegate that returns a <c>FilePath</c> with the project file path.</param>
 public ReadProject(DocumentConfig path) : base(path)
 {
 }
Esempio n. 38
0
 /// <summary>
 /// Uses the string value of the returned object as the new content for each document. This
 /// allows you to specify different content for each document depending on the input document.
 /// </summary>
 /// <param name="content">A delegate that gets the new content to use.</param>
 public Content(DocumentConfig content)
     : base(content)
 {
 }
Esempio n. 39
0
 /// <summary>
 /// Sets the item thread count. By default, no thread count is specified.
 /// </summary>
 /// <param name="itemThreadCount">A delegate that should return an <c>int</c> with
 /// the item thread count.</param>
 public GenerateFeeds WithItemThreadCount(DocumentConfig itemThreadCount)
 {
     _itemThreadCount = itemThreadCount;
     return(this);
 }
Esempio n. 40
0
 /// <summary>
 /// Specifies a layout file to use for all Razor pages processed by this module.
 /// </summary>
 /// <param name="path">The path to the layout file.</param>
 /// <returns>The current module instance.</returns>
 public Razor WithLayout(FilePath path)
 {
     _layoutPath = (doc, ctx) => path;
     return(this);
 }
Esempio n. 41
0
 /// <summary>
 /// Sets the item thread link. By default, no thread link is specified.
 /// </summary>
 /// <param name="itemThreadLink">A delegate that should return a <c>Uri</c> with
 /// the item thread link.</param>
 public GenerateFeeds WithItemThreadLink(DocumentConfig itemThreadLink)
 {
     _itemThreadLink = itemThreadLink;
     return(this);
 }
Esempio n. 42
0
 public UnwrittenFiles(DocumentConfig path)
     : base(path)
 {
 }
Esempio n. 43
0
 /// <summary>
 /// Sets the item author. The default value is the value for the "Author" key
 /// in the input document.
 /// </summary>
 /// <param name="itemAuthor">A delegate that should return a <c>string</c> with
 /// the item author.</param>
 public GenerateFeeds WithItemAuthor(DocumentConfig itemAuthor)
 {
     _itemAuthor = itemAuthor;
     return(this);
 }
Esempio n. 44
0
 /// <summary>
 /// The object stored in metadata at the specified key is converted to JSON, which then either
 /// replaces the content of each input document or is stored in the specified metadata key.
 /// </summary>
 /// <param name="sourceKey">The metadata key of the object to convert to JSON.</param>
 /// <param name="destinationKey">The metadata key where the JSON should be stored (or <c>null</c>
 /// to replace the content of each input document).</param>
 public GenerateJson(string sourceKey, string destinationKey = null)
 {
     _destinationKey = destinationKey;
     _data = (doc, ctx) => doc.Get(sourceKey);
 }
Esempio n. 45
0
 /// <summary>
 /// Sets the item description. The default value is the value for the "Description" key
 /// in the input document.
 /// </summary>
 /// <param name="itemDescription">A delegate that should return a <c>string</c> with
 /// the item description.</param>
 public GenerateFeeds WithItemDescription(DocumentConfig itemDescription)
 {
     _itemDescription = itemDescription;
     return(this);
 }
Esempio n. 46
0
 /// <summary>
 /// The object returned by the specified delegate is converted to JSON, which then either
 /// replaces the content of each input document or is stored in the specified metadata key.
 /// </summary>
 /// <param name="data">A delegate that returns the object to convert to JSON.</param>
 /// <param name="destinationKey">The metadata key where the JSON should be stored (or <c>null</c>
 /// to replace the content of each input document).</param>
 public GenerateJson(DocumentConfig data, string destinationKey = null)
 {
     _data = data;
 }
Esempio n. 47
0
 /// <summary>
 /// Sets the item title. The default value is the value for the "Title" key
 /// in the input document.
 /// </summary>
 /// <param name="itemTitle">A delegate that should return a <c>string</c> with
 /// the item title.</param>
 public GenerateFeeds WithItemTitle(DocumentConfig itemTitle)
 {
     _itemTitle = itemTitle;
     return(this);
 }
Esempio n. 48
0
 /// <summary>
 /// Transforms input documents using a specified XSLT file from the file system
 /// as provided by a delegate. This allows you to use different XSLT files depending
 /// on the input document.
 /// </summary>
 /// <param name="xsltPath">A delegate that should return the path of the XSLT file to use.</param>
 public Xslt(DocumentConfig xsltPath)
 {
     _xsltPath = xsltPath;
 }
Esempio n. 49
0
 protected ContentModule(DocumentConfig content)
 {
     _content = new ConfigHelper<object>(content);
 }
Esempio n. 50
0
 /// <summary>
 /// Specifies a file name to use as common metadata using a delegate so that the common metadata document can be specific to the input document.
 /// </summary>
 /// <param name="metadataFileName">A delegate that returns a <c>bool</c> indicating if the current document contains the metadata you want to use.</param>
 /// <param name="inherited">If set to <c>true</c>, metadata from documents with this file name will be inherited by documents in nested directories.</param>
 /// <param name="replace">If set to <c>true</c>, metadata from this document will replace any existing metadata on the target document.</param>
 /// <returns>The current module instance.</returns>
 public DirectoryMeta WithMetadataFile(DocumentConfig metadataFileName, bool inherited = false, bool replace = false)
 {
     _metadataFile.Add(new MetaFileEntry(metadataFileName, inherited, replace));
     return(this);
 }
Esempio n. 51
0
 /// <summary>
 /// Specifies the predicate to use for filtering documents.
 /// Only input documents for which the predicate returns <c>true</c> will be output.
 /// </summary>
 /// <param name="predicate">A predicate delegate that should return a <c>bool</c>.</param>
 public Where(DocumentConfig predicate)
 {
     _predicate = predicate;
 }
Esempio n. 52
0
 /// <summary>
 /// Outputs the string value of the returned object to trace. This allows
 /// you to trace different content for each document depending on the input document.
 /// </summary>
 /// <param name="content">A delegate that returns the content to trace.</param>
 public Trace(DocumentConfig content)
     : base(content)
 {
 }
Esempio n. 53
0
 /// <summary>
 /// The object returned by the specified delegate is converted to JSON, which then either
 /// replaces the content of each input document or is stored in the specified metadata key.
 /// </summary>
 /// <param name="data">A delegate that returns the object to convert to JSON.</param>
 /// <param name="destinationKey">The metadata key where the JSON should be stored (or <c>null</c>
 /// to replace the content of each input document).</param>
 public GenerateJson(ContextConfig data, string destinationKey = null)
 {
     _data = (doc, ctx) => data(ctx);
 }
Esempio n. 54
0
 /// <summary>
 /// Specifies a delegate that should be used to get the input path for each
 /// input document. This allows the Sass processor to search the right
 /// file system and paths for include files. By default, the <see cref="Keys.RelativeFilePath"/>
 /// metadata value is used for the input document path.
 /// </summary>
 /// <param name="inputPath">A delegate that should return a <see cref="FilePath"/>.</param>
 /// <returns>The current instance.</returns>
 public Sass WithInputPath(DocumentConfig inputPath)
 {
     _inputPath = inputPath ?? throw new ArgumentNullException(nameof(inputPath));
     return(this);
 }
Esempio n. 55
0
File: If.cs Progetto: zachlungu/Wyam
 /// <summary>
 /// Specifies an alternate condition to be tested on documents that did not satisfy
 /// previous conditions. You can chain together as many <c>ElseIf</c> calls as needed.
 /// </summary>
 /// <param name="predicate">A predicate delegate that should return a <c>bool</c>.</param>
 /// <param name="modules">The modules to execute on documents where the predicate is <c>true</c>.</param>
 public If ElseIf(DocumentConfig predicate, params IModule[] modules)
 {
     _conditions.Add(new Tuple <DocumentConfig, IModule[]>(predicate, modules));
     return(this);
 }
Esempio n. 56
0
 /// <summary>
 /// Partitions the result of the specified modules into groups with matching keys
 /// based on the key delegate.
 /// The input documents to GroupBy are used as
 /// the initial input documents to the specified modules.
 /// </summary>
 /// <param name="key">A delegate that returns the group keys.</param>
 /// <param name="modules">Modules to execute on the input documents prior to grouping.</param>
 public GroupByMany(DocumentConfig key, params IModule[] modules)
     : this(key, (IEnumerable <IModule>)modules)
 {
 }
Esempio n. 57
0
 /// <summary>
 /// Appends the string value of the returned object to to content of each document. 
 /// This allows you to specify different content to append for each document depending 
 /// on the input document.
 /// </summary>
 /// <param name="content">A delegate that returns the content to append.</param>
 public Append(DocumentConfig content)
     : base(content)
 {
 }
Esempio n. 58
0
 /// <summary>
 /// Sets the item thread updated. By default, no thread updated time is specified.
 /// </summary>
 /// <param name="itemThreadUpdated">A delegate that should return a <c>DateTime</c> with
 /// the item thread updated time.</param>
 public GenerateFeeds WithItemThreadUpdated(DocumentConfig itemThreadUpdated)
 {
     _itemThreadUpdated = itemThreadUpdated;
     return(this);
 }
Esempio n. 59
0
        private MethodConfig(IMethodImpl methodImpl, MethodDef methodDef, MethodType type, DocumentConfig documentConfig, IRegion region, bool isTokenOverload)
        {
            Method     = methodImpl;
            MethodDef  = methodDef;
            MethodType = type;

            if (region != null && region.Type != MethodType.Unspecified)
            {
                MethodType = region.Type;
            }

            DocumentConfig = documentConfig;
            this.region    = region;

            CalculateCancellationTokenMode(isTokenOverload);
        }
Esempio n. 60
0
 /// <summary>
 /// Specifies a layout file to use for all Razor pages processed by this module. This
 /// lets you specify a different layout file for each document.
 /// </summary>
 /// <param name="path">A delegate that should return the layout path as a <c>FilePath</c>.</param>
 /// <returns>The current module instance.</returns>
 public Razor WithLayout(DocumentConfig path)
 {
     _layoutPath = path;
     return(this);
 }