Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DocC Documentation Archiveをアプリ開発で活用してみよう / DocC Documentation Archive for iOS Application

aoi
September 28, 2022

DocC Documentation Archiveをアプリ開発で活用してみよう / DocC Documentation Archive for iOS Application

aoi

September 28, 2022
Tweet

More Decks by aoi

Other Decks in Technology

Transcript

  1. ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏ੒΍ΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ΍։ൃ؀ڥͷηοτΞοϓ

    • Utility Ϋϥεͷϝιου΍ϓϩύςΟͷઆ໌ → Documentation Έ͍ͨͳσΟϨΫτϦ഑Լʹஔ͍͍ͯΔ
  2. ΞϓϦʹඞཁͳυΩϡϝϯτ • ϓϩδΣΫτͷߏ੒΍ΞʔΩςΫνϟ • CI / CD ʹ͍ͭͯ • ։ൃϑϩʔ΍։ൃ؀ڥͷηοτΞοϓ

    • Utility Ϋϥεͷϝιου΍ϓϩύςΟͷઆ໌ → ίʔυίϝϯτ = DocC ͷه๏Λར༻
  3. ͜͏͢Δͱ DocC ԽͰ͖Δ • طଘͷ Markdown ϑΝΠϧΛ Documentation Catalog ʹೖΕࠐΉ

    • ಛఆͷϝιου΍Ϋϥεͷઆ໌͸ DocC ίϝϯτΛॻ͖ࠐΉ
  4. 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
  5. { "variants": [ ... ], "schemaVersion": { ... }, "sections":

    [], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
  6. {Target Name}.json • τοϓϖʔδ৘ใʹ͋ͨΔ΋ͷ • topicSections • Classes, Protocols, Structures,

    Variables, … • references • ֤Ϋϥε౳ͷυΩϡϝϯτͷID΍ද໊ࣔ
  7. "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": { ... } }
  8. "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": { ... } }
  9. { "primaryContentSections": [ ... ], "schemaVersion": { ... }, "sections":

    [], "variants": [ ... ], "relationshipsSections": [ ... ], "identifier": { ... }, "topicSections": [ ... ], "kind": "symbol", "metadata": { ... }, "hierarchy": { ... }, "references": { ... } }
  10. ֤ class ౳ͷϑΝΠϧ • topicSections • Initializers, Instance Properties, Instsnce

    Methods… ͳͲ • primaryContentSections • declaration ͳͲ • relationshipsSections • inheritFrom, conformTo, conformingType
  11. "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": { ... } }
  12. "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": { ... } }
  13. "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": { ... } }
  14. relationshipsSections • ґଘؔ܎ʹ͋ΔཁૉΛ ID ͰϦετΞοϓ • ࣗ਎͕ܧঝ͍ͯ͠Δɾ͞Ε͍ͯΔ class • ࣗ਎͕४ڌ͍ͯ͠Δɾ͞Ε͍ͯΔ

    protocol • ผϞδϡʔϧͷ΋ͷ΍ඪ४ϥΠϒϥϦͷ΋ͷ΋ࢀরͰ͖Δ → 💡 ґଘؔ܎ͷՄࢹԽʹ࢖͑ͦ͏
  15. ํ਑ • ు͖ग़͞Εͨ *.doccarchive ʹରͯ͠ҎԼΛ࣮ߦ͢Δ • ֤ json ͷ relationshipsSections

    Ωʔͷ஋Λࢀর͢Δ • identi fi ers Ωʔͷ஋͔Βґଘؔ܎ʹ͋ΔཁૉΛऔಘ͢Δ • type Ωʔͷ஋ΛΈ্ͯهཁૉͱ֘౰ͷཁૉͱͷؔ܎Λൈ͖ग़͢