Merge pull request #326 from stencilproject/feature/attribution

Add attribution #trivial
This commit is contained in:
David Jennes
2022-07-29 03:05:52 +02:00
committed by GitHub
47 changed files with 274 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
/// A container for template variables.
public class Context {
var dictionaries: [[String: Any?]]

View File

@@ -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 {

View File

@@ -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

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
public class TemplateDoesNotExist: Error, CustomStringConvertible {
let templateNames: [String]
let loader: Loader?

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
public protocol Expression: CustomStringConvertible, Resolvable {
func evaluate(context: Context) throws -> Bool
}

View File

@@ -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

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
class FilterNode: NodeType {
let resolvable: Resolvable
let nodes: [NodeType]

View File

@@ -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 }

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
class ForNode: NodeType {

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
enum Operator {
case infix(String, Int, InfixOperator.Type)
case prefix(String, Int, PrefixOperator.Type)

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
class IncludeNode: NodeType {

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
class BlockContext {
class var contextKey: String { "block_context" }

View File

@@ -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.

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
typealias Line = (content: String, number: UInt, range: Range<String.Index>)

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
import PathKit

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
/// Represents a parsed node

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
#if !os(Linux)
import Foundation

View File

@@ -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) {

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
import PathKit

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
extension String {

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
public struct TrimBehaviour: Equatable {

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Foundation
typealias Number = Float

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
import Stencil

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
import Stencil
import XCTest

View File

@@ -1,3 +1,9 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -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