Mattt

@mattt

Founder of and . Writer and developer living in Portland, Oregon.

Portland, OR
Joined December 2006

Tweets

You blocked @mattt

Are you sure you want to view these Tweets? Viewing Tweets won't unblock @mattt

  1. Mar 11

    I just did this for , and—by all appearances—it's working as expected. If you're inclined to do the same, feel free to grab the WOFF / WOFF2 files here:

    Show this thread
    Undo
  2. Mar 11

    Here's how to serve the Creative Commons symbol to your website's visitors, using their official Unicode code points, starting today: • In HTML, use a character escape to represent the 🅭 code point (🅭) • In CSS, declare a font-face with the corresponding unicode-range

    <i title="Creative Commons">&#x1F16D;</i>
<i title="Attribution">&#x1F16F;</i>
<i title="Non-Commercial">&#x1F10F;</i>
    @font-face {
  font-family: "Creative Commons Symbols";
  src: url(font_path("CreativeCommonsSymbols.woff2")) format("woff2"),
    url(font_path("CreativeCommonsSymbols.woff")) format("woff");
  font-weight: normal;
  font-style: normal;
  unicode-range: U+1F10D-1F10F, U+1F16D-1F16F;
}
    Show this thread
    Undo
  3. Mar 11

    Getting an official code point in The Unicode Standard is a huge milestone, but it'll be a while until the Creative Commons symbol (🅭 U+1F16D) can be rendered on most platforms (the same goes for 🪅 U+1FA85 and all of the other new emoji). But for the impatient among us...

    Show this thread
    Undo
  4. Mar 11

    Unicode version 13 adds six new code points to the Enclosed Alphanumeric Supplement block (U+1F100–1F1FF) for Creative Commons symbols. At long last, the global commons are at parity with ©, typographically-speaking!

    Creative Commons symbols. New in The Unicode Standard, Version 13.0
    Show this thread
    Undo
  5. Mar 2

    Introducing : a convenient reference of available build settings for Xcode projects.

    Undo
  6. Feb 19

    We’re using HypertextLiteral to build HTML and Docset generation for swift-doc (coming soon!), and it’s been working out really well so far. I’m really excited to share this with the community, and I look forward to seeing what folks make with it. 🥳

    Show this thread
    Undo
  7. Feb 19

    ExpressibleByStringInterpolation has been overshadowed by newer additions to Swift, but we think it’s worth another look. It’s extensible, lightweight, and rock solid (no SourceKit crashes!) — truly, one of our favorite features in Swift 5.

    Show this thread
    Undo
  8. Feb 19

    Following the lead of ’s Hypertext Literal library for JavaScript, our project leverages Swift’s powerful interpolation functionality. By implementing a subset of the HTML tokenizer, we can determine the context in which an interpolation occurs and escape accordingly.

    Show this thread
    Undo
  9. Feb 19

    There are quite a few Swift packages for generating HTML. Some adopt SwiftUI-style function builders, while others use more conventional means. But they all have comparable offerings — namely, a domain-specific language (DSL). HypertextLiteral takes a different approach.

    div {
  if useChapterTitles {
    h1("1. Loomings.")
  }
  p {
    "Call me Ishmael. Some years ago"
  }
  p {
    "There is now your insular city"
  }
}
    Show this thread
    Undo
  10. Feb 19

    Introducing HypertextLiteral: a Swift package for generating HTML, XML, and other web content using string literal interpolation. 🧵⬇️

    import HypertextLiteral

let attributes = [
    "style": [
        "background": "yellow",
        "font-weight": "bold"
    ]
]

let html: HTML = "<span \(attributes)>whoa</span>"
// <span style="background: yellow; font-weight: bold;">whoa</span>
    Show this thread
    Undo
  11. Jan 27

    swift-doc is available to try out today, both as a command-line utility and a Action. Please take a look when you have a chance, and let me know what you think! 😁

    Show this thread
    Undo
  12. Jan 27

    With SwiftSemantics, I was able to build tools I'd been thinking about for years in just a few hours. For example, a utility that prints a package's public-facing APIs on separate lines (allowing you to diff for changes between versions)

    $ swift run swift-api-inventory SwiftSemantics/Sources | less
