Skip to content

Commit a7f22f0

Browse files
committed
Make abstract syntax extensible. Implement example showcasing how simple extensions work. Fix playground (again). Extend documentation.
1 parent 20f722a commit a7f22f0

28 files changed

+708
-100
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.1.0 (2021-05-12)
4+
- Make abstract syntax trees extensible
5+
- Provide a simple means to define new types of emphasis
6+
- Document support for definition lists via `ExtendedMarkdownParser`
7+
- Migrate framework to Xcode 12.5
8+
39
## 1.0.4 (2021-02-15)
410
- Support Linux
511
- Fix handling of XML/HTML entities/named character references

MarkdownKit.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
CC2AF6F7227CD98100BEA420 /* MarkdownBlockTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC2AF6F6227CD98100BEA420 /* MarkdownBlockTests.swift */; };
1818
CC2AF6F9227CD98100BEA420 /* MarkdownKit.h in Headers */ = {isa = PBXBuildFile; fileRef = CC2AF6EB227CD98100BEA420 /* MarkdownKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
1919
CC3E4F532309FE9100C8A3DD /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3E4F522309FE9100C8A3DD /* Color.swift */; };
20+
CC55DD88264B19D8001AAD10 /* MarkdownExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC55DD87264B19D8001AAD10 /* MarkdownExtension.swift */; };
2021
CC5E530C2359FF3A00C72CE2 /* EscapeTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC5E530B2359FF3A00C72CE2 /* EscapeTransformer.swift */; };
2122
CC6988C4227CDF810021C7E1 /* BlockquoteParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6988C3227CDF810021C7E1 /* BlockquoteParser.swift */; };
2223
CC6D239822C03CBA00BB1302 /* LinkTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6D239722C03CBA00BB1302 /* LinkTransformer.swift */; };
@@ -30,6 +31,8 @@
3031
CC7B603D22AC6AD70092188C /* CodeLinkHtmlTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7B603C22AC6AD70092188C /* CodeLinkHtmlTransformer.swift */; };
3132
CC7B603F22AEFDFF0092188C /* ParserUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7B603E22AEFDFF0092188C /* ParserUtil.swift */; };
3233
CC7B604122B67F0C0092188C /* EmphasisTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7B604022B67F0C0092188C /* EmphasisTransformer.swift */; };
34+
CC879880264B43BD006950A7 /* CustomTextFragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC87987F264B434F006950A7 /* CustomTextFragment.swift */; };
35+
CC879881264B43C1006950A7 /* CustomBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC87987E264B431F006950A7 /* CustomBlock.swift */; };
3336
CC8CBC17227F39C00084683B /* ListItemParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8CBC16227F39C00084683B /* ListItemParser.swift */; };
3437
CC8CBC192284B3F40084683B /* MarkdownFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8CBC182284B3F40084683B /* MarkdownFactory.swift */; };
3538
CC8CBC1F2286CED60084683B /* Blocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8CBC1E2286CED60084683B /* Blocks.swift */; };
@@ -134,6 +137,7 @@
134137
CC2AF6F6227CD98100BEA420 /* MarkdownBlockTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownBlockTests.swift; sourceTree = "<group>"; };
135138
CC2AF6F8227CD98100BEA420 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
136139
CC3E4F522309FE9100C8A3DD /* Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Color.swift; sourceTree = "<group>"; };
140+
CC55DD87264B19D8001AAD10 /* MarkdownExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownExtension.swift; sourceTree = "<group>"; };
137141
CC5E530B2359FF3A00C72CE2 /* EscapeTransformer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EscapeTransformer.swift; sourceTree = "<group>"; };
138142
CC6988C3227CDF810021C7E1 /* BlockquoteParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockquoteParser.swift; sourceTree = "<group>"; };
139143
CC6988C5227CDFB10021C7E1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
@@ -149,6 +153,8 @@
149153
CC7B603C22AC6AD70092188C /* CodeLinkHtmlTransformer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeLinkHtmlTransformer.swift; sourceTree = "<group>"; };
150154
CC7B603E22AEFDFF0092188C /* ParserUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParserUtil.swift; sourceTree = "<group>"; };
151155
CC7B604022B67F0C0092188C /* EmphasisTransformer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmphasisTransformer.swift; sourceTree = "<group>"; };
156+
CC87987E264B431F006950A7 /* CustomBlock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBlock.swift; sourceTree = "<group>"; };
157+
CC87987F264B434F006950A7 /* CustomTextFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextFragment.swift; sourceTree = "<group>"; };
152158
CC8CBC16227F39C00084683B /* ListItemParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListItemParser.swift; sourceTree = "<group>"; };
153159
CC8CBC182284B3F40084683B /* MarkdownFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownFactory.swift; sourceTree = "<group>"; };
154160
CC8CBC1E2286CED60084683B /* Blocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Blocks.swift; sourceTree = "<group>"; };
@@ -259,8 +265,10 @@
259265
children = (
260266
CC8CBC1E2286CED60084683B /* Blocks.swift */,
261267
CCB033CC227CDB2F00E1C4DC /* Block.swift */,
268+
CC87987E264B431F006950A7 /* CustomBlock.swift */,
262269
CCD0746722A060CF0053B73C /* Text.swift */,
263270
CC088C0A22DB74090059460E /* TextFragment.swift */,
271+
CC87987F264B434F006950A7 /* CustomTextFragment.swift */,
264272
CC8CBC1A22862F4F0084683B /* Parser */,
265273
CC088C0C22DD2B960059460E /* HTML */,
266274
CC088C0D22DD2BA70059460E /* AttributedString */,
@@ -280,6 +288,7 @@
280288
CC7B603822AC67DC0092188C /* MarkdownInlineTests.swift */,
281289
CC088C2322E337BD0059460E /* MarkdownHtmlTests.swift */,
282290
CC8D559C24C3560700E11F96 /* ExtendedMarkdownHtmlTests.swift */,
291+
CC55DD87264B19D8001AAD10 /* MarkdownExtension.swift */,
283292
CCC48C0325D98FCB00D082AD /* MarkdownStringTests.swift */,
284293
CCC48C1425D9D81000D082AD /* LinuxMain.swift */,
285294
CC2AF6F8227CD98100BEA420 /* Info.plist */,
@@ -508,6 +517,8 @@
508517
CCD0746A22A324400053B73C /* InlineTransformer.swift in Sources */,
509518
CC7B603B22AC6AB40092188C /* DelimiterTransformer.swift in Sources */,
510519
CCD0746822A060CF0053B73C /* Text.swift in Sources */,
520+
CC879880264B43BD006950A7 /* CustomTextFragment.swift in Sources */,
521+
CC879881264B43C1006950A7 /* CustomBlock.swift in Sources */,
511522
CC8CBC2322884F940084683B /* SetextHeadingParser.swift in Sources */,
512523
CC3E4F532309FE9100C8A3DD /* Color.swift in Sources */,
513524
CC72627622F318F3001AB6D9 /* AttributedStringGenerator.swift in Sources */,
@@ -529,6 +540,7 @@
529540
files = (
530541
CC7B603922AC67DC0092188C /* MarkdownInlineTests.swift in Sources */,
531542
CC24757324C1EBB600678C59 /* ExtendedMarkdownBlockTests.swift in Sources */,
543+
CC55DD88264B19D8001AAD10 /* MarkdownExtension.swift in Sources */,
532544
CC088C2422E337BD0059460E /* MarkdownHtmlTests.swift in Sources */,
533545
CCC48C0425D98FCB00D082AD /* MarkdownStringTests.swift in Sources */,
534546
CC2AF6F7227CD98100BEA420 /* MarkdownBlockTests.swift in Sources */,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1250"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "CC2AF6E7227CD98100BEA420"
18+
BuildableName = "MarkdownKit.framework"
19+
BlueprintName = "MarkdownKit"
20+
ReferencedContainer = "container:MarkdownKit.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
</LaunchAction>
44+
<ProfileAction
45+
buildConfiguration = "Release"
46+
shouldUseLaunchSchemeArgsEnv = "YES"
47+
savedToolIdentifier = ""
48+
useCustomWorkingDirectory = "NO"
49+
debugDocumentVersioning = "YES">
50+
<MacroExpansion>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "CC2AF6E7227CD98100BEA420"
54+
BuildableName = "MarkdownKit.framework"
55+
BlueprintName = "MarkdownKit"
56+
ReferencedContainer = "container:MarkdownKit.xcodeproj">
57+
</BuildableReference>
58+
</MacroExpansion>
59+
</ProfileAction>
60+
<AnalyzeAction
61+
buildConfiguration = "Debug">
62+
</AnalyzeAction>
63+
<ArchiveAction
64+
buildConfiguration = "Release"
65+
revealArchiveInOrganizer = "YES">
66+
</ArchiveAction>
67+
</Scheme>

MarkdownKitPlayground.playground/Contents.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// MarkdownKit
44
//
55
// Created by Matthias Zenger on 01/08/2019.
6-
// Copyright © 2019-2020 Google LLC.
6+
// Copyright © 2019-2021 Google LLC.
77
//
88
// Licensed under the Apache License, Version 2.0 (the "License");
99
// you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
1919
// License.
2020
//
2121

22-
import AppKit
2322
import PlaygroundSupport
2423

2524
PlaygroundPage.current.liveView =

MarkdownKitPlayground.playground/Sources/MarkdownPlayground.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// MarkdownKit
44
//
55
// Created by Matthias Zenger on 02/08/2019.
6-
// Copyright © 2019 Google LLC.
6+
// Copyright © 2019-2021 Google LLC.
77
//
88
// Licensed under the Apache License, Version 2.0 (the "License");
99
// you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
//
2020

2121
import Foundation
22+
import AppKit
2223
import PlaygroundSupport
2324
import MarkdownKit
2425

Package.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.3
22
//
33
// Package.swift
44
// MarkdownKit
55
//
66
// Build targets by calling the Swift Package Manager in the following way for debug purposes:
7-
// swift build
7+
// `swift build`
88
//
99
// A release can be built with these options:
10-
// swift build -c release
10+
// `swift build -c release`
11+
//
12+
// The tests can be executed via:
13+
// `swift test`
1114
//
1215
// Created by Matthias Zenger on 09/08/2019.
1316
// Copyright © 2019-2021 Google LLC.
@@ -41,12 +44,14 @@ let package = Package(
4144
],
4245
targets: [
4346
.target(name: "MarkdownKit",
44-
dependencies: []),
47+
dependencies: [],
48+
exclude: ["Info.plist"]),
4549
.target(name: "MarkdownKitProcess",
4650
dependencies: ["MarkdownKit"],
4751
exclude: []),
4852
.testTarget(name: "MarkdownKitTests",
49-
dependencies: ["MarkdownKit"])
53+
dependencies: ["MarkdownKit"],
54+
exclude: ["Info.plist"])
5055
],
5156
swiftLanguageVersions: [.v5]
5257
)

0 commit comments

Comments
 (0)