markdown 필드와 메서드 필드는 값에 관한 단순한 정보로, 대괄호 없이 점으로 읽어요: $value.name. 메서드는 인수를 받거나 작업을 수행하며, ->로 호출하거나 $value->name(arguments)처럼 값을 파이프로 넘겨서 호출해요: $value |> name(arguments).
필드 필드 타입 설명 .extensionstring 점 없이 나타낸 원본 파일 확장자예요. .textstring 감싸진 값의 원본 텍스트예요.
KScript.Document에서 가져옴 이 항목에는 <import package="KScript.Document" />import KScript.Document 가 필요합니다. KScript.Document 를 참고하세요.
문서 소스에서 리터럴이 처음 일치하는 위치의 0부터 시작하는 오프셋이며, 없으면 -1입니다.
예시
.kscript XML 복사
<let name="notes" value="```markdown
# Notes
Some *ideas* for the launch.
```" />
<echo>{ $notes->find('ideas') }</echo>.kscript XML 복사
$notes = ```markdown
# Notes
Some *ideas* for the launch.
```
echo $notes->find('ideas')같은 형식의 텍스트나 원본을 0부터 시작하는 오프셋 위치에 넣은 복사본을 반환해요. 오프셋을 생략하면 끝에 추가해요.
매개변수 받는 값 content 필수 모든 값 at 선택 int
인수는 이름을 붙여 전달할 수 있습니다: ->insert(…, at: …).
예시
.kscript XML 복사
<let name="notes" value="```markdown
# Notes
Some *ideas* for the launch.
```" />
<echo>{ $notes->insert(' More soon.').text }</echo>.kscript XML 복사
$notes = ```markdown
# Notes
Some *ideas* for the launch.
```
echo $notes->insert(' More soon.').textPDF에 있는 페이지 수입니다.
예시
.kscript XML 복사
<let name="notes" value="```markdown
# Notes
Some *ideas* for the launch.
```" />
<echo>{ $notes->pages() } pages</echo>.kscript XML 복사
$notes = ```markdown
# Notes
Some *ideas* for the launch.
```
echo "{ $notes->pages() } pages"# markdown ->replace (search: string , replacement: string ) → markdown KScript.Document 리터럴 일치 항목을 모두 바꾼 복사본을 반환해요.
인수는 이름을 붙여 전달할 수 있습니다: ->replace(…, replacement: …).
예시
.kscript XML 복사
<let name="notes" value="```markdown
# Notes
Some *ideas* for the launch.
```" />
<echo>{ $notes->replace('ideas', 'plans').text }</echo>.kscript XML 복사
$notes = ```markdown
# Notes
Some *ideas* for the launch.
```
echo $notes->replace('ideas', 'plans').text# markdown ->save (path: string , as?: pdf|docx|'latex'|'markdown'|html ) KScript.Document 문서를 파일로 씁니다. 파일 확장자(또는 as:)가 형식을 정합니다: .md는 원본을 그대로 두고, .pdf, .docx, .tex, .html이면 렌더링합니다. 확장자가 없으면 .md입니다.
매개변수 받는 값 path 필수 string as 선택 다음 단어 중 하나: pdf|docx|'latex'|'markdown'|html
인수는 이름을 붙여 전달할 수 있습니다: ->save(…, as: …).
예시
.kscript XML 복사
<let name="notes" value="```markdown
# Notes
Some *ideas* for the launch.
```" />
<do>$notes->save('notes.pdf')</do>
<do>$notes->save('notes.docx')</do>.kscript XML 복사
$notes = ```markdown
# Notes
Some *ideas* for the launch.
```
$notes->save('notes.pdf')
$notes->save('notes.docx')텍스트에 수학 기호와 코드를 제외하고 단어가 몇 개인지 나타냅니다.
예시
.kscript XML 복사
<let name="notes" value="```markdown
# Notes
Some *ideas* for the launch.
```" />
<echo>{ $notes->words() } words</echo>.kscript XML 복사
$notes = ```markdown
# Notes
Some *ideas* for the launch.
```
echo "{ $notes->words() } words"any의 메서드