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
670
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
85
即時通知を導入する際に考えるべきこと
aomathwift
0
6.1k
機能ごとに動作するミニアプリでプレビューサイクルを爆速にした話 After Talk
aomathwift
0
550
機能ごとに動作するミニアプリでプレビューサイクルを爆速にした話
aomathwift
1
11k
Other Decks in Technology
See All in Technology
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
120
飲食店もAIで。レジ締めやハンディシステムをつくってる話 / Using AI for restaurant management
vtryo
0
180
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
130
技術・能力を向上する原理原則 #きのこセッションa #きのこ2026
bash0c7
0
120
螺旋型キャリアの生存戦略 / kinoko-conf2026
rakus_dev
1
980
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.6k
コミットの「なぜ」を読む
ota1022
0
120
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
550
AIチャット検索改善の3週間
kworkdev
PRO
2
170
AIはどのように 組織のアジリティを変えるのか?
junki
4
1.4k
【FinOps】データドリブンな意思決定を目指して
z63d
0
350
ロボティクスの技術 / Robotics Technology
ks91
PRO
0
130
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
220
Accessibility Awareness
sabderemane
1
140
KATA
mclloyd
PRO
35
15k
So, you think you're a good person
axbom
PRO
2
2.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Embracing the Ebb and Flow
colly
88
5.1k
Side Projects
sachag
455
43k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
610
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
370
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
250
GraphQLとの向き合い方2022年版
quramy
50
15k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
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 ׆༻ͷՄೳੑ͕͍ͬͯΔ🚀