문서 놀이터 (HTML 및 SWIFT 코드 믹싱)를 생성하는 방법은 무엇입니까?

StackOverflow https://stackoverflow.com//questions/24054852

  •  22-12-2019
  •  | 
  •  

문제

는 수동으로 수행 할 필요없이 HTML 섹션과 스위프트 코드가 혼합 된 GuidedTour.Playground와 유사한 문서를 생성하는 좋은 방법을 알아 냈습니다.

패키지 인 놀이터 파일의 내용을 탐색 할 수 있으며 HTML / SWIFT 파일과 구조를 설명하는 Contents.xcPlayground XML 파일을 보여줄 수 있지만 사용자 친화적 인 방식으로 하나를 만들 수 있습니다..

도움이 되었습니까?

해결책 4

버전 6.3 의이 기능은 현재 xcode의 일부입니다.

릴리스에서 인용구 주 :

인라인 마크 업 코멘트, 인라인 놀이터 결과, 놀이터에 포함 된 리소스를보고 편집 할 수있는 기능, 놀이터에서 보조 소스 파일을 통합하는 기능.이러한 기능을 사용하면 놀이터에서 풍부한 새로운 경험을 창출 할 수 있습니다.

다른 팁

현재 '올바른'로 표시된 답변이 쓰는 시점에서 사실 이었지만 실제로이 작업을 수행하는 방법이 있습니다.

윗격이나 IDE에서 놀이터 폴더를 엽니 다.Swift GeneraCodicicetagcode 태그 전후에 Per documentation 태그를 삽입하는 위치에서 .xcplayground 확장 파일을 .xcplayground 확장 파일을 편집해야합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
    <sections>
        <code source-file-name='section-1.swift' hidden="true" />
        <documentation relative-path='fragment0.html'/>
        <code source-file-name='section-3.swift'/>
        <documentation relative-path='fragment11.html'/>
        <code source-file-name='section-5.swift'/>
        <documentation relative-path='fragment21.html'/>
        <code source-file-name='section-7.swift'/>
        <documentation relative-path='fragment22.html'/>
        <code source-file-name='section-9.swift'/>
        <documentation relative-path='fragment23.html'/>
        <code source-file-name='section-11.swift'/>
        <documentation relative-path='fragment24.html'/>
        <code source-file-name='section-13.swift'/>
        <documentation relative-path='fragment25.html'/>
        <code source-file-name='section-15.swift'/>
        <documentation relative-path='fragment26.html'/>
        <code source-file-name='section-17.swift'/>
        <documentation relative-path='fragment27.html'/>
        <code source-file-name='section-19.swift'/>
        <documentation relative-path='fragment31.html'/>
        <code source-file-name='section-21.swift'/>
        <documentation relative-path='fragment32.html'/>
        <code source-file-name='section-23.swift'/>
        <documentation relative-path='fragment33.html'/>
    </sections>
    <timeline fileName='timeline.xctimeline'/>
</playground>
.

문서와 스위프트 파일과 폴더 구조는 이와 같아야합니다.

폴더 구조

나는 지금까지 자동화 된 워크 플로우 (적어도 공개되지 않음)가 없어야합니다.그러나 왜 당신이 그것을 필요로하는 경우 왜 당신 자신을 만들지 마십시오?

두 가지 방법이 나에게 실현 가능하지만 그 가치가있는 경우 질문은 물론입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top