Merge pull request #326 from stencilproject/feature/attribution
Add attribution #trivial
This commit is contained in:
@@ -104,6 +104,14 @@ closure_body_length:
|
||||
conditional_returns_on_newline:
|
||||
if_only: true
|
||||
|
||||
file_header:
|
||||
required_pattern: |
|
||||
\/\/
|
||||
\/\/ Stencil
|
||||
\/\/ Copyright © 2022 Stencil
|
||||
\/\/ MIT Licence
|
||||
\/\/
|
||||
|
||||
indentation_width:
|
||||
indentation_width: 2
|
||||
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2018, Kyle Fuller
|
||||
Copyright (c) 2022, Kyle Fuller
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
/// A container for template variables.
|
||||
public class Context {
|
||||
var dictionaries: [[String: Any?]]
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
/// Marker protocol so we can know which types support `@dynamicMemberLookup`. Add this to your own types that support
|
||||
/// lookup by String.
|
||||
public protocol DynamicMemberLookup {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
/// Container for environment data, such as registered extensions
|
||||
public struct Environment {
|
||||
/// The class for loading new templates
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
public class TemplateDoesNotExist: Error, CustomStringConvertible {
|
||||
let templateNames: [String]
|
||||
let loader: Loader?
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
public protocol Expression: CustomStringConvertible, Resolvable {
|
||||
func evaluate(context: Context) throws -> Bool
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
/// Container for registered tags and filters
|
||||
open class Extension {
|
||||
typealias TagParser = (TokenParser, Token) throws -> NodeType
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
class FilterNode: NodeType {
|
||||
let resolvable: Resolvable
|
||||
let nodes: [NodeType]
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
func capitalise(_ value: Any?) -> Any? {
|
||||
if let array = value as? [Any?] {
|
||||
return array.map { stringify($0).capitalized }
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class ForNode: NodeType {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
enum Operator {
|
||||
case infix(String, Int, InfixOperator.Type)
|
||||
case prefix(String, Int, PrefixOperator.Type)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
|
||||
class IncludeNode: NodeType {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
class BlockContext {
|
||||
class var contextKey: String { "block_context" }
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// A structure used to represent a template variable, and to resolve it in a given context.
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
typealias Line = (content: String, number: UInt, range: Range<String.Index>)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import PathKit
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Represents a parsed node
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
#if !os(Linux)
|
||||
import Foundation
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
/// Creates a checker that will stop parsing if it encounters a list of tags.
|
||||
/// Useful for example for scanning until a given "end"-node.
|
||||
public func until(_ tags: [String]) -> ((TokenParser, Token) -> Bool) {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import PathKit
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension String {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TrimBehaviour: Equatable {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
typealias Number = Float
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import PathKit
|
||||
import Spectre
|
||||
import Stencil
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
//
|
||||
// Stencil
|
||||
// Copyright © 2022 Stencil
|
||||
// MIT Licence
|
||||
//
|
||||
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
@@ -50,7 +50,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'Stencil'
|
||||
copyright = '2016, Kyle Fuller'
|
||||
copyright = '2022, Kyle Fuller'
|
||||
author = 'Kyle Fuller'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
|
||||
Reference in New Issue
Block a user