문서 놀이터 (HTML 및 SWIFT 코드 믹싱)를 생성하는 방법은 무엇입니까?
-
22-12-2019 - |
문제
는 수동으로 수행 할 필요없이 HTML 섹션과 스위프트 코드가 혼합 된 GuidedTour.Playground와 유사한 문서를 생성하는 좋은 방법을 알아 냈습니다.
패키지 인 놀이터 파일의 내용을 탐색 할 수 있으며 HTML / SWIFT 파일과 구조를 설명하는 Contents.xcPlayground XML 파일을 보여줄 수 있지만 사용자 친화적 인 방식으로 하나를 만들 수 있습니다..
해결책 4
버전 6.3 의이 기능은 현재 xcode의 일부입니다.
릴리스에서 인용구 주 :
인라인 마크 업 코멘트, 인라인 놀이터 결과, 놀이터에 포함 된 리소스를보고 편집 할 수있는 기능, 놀이터에서 보조 소스 파일을 통합하는 기능.이러한 기능을 사용하면 놀이터에서 풍부한 새로운 경험을 창출 할 수 있습니다.
다른 팁
현재 '올바른'로 표시된 답변이 쓰는 시점에서 사실 이었지만 실제로이 작업을 수행하는 방법이 있습니다.
- Markdown : Jason Sandmeyer의
swift-playground-builder
는 github에서 "Nofollow"> https://github.com/jas/에서 사용할 수 있습니다.Swift-Playground-Builder 및npm install -g swift-playground-builder
와 함께 설치할 수 있습니다.명령 줄을 가지고 있으면 JavaScript에서 프로그래밍 방식으로 호출 될 수도 있으므로 Gulp에서 호출됩니다 (노드 .js 및 NPM 필요) - asciidoc : James Carlson의
ad2play
는 https://github.com/jxxcarlson/ad2playps/ad2play"hr> ">의 github에서 사용할 수 있습니다.> Ruby Scripipt (Ruby 및 Asciidoctor가 설치되어 있어야 함) 로 실행할 수 있습니다.
윗격이나 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>
.
문서와 스위프트 파일과 폴더 구조는 이와 같아야합니다.
나는 지금까지 자동화 된 워크 플로우 (적어도 공개되지 않음)가 없어야합니다.그러나 왜 당신이 그것을 필요로하는 경우 왜 당신 자신을 만들지 마십시오?
- j 워크 플로우 - 자동화 도구 그어 v ( http://gruntjs.com ) 웹 업계에서 꽤 자주 사용됩니다.
- 스위트 스크립트 / 앱을 작성할 수 있습니다 (d) 사용자 정의 doc-file을 구문 분석 할 수 있습니다 (코드 및 설명서 섹션을 표시하는 데 미리 정의 된 구문으로).
두 가지 방법이 나에게 실현 가능하지만 그 가치가있는 경우 질문은 물론입니다.