struct AssociatedType: Declaration, Hashable, Codable, ExpressibleBySyntax
var AssociatedType.attributes { get }
var AssociatedType.context { get }
var AssociatedType.keyword { get }
var AssociatedType.modifiers { get }
var AssociatedType.name { get }
...

$ swift run swift-api-inventory SwiftSemantics/Sources | wc
     207    1023    8993
    Show this thread
    Undo
  13. Jan 27

    Actually, the CommonMark package I wrote for SwiftMarkup is pretty cool in its own right — especially with the function builder interface I added to it over the weekend. For your consideration for anyone in market for Markdown-related functionality.

    import CommonMarkBuilder

let document = Document {
    Heading {
        Link(urlString: "https://www.un.org/en/universal-declaration-human-rights/",
                title: "View full version")
        {
            "Universal Declaration of Human Rights"
        }
    }

    Section { // sections increase the level of contained headings
        Heading { "Article 1." } // this is a second-level heading
    }

    F
    Show this thread
    Undo
  14. Jan 27

    SwiftMarkup is the other key player in swift-doc. It parses documentation comments into structured entities.

    let markdown = #"""
Creates a new bicycle with the provided parts and specifications.

- Remark: Satisfaction guaranteed!

The word *bicycle* first appeared in English print in 1868
to describe "Bysicles and trysicles" on the
"Champs Elysées and Bois de Boulogne".

- Parameters:
   - style: The style of the bicycle
   - gearing: The gearing of the bicycle
   - handlebar: The handlebar of the bicycle
   - frameSize: T
    Show this thread
    Undo
  15. Jan 27

    swift-doc's secret sauce is a package called SwiftSemantics, which builds on top of SwiftSyntax to provide a conventional, document-oriented interface to reasoning about declarations in Swift code.

    import SwiftSyntax
import SwiftSemantics

let source = """
import UIKit

class ViewController: UIViewController, UITableViewDelegate {
    enum Section: Int {
        case summary, people, places
    }

    var people: [People], places: [Place]

    @IBOutlet private(set) var tableView: UITableView!
}
"""

var collector = DeclarationCollector()
let tree = try SyntaxParser.parse(source: source)
tree.walk(&collector)
    Show this thread
    Undo
  16. Jan 27

    One of the distinguishing features of swift-doc is that it operates on Swift code at a syntactic level, without first compiling it. 2 primary effects: 1. Operational Simplicity: It can be installed both macOS and Linux as a standalone binary 2. Speed: It's fast

    $ cd SwiftSemantics

$ time swift-doc Sources
        0.21 real         0.16 user         0.02 sys

$ time jazzy # fresh build
jam out ♪♫ to your fresh new docs in `docs`
       67.36 real        98.76 user         8.89 sys


$ time jazzy # with build cache
jam out ♪♫ to your fresh new docs in `docs`
       17.70 real         2.17 user         0.88 sys
    Show this thread
    Undo
  17. Jan 27

    Introducing swift-doc: an (experimental) command-line utility for generating documentation for Swift projects. It's still early on, but I'm really excited about the infrastructure behind it, and how it can be used to develop Swift tooling. 🧵⬇️

    $ swift swift-doc path/to/SwiftProject/Sources \
			--output Documentation
$ tree Documentation
$ Documentation/
├── Home
├── (...)
├── _Footer.md
└── _Sidebar.md
    Show this thread
    Undo
  18. Jan 15

    I understand why this kind of information isn't provided in the documentation, but it'd be nice to know these limitations up front. Anyway, I hope that this information is useful to anyone working in this space. Happy to try and answer any questions you might have.

    Show this thread
    Undo
  19. Jan 15

    I was also surprised to see how limited NaturalLanguage support is on tvOS. Everything except English has only basic functionality, and even that is missing lemmatized forms and sentiment.

    Show this thread
    Undo
  20. Jan 15

    My biggest takeaway was that Apple's built-in NLP features are a nonstarter for East-Asian languages. If you want to make an app that, for example, parses Japanese text, you'll need to incorporate something like MeCab ()

    Show this thread
    Undo

Loading seems to be taking a while.

Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

    You may also like

    ·