Home / Function/ getMarkdocTokenizer() — astro Function Reference

getMarkdocTokenizer() — astro Function Reference

Architecture documentation for the getMarkdocTokenizer() function in tokenizer.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  9c49fca1_88d9_b0e9_5e85_9225366da51e["getMarkdocTokenizer()"]
  72ec71bf_7ebc_f58d_ba2e_3a6d4c7522dd["tokenizer.ts"]
  9c49fca1_88d9_b0e9_5e85_9225366da51e -->|defined in| 72ec71bf_7ebc_f58d_ba2e_3a6d4c7522dd
  c0f672fa_fe0f_6e44_4743_b35be217e5e4["cacheKey()"]
  9c49fca1_88d9_b0e9_5e85_9225366da51e -->|calls| c0f672fa_fe0f_6e44_4743_b35be217e5e4
  style 9c49fca1_88d9_b0e9_5e85_9225366da51e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/markdoc/src/tokenizer.ts lines 7–36

export function getMarkdocTokenizer(options: MarkdocIntegrationOptions | undefined): Tokenizer {
	const key = cacheKey(options);

	if (!_cachedMarkdocTokenizers[key]) {
		const tokenizerOptions: TokenizerOptions = {
			// Strip <!-- comments --> from rendered output
			// Without this, they're rendered as strings!
			allowComments: true,
		};

		if (options?.allowHTML) {
			// allow indentation for Markdoc tags that are interleaved inside HTML block elements
			tokenizerOptions.allowIndentation = true;
			// enable HTML token detection in markdown-it
			tokenizerOptions.html = true;
		}
		if (options?.ignoreIndentation) {
			// allow indentation so nested Markdoc tags can be formatted for better readability
			tokenizerOptions.allowIndentation = true;
		}
		if (options?.typographer) {
			// enable typographer to convert straight quotes to curly quotes, etc.
			tokenizerOptions.typographer = options.typographer;
		}

		_cachedMarkdocTokenizers[key] = new Markdoc.Tokenizer(tokenizerOptions);
	}

	return _cachedMarkdocTokenizers[key];
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does getMarkdocTokenizer() do?
getMarkdocTokenizer() is a function in the astro codebase, defined in packages/integrations/markdoc/src/tokenizer.ts.
Where is getMarkdocTokenizer() defined?
getMarkdocTokenizer() is defined in packages/integrations/markdoc/src/tokenizer.ts at line 7.
What does getMarkdocTokenizer() call?
getMarkdocTokenizer() calls 1 function(s): cacheKey.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free