Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DocC Documentation Archiveをアプリ開発で活用してみよう / DocC...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
aoi
September 28, 2022
Technology
680
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DocC Documentation Archiveをアプリ開発で活用してみよう / DocC Documentation Archive for iOS Application
https://cookpad.connpass.com/event/254459/
aoi
September 28, 2022
More Decks by aoi
See All by aoi
モバイルアプリの行動ログの運用つらさ解消法 / mobile-log-troubleshooting
aomathwift
3
2.9k
ロック画面Widgetをサクッと実装してみた話
aomathwift
3
480
OS 固有の新機能をサービスに取り入れ活用していくための Tips
aomathwift
0
90
即時通知を導入する際に考えるべきこと
aomathwift
0
6.2k
機能ごとに動作するミニアプリでプレビューサイクルを爆速にした話 After Talk
aomathwift
0
560
機能ごとに動作するミニアプリでプレビューサイクルを爆速にした話
aomathwift
1
11k
Other Decks in Technology
See All in Technology
Compose 新機能総まとめ / What's New in Jetpack Compose
yanzm
0
320
GoでCコンパイラを作った話
repunit
0
120
「AIに依存している」と 「AIを使いこなしている」の違い
k8yasuma
0
120
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
マルチアカウント環境でSecurity Hubの運用、その後どうなった? / SRE NEXT 2026 miniLT会
genda
0
110
AI時代のPlaywright活用(システムテストを自動化する ー 実行エンジンにPla ywrightを選んだ理由)
ynisqa1988
1
560
タスクの複雑さでモデルを選ぶ ── Thompson Samplingで動かす“トークン/コスト最適化
satohy0323
0
570
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
160
Amplify Gen2でbackend.tsにCDKを定義する/しない事によるCDKの挙動の違いとユースケース
smt7174
1
420
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
420
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
410
発表と総括 / Presentations and Summary
ks91
PRO
0
140
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.5k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
830
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
390
A designer walks into a library…
pauljervisheath
211
24k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.6k
The Limits of Empathy - UXLibs8
cassininazir
1
500
Writing Fast Ruby
sferik
630
63k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Transcript
DocC Documentation Archive Λ ΞϓϦ։ൃͰ׆༻ͯ͠ΈΑ͏ 2022/09/28 After Party iOSDC Japan
2022 @aomathwift
ࣗݾհ Aoi Okawa (@aomathwift) Cookpad Inc. iOS Developer Cookpad Mart
͓͜ͱΘΓ • ͜ΕΞϓϦͷυΩϡϝϯτΛ DocC ʹஔ͖͑ͨͱ͍͏ࣄྫͷͰ ͋Γ·ͤΜ • ΞϓϦέʔγϣϯλʔήοτͰ DocC Λॱʹѻ͏ํ๏ʹ͍ͭͯৄ
͘͠৮Ε·ͤΜ • ͋͘·ͰݕূͱΞΠσΞͷͱͯ͠ฉ͍͍ͯͩ͘͞
Swift-DocC ͰͷυΩϡϝϯτ࡞
Swift-DocC ͱ • Apple ७ਖ਼ͷυΩϡϝϯτ࡞πʔϧ • Xcode 13 Ҏ߱ʹ౷߹ •
OSS ͱͯ͠ެ։͞Ε͍ͯΔ
None
Swift-DocC ͷΞοϓσʔτ • Xcode 13.3 ͔ΒΞϓϦέʔγϣϯ͚ͷϏϧυΛαϙʔτ • Github Pages ʹ؆୯ʹϗεςΟϯάͰ͖Δػೳ
→ ΞϓϦυΩϡϝϯτͷ DocC ԽΛקΊΔػӡʁ
ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ։ൃڥͷηοτΞοϓ
• Utility ΫϥεͷϝιουϓϩύςΟͷઆ໌
ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ։ൃڥͷηοτΞοϓ
• Utility ΫϥεͷϝιουϓϩύςΟͷઆ໌ → Documentation Έ͍ͨͳσΟϨΫτϦԼʹஔ͍͍ͯΔ
ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ։ൃڥͷηοτΞοϓ
• Utility ΫϥεͷϝιουϓϩύςΟͷઆ໌ → README.md CONTRIBUTING.md
None
ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ։ൃڥͷηοτΞοϓ
• Utility ΫϥεͷϝιουϓϩύςΟͷઆ໌ → ίʔυίϝϯτ = DocC ͷه๏Λར༻
ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ։ൃڥͷηοτΞοϓ
• Utility ΫϥεͷϝιουϓϩύςΟͷઆ໌ → Documentation Catalog Λ͏
Documentation Catalog •Markdownهࣄ֦ுϑΝΠϧΛ ؚΊΔ͜ͱͰಛఆͷAPIͷઆ໌Ҏ֎ ͷ෦ͷυΩϡϝϯτΛิ •ެࣜυΩϡϝϯτͷ Overview ͷ ϖʔδ͕֘
͜͏͢Δͱ DocC ԽͰ͖Δ • طଘͷ Markdown ϑΝΠϧΛ Documentation Catalog ʹೖΕࠐΉ
• ಛఆͷϝιουΫϥεͷઆ໌ DocC ίϝϯτΛॻ͖ࠐΉ
طଘͷυΩϡϝϯτͰݴ͏ͯࠔͬͯͳ͍ Ͱ DocC ͪΐͬͱ৮ͬͯΈ͍ͨͳ͊🥺
Documentation Archive ͱ͍͏ͷΛ༻͍ͯ ผͷܗͰ Swift-DocC Λ׆༻ͯ͠Έ·͠ΐ͏
Agenda • DocC Documentation Archive ͱ • Documentation Archive ͷߏ
• Documentation Archive ͷ׆༻
Documentation Archive ͍ͭͯ
Documentation Archive • *.doccarchive ֦ுࢠΛ࣋ͭυΩϡϝϯτͷຊମσΟϨΫτϦ • Xcode Ͱ։͘ͱ DocC υΩϡϝϯτͱͯ͠ϨϯμϦϯά͞ΕΔ
None
Documentation Archive ͷϏϧυ • Xcode ͷ GUI ͔Β࣮ߦ • Xcode
ଐͷ doccbuild ίϚϯυͰ࣮ߦ
None
Documentation Archive ͷϏϧυ(CLI) $ xcodebuild -workspace CookpadMart.xcworkspace -scheme "CookpadMart" -sdk
iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13 Pro,OS=16.0' docbuild -derivedDataPath .build
Documentation Archive ͷߏ
None
*.doccarchive • υΩϡϝϯτΛϨϯμϦϯά͢Δͷʹඞཁͳใͷू·Γ • Xcode13 ·Ͱ͜ͷσΟϨΫτϦΛϏϧυࡁΈυΩϡϝϯτ͔Β Export Ͱ͖ͨ ※
Xcode14 ͔Β *.doccarchive/documentation ҎԼͷ HTML ϑΝΠ ϧୡ͔͠ Export Ͱ͖ͳ͍
*.doccarhive/data • ύʔε͞Εͨίϝϯτ͕ϝιουΫϥε͝ͱʹߏԽ͞Εͨͷ • υΩϡϝϯτͷݟͨͲ͓ΓͷใΛ json ͷܗͰͭ • {Target Name}.json
͕ϧʔτʹ͍Δ
{ "variants": [ ... ], "schemaVersion": { ... }, "sections":
[], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
{Target Name}.json • τοϓϖʔδใʹ͋ͨΔͷ • topicSections • Classes, Protocols, Structures,
Variables, … • references • ֤ΫϥεͷυΩϡϝϯτͷIDද໊ࣔ
None
"topicSections": [ { "title": "Classes", "identifiers": [ “doc:\/\/bunle-id\/documentation\/CookpadMartEC\/MartActivityLogger" ... ]
}, { "title": "Protocols", "identifiers": [ ... ] }, { "title": "Structures", "identifiers": [ ... ] }, { "title": "Variables", "identifiers": [ ... ] }, { "title": "Functions", "identifiers": [ ... }, { "title": "Operators", "identifiers": [ … ] }, { "title": "Type Aliases", "identifiers": [ ... ] }, { "title": "Enumerations", "identifiers": [ ... ] } ] { "variants": [ ... ], "schemaVersion": { ... }, "sections": [], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
"references": { "doc://bundle-id/documentation/CookpadMart/ActivityLogger": { "role": "symbol", "title": "ActivityLogger", "fragments": [
{ "kind": "keyword", "text": "protocol" }, { "kind": "text", "text": " " }, { "kind": "identifier", "text": "ActivityLogger" } ], "identifier": “doc:\/\/bundle-id\/documentation\/ CookpadMart\/ActivityLogger", "kind": "symbol", "type": "topic", "url": “\/documentation\/cookpadmartec\/activitylogger" }, ... } { "variants": [ ... ], "schemaVersion": { ... }, "sections": [], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
֤ class ͝ͱͷϑΝΠϧɾσΟϨΫτϦ • جຊతʹͦͷϖʔδͷυΩϡϝϯτʹฒΒΕΔηΫγϣϯͷใΛ ֤ηΫγϣϯ໊ͷΩʔʹͨͤΒΕ͍ͯΔ • σΟϨΫτϦҎԼϝιουɾม͝ͱʹಉ༷ͷηΫγϣϯσʔλΛ ͬͨ json
ϑΝΠϧ͕٧Ίࠐ·Ε͍ͯΔ
{ "primaryContentSections": [ ... ], "schemaVersion": { ... }, "sections":
[], "variants": [ ... ], "relationshipsSections": [ ... ], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
֤ class ͷϑΝΠϧ • topicSections • Initializers, Instance Properties, Instsnce
Methods… ͳͲ • primaryContentSections • declaration ͳͲ • relationshipsSections • inheritFrom, conformTo, conformingType
None
"primaryContentSections": [ { "kind": "declarations", "declarations": [ { "tokens": [
{ "kind": "keyword", "text": "protocol" }, { "kind": "text", "text": " " }, { "kind": "identifier", "text": "ActivityLogger" } ], "languages": [ "swift" ], "platforms": [ "iOS" ] } ] } ] { "primaryContentSections": [ ... ], "schemaVersion": { ... }, "sections": [], "variants": [ ... ], "relationshipsSections": [ ... ], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
None
"topicSections": [ { "title": "Structures", "identifiers": [ ... ] },
{ "title": "Initializers", "identifiers": [ ... ] }, { "title": "Instance Properties", "identifiers": [ ... ] }, { "title": "Instance Methods", "identifiers": [ ... ] }, { "title": "Type Aliases", "identifiers": [ ... ] }, { "title": "Type Properties", "identifiers": [ ... ] }, { "title": "Type Methods", "identifiers": [ ... ] }, { "title": "Default Implementations", "identifiers": [ ... ], "generated": true } ] { "primaryContentSections": [ ... ], "schemaVersion": { ... }, "sections": [], "variants": [ ... ], "relationshipsSections": [ ... ], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
None
"relationshipsSections": [ { "identifiers": [ "doc:\/\/bundle-id\/documentation\/CookpadMart\/ EmptyActivityLogger", "doc:\/\/bundle-id\/documentation\/CookpadMart\/ MartActivityLogger" ],
"kind": "relationships", "title": "Conforming Types", "type": "conformingTypes" } ] { "primaryContentSections": [ ... ], "schemaVersion": { ... }, "sections": [], "variants": [ ... ], "relationshipsSections": [ ... ], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
relationshipsSections • ґଘؔʹ͋ΔཁૉΛ ID ͰϦετΞοϓ • ͕ࣗܧঝ͍ͯ͠Δɾ͞Ε͍ͯΔ class • ͕ࣗ४ڌ͍ͯ͠Δɾ͞Ε͍ͯΔ
protocol • ผϞδϡʔϧͷͷඪ४ϥΠϒϥϦͷͷࢀরͰ͖Δ → 💡 ґଘؔͷՄࢹԽʹ͑ͦ͏
ґଘ͕ؔݟ͑ΔͱԿ͕خ͍͔͠ • ϦϑΝΫλϦϯάͷͱ͖ʹͲ͜ʹӨڹ͕ग़Δ͔ΛѲͰ͖Δ • ৽ϝϯόʔʹใڞ༗͢Δͱ͖ʹίʔυΛ͏ΑΓ؆୯
Documentation Archive ͷ׆༻ ґଘؔΛՄࢹԽͯ͠ΈΔ
ํ • ు͖ग़͞Εͨ *.doccarchive ʹରͯ͠ҎԼΛ࣮ߦ͢Δ • ֤ json ͷ relationshipsSections
ΩʔͷΛࢀর͢Δ • identi fi ers Ωʔͷ͔Βґଘؔʹ͋ΔཁૉΛऔಘ͢Δ • type ΩʔͷΛΈ্ͯهཁૉͱ֘ͷཁૉͱͷؔΛൈ͖ग़͢
࣮ • ҎԼͷ Ruby εΫϦϓτΛϓϩδΣΫτͰ࣮ߦ͍ͯ͠·͢ • https://github.com/aomathwift/dependencies_generator
ҰཡΛςΩετͷ··ग़ྗʢˢ Markdown Ͱগ͠ܗʣ
ಛఆͷཁૉʹର͢ΔґଘΛ PlantUML Ͱग़ྗ
࣮ࡍʹϓϩδΣΫτͰ׆༻͢Δʹ • ՌΛϦϙδτϦʹஔ͠ɺࣗಈςετͰఆظతʹߋ৽͞ΕΔঢ় ଶʹ͢Δ • ՌΛఆظతʹνʔϜͰோΊΔ࣌ؒΛ࡞Δ
ͦͷଞͷσʔλ׆༻ߏ • UIViewController Λܧঝ͍ͯ͠ΔΫϥεΛϦετΞοϓͯ͠ΞϓϦͷ ը໘ϦετΛ࡞Δ • conformingType ͷແ͍ protocol ͱ͔Λࣗಈݕͯ͠আΛקΊΔΞ
ϥʔτΛग़͢
·ͱΊ • Documentation Archive DocC υΩϡϝϯτΛ࡞Δͷʹඞཁͳཁૉ ͕٧Ίࠐ·Ε͍ͯͯใΛ༷ʑͳܗͰ׆༻Ͱ͖Δ • ΞϓϦͰͷ
Swift-DocC ׆༻ͷՄೳੑ͕͍ͬͯΔ🚀