Files and imports
CLASS
@skmtc/core 0.63.4MarkdownFile
Represents a Markdown file in the SKMTC DSL system.
The Markdown counterpart of JsonFile: a degenerate, non-code file that extends FileBase directly - it holds no definitions, imports or re-exports, because Markdown has no grammar to coordinate. Its content is any Stringable (a string or a composed snippet tree) and toString() renders it verbatim. Written through GenerateContext.registerMarkdown.
Signature
import { MarkdownFile } from '@skmtc/core'
class MarkdownFile extends FileBaseExamples
Example
import { MarkdownFile } from '@skmtc/core';
const doc = new MarkdownFile({
path: '@/docs/GetPet.generated.md',
content: '# Get pet'
});
console.log(doc.toString()); // '# Get pet'Constructor
constructor
constructor(args: MarkdownFileArgs)Creates a new MarkdownFile instance.
args
Markdown file configuration
args.path
The output path for this Markdown file
args.content
The Markdown content to write
Properties
fileType, 'markdown'
The file type, always 'markdown' for Markdown files
The Markdown content to write to the file
Methods
toString
toString(): stringRenders the Markdown content to a string.
Returns
The Markdown content as a string