Automatic Grammar Agreementと Markdown Extended ...

Automatic Grammar Agreementと Markdown Extended Attributes
について

Automatic Grammar Agreementとその記法のMarkdown Extended Attributes
について、およびMarkdown Extended Attributes
で独自のアノテーションを定義してカスタムのレンダリングを実行する方法。

Kishikawa Katsumi

January 17, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

39 slides
  1. "VUPNBUJD(SBNNBS"HSFFNFOU ෳ਺ܗ΍உੑɾঁੑ໊ࢺΛࣗಈతʹม׵ʢҰகʣͯ͘͠ΕΔ Argument Result pet Does this photo contain any

    pets? person Does this photo contain any people? bicycle Does this photo contain any bicycles?
  2. +40/ $PNNFOU 5SBJMJOH$PNNB 4JOHMF2VPUF FUD { // comments unquoted: 'and

    you can quote me on that', singleQuotes: 'I can use "double quotes" here', lineBreaks: "Look, Mom! \ No \\n's!", hexadecimal: 0xdecaf, leadingDecimalPoint: .8675309, andTrailing: 8675309., positiveSign: +1, trailingComma: 'in objects', andIn: ['arrays',], "backwardsCompatible": "with JSON", }
  3. .BSLEPXO&YUFOEFE"UUSJCVUFT enum SpoilerAttribute: CodableAttributedStringKey, MarkdownDecodableAttributedStringKey { typealias Value = Bool

    static var name = "spoiler" } extension AttributeScopes { struct SpoilerScope: AttributeScope { let spoiler: SpoilerAttribute } var spoilerScope: SpoilerScope.Type { SpoilerScope.self } } 4QPJMFS5BH
  4. .BSLEPXO&YUFOEFE"UUSJCVUFT private func renderedText(from source: AttributedString) -> Text { var

    result = Text("") for run in source.runs { let isSpoiler = (run.spoilerScope.spoiler == true) let slice = AttributedString(source[run.range]) if isSpoiler { let raw = String(slice.characters) let masked = mask(raw) ... } else { ... } } ... 4QPJMFS5BH
  5. r 658"VUPNBUJD(SBNNBS"HSFFNFOUJO.FTTBHF'PSNBUUJOH IUUQTXXXZPVUVCFDPNXBUDI W$FI:*LRP. r )BOEMFQMVSBMTJO4XJGU6*5FYUWJFXTXJUIJO fl FDUJPO IUUQTOJMDPBMFTDJOHDPNCMPH)BOEMF1MVSBMT*O4XJGU6*5FYU7JFXT8JUI*O fl

    FDUJPO r .PSQIPMPHZJO4XJGU IUUQTXXXTXJGUKFDUJWFDDPNNPSQIPMPHZJOJPTXJUIBVUPNBUJDHSBNNBSBHSFFNFOU r .PSQIPMPHZJO4XJGU IUUQTMJDLBCJMJUZDPNCMPHNPSQIPMPHZJOTXJGU r "VUPNBUJD(SBNNBS"HSFFNFOU IUUQTNKUTBJDPNCMPHBVUPNBUJDHSBNNBSBHSFFNFOU ࢀߟจݙ

More Decks by Kishikawa Katsumi

Other Decks in Programming