Changes
100 changed files (+262/-200)
-
-
@@ -30,8 +30,8 @@ with:path: ${{ env.DENO_DIR }} key: check-${{ hashFiles('deno.lock') }} - name: Run unit tests run: "deno test --allow-read=. --allow-write=./filesystem_writer/.test" run: "deno test --allow-read=. --allow-write=./internal/filesystem_writer/.test" - name: Lint run: "deno lint" - name: Perform type-check run: "deno check cli.ts" run: "deno check mod.ts cli.ts"
-
-
-
@@ -14,7 +14,7 @@ # What: Temporary directory for testing actual file writer# Why: Although test cleans up the temporary directory, there could be a chance the # cleanup code does not work and the directory (accidentally) remains. # This prevents VCS picking up the directory in that case. filesystem_writer/.test internal/filesystem_writer/.test # What: Docs website build output directory # Why: This directory contains build artifacts, not source code.
-
-
-
@@ -8,24 +8,24 @@ import * as colors from "./deps/deno.land/std/fmt/colors.ts";import * as jsonc from "./deps/deno.land/std/jsonc/mod.ts"; import * as path from "./deps/deno.land/std/path/mod.ts"; import { DenoFsReader } from "./filesystem_reader/deno_fs.ts"; import { DenoFsWriter } from "./filesystem_writer/deno_fs.ts"; import { noOverwrite } from "./filesystem_writer/no_overwrite.ts"; import { precompress as precompressMiddleware } from "./filesystem_writer/precompress.ts"; import { DenoFsReader } from "./internal/filesystem_reader/deno_fs.ts"; import { DenoFsWriter } from "./internal/filesystem_writer/deno_fs.ts"; import { noOverwrite } from "./internal/filesystem_writer/no_overwrite.ts"; import { precompress as precompressMiddleware } from "./internal/filesystem_writer/precompress.ts"; import { DefaultTreeBuilder, fileExtensions, ignoreDotfiles, langDir, removeExtFromMetadata, } from "./tree_builder/default_tree_builder.ts"; import type { ContentParser } from "./content_parser/interface.ts"; import { oneof } from "./content_parser/oneof.ts"; import { ObsidianMarkdownParser } from "./content_parser/obsidian_markdown.ts"; import { JSONCanvasParser } from "./content_parser/json_canvas.ts"; import { DefaultThemeBuilder } from "./page_builder/default_theme/mod.ts"; } from "./internal/tree_builder/default_tree_builder.ts"; import type { ContentParser } from "./internal/content_parser/interface.ts"; import { oneof } from "./internal/content_parser/oneof.ts"; import { ObsidianMarkdownParser } from "./internal/content_parser/obsidian_markdown.ts"; import { JSONCanvasParser } from "./internal/content_parser/json_canvas.ts"; import { DefaultThemeBuilder } from "./internal/page_builder/default_theme/mod.ts"; import * as config from "./cli/config.ts"; import * as config from "./internal/cli/config.ts"; function prettyLogFormatter( useColors: boolean,
-
@@ -458,14 +458,31 @@ return colors.reset(`macana/cli.ts - Generate static website from Obsidian Vault. ${title("Usage")}: deno run --allow-read=<VAULT_PATH>,<CONFIG_PATH> --allow-write=<OUTDIR> macana/cli.ts --config <CONFIG_PATH> deno run --allow-read=.,<CONFIG_PATH> --allow-write=<OUTDIR> macana/cli.ts --config <CONFIG_PATH> deno run --allow-read=<VAULT_PATH> --allow-write=<OUTDIR> macana/cli.ts [OPTIONS] <VAULT_PATH> deno run --allow-read=. --allow-write=<OUTDIR> macana/cli.ts [OPTIONS] <VAULT_PATH> ${title("Arguments")}: VAULT_PATH Path to the Vault directory. This is required if "--config" option is not present. Corresponding config key is ${p("input.path")} (${t("string")}). ${title("Permissions")}: ${b("read")} Macana requires file system read permission for the current directory, ${ b("VAULT_PATH") } and ${b("CONFIG_PATH")} (if ${ b("--config") } option is set). Permission for the current directory is required due to a technical limitation: there is no way to resolve a relative path without accessing CWD in Deno. ${b("write")} Macana requires file system write permission for ${ b("OUTDIR") } in order to write generated website files. ${title("Options")}: -h, --help
-
@@ -595,18 +612,18 @@ ${title("Examples")}:Generate website from Vault located at "./vault/", with config file "./macana.json" then write it under "./out". deno run --allow-read=vault,macana.json --allow-write=out macana/cli.ts ./macana.json deno run --allow-read=.,macana.json --allow-write=out macana/cli.ts ./macana.json Same as the above, but the config file is at "./vault/.macana/config.json". deno run --allow-read=vault --allow-write=out macana/cli.ts ./vault/.macana/config.json deno run --allow-read=. --allow-write=out macana/cli.ts ./vault/.macana/config.json Generate website without using config file. deno run \\ --allow-read=vault --allow-write=out \\ --allow-read=. --allow-write=out \\ macana/cli.ts \\ --out ./out \\ --name "Foo Bar" \\
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import * as path from "../deps/deno.land/std/path/mod.ts"; import * as path from "../../deps/deno.land/std/path/mod.ts"; import * as parser from "./parser.ts";
-
-
-
-
-
@@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { extname } from "../deps/deno.land/std/path/mod.ts"; import type * as Mdast from "../deps/esm.sh/mdast/types.ts"; import { extname } from "../../deps/deno.land/std/path/mod.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import type { ContentParser, ParseParameters } from "./interface.ts"; import type { DocumentContent } from "../types.ts";
-
-
-
-
-
-
@@ -5,7 +5,7 @@import { assertEquals, assertObjectMatch, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsReader } from "../filesystem_reader/memory_fs.ts"; import { ObsidianMarkdownParser } from "./obsidian_markdown.ts";
-
-
-
@@ -2,22 +2,22 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { test as testFrontmatter } from "../deps/deno.land/std/front_matter/test.ts"; import * as yamlFrontmatter from "../deps/deno.land/std/front_matter/yaml.ts"; import type * as Mdast from "../deps/esm.sh/mdast/types.ts"; import { fromMarkdown } from "../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { toString } from "../deps/esm.sh/mdast-util-to-string/mod.ts"; import { headingRange } from "../deps/esm.sh/mdast-util-heading-range/mod.ts"; import { find as findNode } from "../deps/esm.sh/unist-util-find/mod.ts"; import { test as testFrontmatter } from "../../deps/deno.land/std/front_matter/test.ts"; import * as yamlFrontmatter from "../../deps/deno.land/std/front_matter/yaml.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { toString } from "../../deps/esm.sh/mdast-util-to-string/mod.ts"; import { headingRange } from "../../deps/esm.sh/mdast-util-heading-range/mod.ts"; import { find as findNode } from "../../deps/esm.sh/unist-util-find/mod.ts"; import { ofm } from "./obsidian_markdown/micromark_extension_ofm.ts"; import { ofm } from "../../lib/micromark_extension_ofm/mod.ts"; import { type OfmBlockIdentifier, ofmFromMarkdown, } from "./obsidian_markdown/mdast_util_ofm.ts"; } from "../../lib/mdast_util_ofm/mod.ts"; import { macanaMarkAssets } from "./obsidian_markdown/mdast_util_macana_mark_assets.ts"; import { macanaMarkDocumentToken } from "./obsidian_markdown/mdast_util_macana_mark_document_token.ts"; import { autoHeadingIdFromMarkdown } from "./obsidian_markdown/mdast_util_auto_heading_id.ts"; import { autoHeadingIdFromMarkdown } from "../../lib/mdast_util_auto_heading_id/mod.ts"; import { logger } from "../logger.ts";
-
@@ -27,10 +27,6 @@ ContentParseResult,ParseParameters, } from "./interface.ts"; import type { DocumentContent } from "../types.ts"; export { ofmToHastHandlers } from "./obsidian_markdown/mdast_util_ofm.ts"; export { ofmHtml } from "./obsidian_markdown/hast_util_ofm_html.ts"; export type { CalloutType } from "./obsidian_markdown/mdast_util_ofm_callout.ts"; function getFrontMatterBooleanValue( frontmatter: Record<string, unknown>,
-
-
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0import { assertObjectMatch } from "../../deps/deno.land/std/assert/mod.ts"; import { ofmHtml } from "./hast_util_ofm_html.ts"; import { ofmHtml } from "./mod.ts"; Deno.test("Should strip <style>", () => { assertObjectMatch(
-
-
-
content_parser/obsidian_markdown/mdast_util_auto_heading_id.test.ts > lib/mdast_util_auto_heading_id/mod.test.ts
-
@@ -8,10 +8,7 @@ import type * as Mdast from "../../deps/esm.sh/mdast/types.ts";import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { toHast } from "../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { autoHeadingId, autoHeadingIdFromMarkdown, } from "./mdast_util_auto_heading_id.ts"; import { autoHeadingId, autoHeadingIdFromMarkdown } from "./mod.ts"; Deno.test("Should set ID to heading", () => { const hast = toHast(fromMarkdown("# Foo `Bar` Baz", {
-
-
content_parser/obsidian_markdown/mdast_util_auto_heading_id.ts > lib/mdast_util_auto_heading_id/mod.ts
-
content_parser/obsidian_markdown/mdast_util_macana_mark_assets.test.ts > internal/content_parser/obsidian_markdown/mdast_util_macana_mark_assets.test.ts
-
@@ -5,14 +5,14 @@import { assert, assertObjectMatch, } from "../../deps/deno.land/std/assert/mod.ts"; } from "../../../deps/deno.land/std/assert/mod.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { fromMarkdown } from "../../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { macanaMarkAssets } from "./mdast_util_macana_mark_assets.ts"; import { ofmWikilink } from "./micromark_extension_ofm_wikilink.ts"; import { ofmWikilinkFromMarkdown } from "./mdast_util_ofm_wikilink.ts"; import { ofmWikilink } from "../../../lib/micromark_extension_ofm_wikilink/mod.ts"; import { ofmWikilinkFromMarkdown } from "../../../lib/mdast_util_ofm_wikilink/mod.ts"; const getAssetToken = (path: readonly string[]) => `mxa_${path.join("/")}` as const;
-
-
content_parser/obsidian_markdown/mdast_util_macana_mark_assets.ts > internal/content_parser/obsidian_markdown/mdast_util_macana_mark_assets.ts
-
@@ -2,13 +2,13 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { SKIP, visit } from "../../deps/esm.sh/unist-util-visit/mod.ts"; import { definitions } from "../../deps/esm.sh/mdast-util-definitions/mod.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { SKIP, visit } from "../../../deps/esm.sh/unist-util-visit/mod.ts"; import { definitions } from "../../../deps/esm.sh/mdast-util-definitions/mod.ts"; import type { AssetToken } from "../../types.ts"; import type { OfmWikilinkEmbed } from "./mdast_util_ofm_wikilink.ts"; import type { OfmWikilinkEmbed } from "../../../lib/mdast_util_ofm_wikilink/mod.ts"; import type { ParseParameters } from "../interface.ts"; const SEPARATOR = "/";
-
-
content_parser/obsidian_markdown/mdast_util_macana_mark_document_token.test.ts > internal/content_parser/obsidian_markdown/mdast_util_macana_mark_document_token.test.ts
-
@@ -5,14 +5,14 @@import { assert, assertObjectMatch, } from "../../deps/deno.land/std/assert/mod.ts"; } from "../../../deps/deno.land/std/assert/mod.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { fromMarkdown } from "../../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { macanaMarkDocumentToken } from "./mdast_util_macana_mark_document_token.ts"; import { ofmWikilinkFromMarkdown } from "./mdast_util_ofm_wikilink.ts"; import { ofmWikilink } from "./micromark_extension_ofm_wikilink.ts"; import { ofmWikilinkFromMarkdown } from "../../../lib/mdast_util_ofm_wikilink/mod.ts"; import { ofmWikilink } from "../../../lib/micromark_extension_ofm_wikilink/mod.ts"; const getDocumentToken = ( path: readonly string[],
-
-
content_parser/obsidian_markdown/mdast_util_macana_mark_document_token.ts > internal/content_parser/obsidian_markdown/mdast_util_macana_mark_document_token.ts
-
@@ -2,10 +2,10 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { extname } from "../../deps/deno.land/std/path/mod.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { SKIP, visit } from "../../deps/esm.sh/unist-util-visit/mod.ts"; import { definitions } from "../../deps/esm.sh/mdast-util-definitions/mod.ts"; import { extname } from "../../../deps/deno.land/std/path/mod.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { SKIP, visit } from "../../../deps/esm.sh/unist-util-visit/mod.ts"; import { definitions } from "../../../deps/esm.sh/mdast-util-definitions/mod.ts"; import type { ParseParameters } from "../interface.ts"; import type { DocumentToken } from "../../types.ts";
-
@@ -13,7 +13,7 @@import type { OfmWikilink, OfmWikilinkEmbed, } from "./mdast_util_ofm_wikilink.ts"; } from "../../../lib/mdast_util_ofm_wikilink/mod.ts"; const SEPARATOR = "/"; const FRAGMENT_PREFIX = "#";
-
-
-
@@ -11,25 +11,25 @@ ofmBlockIdentifierFromMarkdown,type OfmBlockIdentifierFromMarkdownOptions, ofmBlockIdentifierToHastHandlers, type OfmBlockIdentifierToHastHandlersOptions, } from "./mdast_util_ofm_block_identifier.ts"; } from "../mdast_util_ofm_block_identifier/mod.ts"; import { ofmCommentFromMarkdown, ofmCommentToHastHandlers, type OfmCommentToHastHandlersOptions, } from "./mdast_util_ofm_comment.ts"; import { ofmHighlightFromMarkdown } from "./mdast_util_ofm_highlight.ts"; } from "../mdast_util_ofm_comment/mod.ts"; import { ofmHighlightFromMarkdown } from "../mdast_util_ofm_highlight/mod.ts"; import { ofmWikilinkFromMarkdown, ofmWikilinkToHastHandlers, } from "./mdast_util_ofm_wikilink.ts"; } from "../mdast_util_ofm_wikilink/mod.ts"; import { ofmCalloutFromMarkdown, ofmCalloutToHastHandlers, type OfmCalloutToHastHandlersOptions, } from "./mdast_util_ofm_callout.ts"; import { ofmImageSize } from "./mdast_util_ofm_image_size.ts"; } from "../mdast_util_ofm_callout/mod.ts"; import { ofmImageSize } from "../mdast_util_ofm_image_size/mod.ts"; export type { OfmBlockIdentifier } from "./mdast_util_ofm_block_identifier.ts"; export type { OfmBlockIdentifier } from "../mdast_util_ofm_block_identifier/mod.ts"; export interface OfmFromMarkdownOptions { blockIdentifier?: OfmBlockIdentifierFromMarkdownOptions;
-
-
content_parser/obsidian_markdown/mdast_util_ofm_block_identifier.test.ts > lib/mdast_util_ofm_block_identifier/mod.test.ts
-
@@ -6,8 +6,8 @@ import { assertObjectMatch } from "../../deps/deno.land/std/assert/mod.ts";import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { ofmBlockIdentifierFromMarkdown } from "./mdast_util_ofm_block_identifier.ts"; import { ofmBlockIdentifier } from "./micromark_extension_ofm_block_identifier.ts"; import { ofmBlockIdentifierFromMarkdown } from "./mod.ts"; import { ofmBlockIdentifier } from "../micromark_extension_ofm_block_identifier/mod.ts"; Deno.test("Should hoist ID", () => { const mdast = fromMarkdown("Foo Bar ^Baz", {
-
-
content_parser/obsidian_markdown/mdast_util_ofm_block_identifier.ts > lib/mdast_util_ofm_block_identifier/mod.ts
-
content_parser/obsidian_markdown/mdast_util_ofm_callout.test.ts > lib/mdast_util_ofm_callout/mod.test.ts
-
@@ -6,7 +6,7 @@ import { assertObjectMatch } from "../../deps/deno.land/std/assert/mod.ts";import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { ofmCalloutFromMarkdown } from "./mdast_util_ofm_callout.ts"; import { ofmCalloutFromMarkdown } from "./mod.ts"; Deno.test("Should parse callout", () => { const mdast = fromMarkdown(`> [!info]\n> Block **content**`, {
-
-
-
content_parser/obsidian_markdown/mdast_util_ofm_comment.test.ts > lib/mdast_util_ofm_comment/mod.test.ts
-
@@ -6,8 +6,8 @@ import { assertObjectMatch } from "../../deps/deno.land/std/assert/mod.ts";import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { ofmComment } from "./micromark_extension_ofm_comment.ts"; import { ofmCommentFromMarkdown } from "./mdast_util_ofm_comment.ts"; import { ofmComment } from "../micromark_extension_ofm_comment/mod.ts"; import { ofmCommentFromMarkdown } from "./mod.ts"; Deno.test("Should convert comment into Mdast", () => { const mdast = fromMarkdown("This is an %%inline%% comment.", {
-
-
-
content_parser/obsidian_markdown/mdast_util_ofm_highlight.test.ts > lib/mdast_util_ofm_highlight/mod.test.ts
-
@@ -6,8 +6,8 @@ import { assertObjectMatch } from "../../deps/deno.land/std/assert/mod.ts";import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { ofmHighlight } from "./micromark_extension_ofm_highlight.ts"; import { ofmHighlightFromMarkdown } from "./mdast_util_ofm_highlight.ts"; import { ofmHighlight } from "../micromark_extension_ofm_highlight/mod.ts"; import { ofmHighlightFromMarkdown } from "./mod.ts"; Deno.test("Should parse highlights markdown into Mdast node", () => { const mdast = fromMarkdown("==Hello, World!==", {
-
-
-
content_parser/obsidian_markdown/mdast_util_ofm_image_size.test.ts > lib/mdast_util_ofm_image_size/mod.test.ts
-
@@ -7,10 +7,10 @@import { fromMarkdown } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { toHast } from "../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { ofmWikilink } from "./micromark_extension_ofm_wikilink.ts"; import { ofmWikilinkFromMarkdown } from "./mdast_util_ofm_wikilink.ts"; import { ofmWikilink } from "../micromark_extension_ofm_wikilink/mod.ts"; import { ofmWikilinkFromMarkdown } from "../mdast_util_ofm_wikilink/mod.ts"; import { ofmImageSize } from "./mdast_util_ofm_image_size.ts"; import { ofmImageSize } from "./mod.ts"; Deno.test("Should parse full size attribute", () => { const mdast = fromMarkdown("", {
-
-
content_parser/obsidian_markdown/mdast_util_ofm_image_size.ts > lib/mdast_util_ofm_image_size/mod.ts
-
@@ -6,7 +6,7 @@ import type * as Mdast from "../../deps/esm.sh/mdast/types.ts";import type { Extension } from "../../deps/esm.sh/mdast-util-from-markdown/mod.ts"; import { SKIP, visit } from "../../deps/esm.sh/unist-util-visit/mod.ts"; import type { OfmWikilinkEmbed } from "./mdast_util_ofm_wikilink.ts"; import type { OfmWikilinkEmbed } from "../mdast_util_ofm_wikilink/mod.ts"; const SEPARATOR = "|"; const SIZE_ATTR_REGEXP_PATTERN = /^([1-9][0-9]*)(x([1-9][0-9]*))?$/;
-
-
-
-
@@ -19,19 +19,19 @@import { ofmBlockIdentifier, ofmBlockIdentifierHtml, } from "./micromark_extension_ofm_block_identifier.ts"; } from "../micromark_extension_ofm_block_identifier/mod.ts"; import { ofmComment, ofmCommentHtml, } from "./micromark_extension_ofm_comment.ts"; } from "../micromark_extension_ofm_comment/mod.ts"; import { ofmWikilink, ofmWikilinkHtml, } from "./micromark_extension_ofm_wikilink.ts"; } from "../micromark_extension_ofm_wikilink/mod.ts"; import { ofmHighlight, ofmHighlightHtml, } from "./micromark_extension_ofm_highlight.ts"; } from "../micromark_extension_ofm_highlight/mod.ts"; import type { Extension,
-
-
content_parser/obsidian_markdown/micromark_extension_ofm_block_identifier.test.ts > lib/micromark_extension_ofm_block_identifier/mod.test.ts
-
@@ -5,10 +5,7 @@import { assertEquals } from "../../deps/deno.land/std/assert/mod.ts"; import { micromark } from "../../deps/esm.sh/micromark/mod.ts"; import { ofmBlockIdentifier, ofmBlockIdentifierHtml, } from "./micromark_extension_ofm_block_identifier.ts"; import { ofmBlockIdentifier, ofmBlockIdentifierHtml } from "./mod.ts"; function f(markdown: string): string { return micromark(markdown, {
-
-
content_parser/obsidian_markdown/micromark_extension_ofm_block_identifier.ts > lib/micromark_extension_ofm_block_identifier/mod.ts
-
content_parser/obsidian_markdown/micromark_extension_ofm_comment.test.ts > lib/micromark_extension_ofm_comment/mod.test.ts
-
@@ -10,7 +10,7 @@ import {ofmComment, ofmCommentHtml, type OfmCommentHtmlOptions, } from "./micromark_extension_ofm_comment.ts"; } from "./mod.ts"; function f(markdown: string, opts?: OfmCommentHtmlOptions): string { return micromark(markdown, {
-
-
content_parser/obsidian_markdown/micromark_extension_ofm_comment.ts > lib/micromark_extension_ofm_comment/mod.ts
-
content_parser/obsidian_markdown/micromark_extension_ofm_highlight.test.ts > lib/micromark_extension_ofm_highlight/mod.test.ts
-
@@ -6,10 +6,7 @@ import { assertEquals } from "../../deps/deno.land/std/assert/mod.ts";import { micromark } from "../../deps/esm.sh/micromark/mod.ts"; import { ofmHighlight, ofmHighlightHtml, } from "./micromark_extension_ofm_highlight.ts"; import { ofmHighlight, ofmHighlightHtml } from "./mod.ts"; function f(markdown: string): string { return micromark(markdown, {
-
-
content_parser/obsidian_markdown/micromark_extension_ofm_highlight.ts > lib/micromark_extension_ofm_highlight/mod.ts
-
content_parser/obsidian_markdown/micromark_extension_ofm_wikilink.test.ts > lib/micromark_extension_ofm_wikilink/mod.test.ts
-
@@ -6,10 +6,7 @@ import { assertEquals } from "../../deps/deno.land/std/assert/mod.ts";import { micromark } from "../../deps/esm.sh/micromark/mod.ts"; import { ofmWikilink, ofmWikilinkHtml, } from "./micromark_extension_ofm_wikilink.ts"; import { ofmWikilink, ofmWikilinkHtml } from "./mod.ts"; function f(markdown: string): string { return micromark(markdown, {
-
-
content_parser/obsidian_markdown/micromark_extension_ofm_wikilink.ts > lib/micromark_extension_ofm_wikilink/mod.ts
-
-
@@ -5,7 +5,7 @@import { assertObjectMatch, unreachable, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsReader } from "../filesystem_reader/memory_fs.ts"; import type { AssetToken, DocumentToken } from "../types.ts";
-
-
-
-
@@ -59,7 +59,7 @@The most straightforward way to run the tests is to run this command on the repository root: ``` $ deno test --allow-read=. --allow-write=./filesystem_writer/.test $ deno test --allow-read=. --allow-write=./internal/filesystem_writer/.test ``` - If you omit the `--allow-read=.` permission, tests performing actual file I/O will be skipped.
-
@@ -71,7 +71,7 @@ You can inspect (call-tree, memory, etc) using V8 Inspector Protocol via `--inspect-brk` flag.Read more about the flag [here](https://dotland.deno.dev/manual@v1.33.1/basics/debugging_your_code). ``` $ deno run --inspect-brk --allow-read=docs --allow-write=docs/.dist cli.ts --config docs/.macana/config.jsonc $ deno run --inspect-brk --allow-read=. --allow-write=docs/.dist cli.ts --config docs/.macana/config.jsonc ``` The above command prints Inspector URL to your terminal. Open the URL with a debugger client supporting V8 Inspector Protocol, and hit the record button.
-
-
-
@@ -1,3 +1,6 @@> [!note] > Module endpoint will be changed at v0.2 release. Macana is initially designed as a TypeScript module for Deno. While this is tedious, you can tweak more options compared to the [CLI usage](./CLI).
-
@@ -385,7 +388,7 @@Since all of these are plain simple JavaScript / TypeScript, you can simply run `deno run` with minimum permission flags. ``` $ deno run --allow-read=<YOUR VAULT> --allow-write=<OUTPUT DIR> build.ts $ deno run --allow-read=. --allow-write=<OUTPUT DIR> build.ts ``` If you do not want to type this lengthy command every time you build, define it as a Deno task.
-
@@ -394,7 +397,7 @@ ```jsonc// deno.jsonc { "tasks": { "build": "deno run --allow-read=<YOUR VAULT> --allow-write=<OUTPUT DIR> build.ts" "build": "deno run --allow-read=. --allow-write=<OUTPUT DIR> build.ts" } } ```
-
-
-
@@ -5,7 +5,7 @@import { assertEquals, assertExists, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { DenoFsReader } from "./deno_fs.ts"; import type { DirectoryReader } from "../types.ts";
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { relative, SEPARATOR } from "../deps/deno.land/std/path/mod.ts"; import { relative, SEPARATOR } from "../../deps/deno.land/std/path/mod.ts"; import { logger } from "../logger.ts";
-
-
-
-
@@ -5,7 +5,7 @@import { assertEquals, assertObjectMatch, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsReader } from "./memory_fs.ts"; import type { DirectoryReader, FileReader } from "../types.ts";
-
-
-
-
@@ -5,7 +5,7 @@import { assertEquals, assertRejects, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { DenoFsWriter } from "./deno_fs.ts";
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { dirname, SEPARATOR } from "../deps/deno.land/std/path/mod.ts"; import { dirname, SEPARATOR } from "../../deps/deno.land/std/path/mod.ts"; import { logger } from "../logger.ts";
-
-
-
-
@@ -5,7 +5,7 @@import { assertEquals, assertExists, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsWriter } from "./memory_fs.ts";
-
-
-
-
@@ -6,7 +6,7 @@ import {assertEquals, assertExists, assertRejects, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsWriter } from "./memory_fs.ts"; import { noOverwrite } from "./no_overwrite.ts";
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { encodeHex } from "../deps/deno.land/std/encoding/hex.ts"; import { encodeHex } from "../../deps/deno.land/std/encoding/hex.ts"; import type { FileSystemWriter } from "./interface.ts";
-
-
-
@@ -2,7 +2,10 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { assertExists, assertLess } from "../deps/deno.land/std/assert/mod.ts"; import { assertExists, assertLess, } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsWriter } from "./memory_fs.ts"; import { precompress } from "./precompress.ts";
-
-
-
@@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import * as brotli from "../deps/deno.land/x/brotli/mod.ts"; import * as zstd from "../deps/deno.land/x/zstd_wasm/deno/zstd.ts"; import * as brotli from "../../deps/deno.land/x/brotli/mod.ts"; import * as zstd from "../../deps/deno.land/x/zstd_wasm/deno/zstd.ts"; import type { FileSystemWriter } from "./interface.ts";
-
-
-
@@ -6,7 +6,7 @@ import {assertEquals, assertExists, assertRejects, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsWriter } from "./memory_fs.ts"; import { validateTree } from "./validate_tree.ts";
-
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { getLogger } from "./deps/deno.land/std/log/mod.ts"; import { getLogger } from "../deps/deno.land/std/log/mod.ts"; /** * @internal
-
-
mod.ts (new)
-
@@ -0,0 +1,55 @@// SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // // SPDX-License-Identifier: Apache-2.0 export type { FileSystemReader } from "./internal/filesystem_reader/interface.ts"; export { DenoFsReader } from "./internal/filesystem_reader/deno_fs.ts"; export { MemoryFsReader } from "./internal/filesystem_reader/memory_fs.ts"; export type { FileSystemWriter } from "./internal/filesystem_writer/interface.ts"; export { DenoFsWriter } from "./internal/filesystem_writer/deno_fs.ts"; export { MemoryFsWriter } from "./internal/filesystem_writer/memory_fs.ts"; export { precompress } from "./internal/filesystem_writer/precompress.ts"; export { noOverwrite } from "./internal/filesystem_writer/no_overwrite.ts"; export { validateTree } from "./internal/filesystem_writer/validate_tree.ts"; export type { ContentParser, ContentParseResult, } from "./internal/content_parser/interface.ts"; export { oneof } from "./internal/content_parser/oneof.ts"; export { ObsidianMarkdownParser } from "./internal/content_parser/obsidian_markdown.ts"; export type { ObsidianMarkdownDocument, ObsidianMarkdownParserOptions, } from "./internal/content_parser/obsidian_markdown.ts"; export { InvalidJSONCanvasError, InvalidJSONError, JSONCanvasParseError, JSONCanvasParser, } from "./internal/content_parser/json_canvas.ts"; export type { JSONCanvasDocument } from "./internal/content_parser/json_canvas.ts"; export type { TreeBuilder } from "./internal/tree_builder/interface.ts"; export { defaultDocumentAt, DefaultTreeBuilder, fileExtensions, ignoreDotfiles, langDir, removeExtFromMetadata, } from "./internal/tree_builder/default_tree_builder.ts"; export type { DefaultTreeBuilderConfig, IgnoreFunction, TreeBuildStrategy, TreeBuildStrategyFunctionReturns, } from "./internal/tree_builder/default_tree_builder.ts"; export type { BuildParameters, PageBuilder, } from "./internal/page_builder/interface.ts"; export { DefaultThemeBuilder } from "./internal/page_builder/default_theme/mod.ts"; export type { DefaultThemeBuilderConstructorParameters } from "./internal/page_builder/default_theme/mod.ts";
-
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import * as hCSS from "../../deps/deno.land/x/hyperactive_css/mod.ts"; import * as hCSS from "../../../deps/deno.land/x/hyperactive_css/mod.ts"; export interface Css { readonly chunks: ReadonlySet<string>;
-
-
page_builder/default_theme/from_mdast/callout.tsx > internal/page_builder/default_theme/from_mdast/callout.tsx
-
@@ -4,18 +4,18 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers, type State, } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { type CalloutType, type OfmCallout, parseOfmCalloutNode, } from "../../../content_parser/obsidian_markdown/mdast_util_ofm_callout.ts"; } from "../../../../lib/mdast_util_ofm_callout/mod.ts"; import { buildClasses, css, join } from "../css.ts"; import * as icons from "../icons/lucide.tsx";
-
-
page_builder/default_theme/from_mdast/code.tsx > internal/page_builder/default_theme/from_mdast/code.tsx
-
@@ -4,12 +4,12 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { visit } from "../../../deps/esm.sh/unist-util-visit/mod.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import { refractor } from "../../../deps/esm.sh/refractor/mod.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { visit } from "../../../../deps/esm.sh/unist-util-visit/mod.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import { refractor } from "../../../../deps/esm.sh/refractor/mod.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { buildClasses, css } from "../css.ts";
-
-
page_builder/default_theme/from_mdast/embed.tsx > internal/page_builder/default_theme/from_mdast/embed.tsx
-
@@ -4,13 +4,13 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { extname } from "../../../deps/deno.land/std/path/mod.ts"; import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type State } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { extname } from "../../../../deps/deno.land/std/path/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type State } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { type OfmWikilinkEmbed } from "../../../content_parser/obsidian_markdown/mdast_util_ofm_wikilink.ts"; import { type OfmWikilinkEmbed } from "../../../../lib/mdast_util_ofm_wikilink/mod.ts"; import type { Document } from "../../../types.ts"; import type { BuildContext } from "../context.ts";
-
-
page_builder/default_theme/from_mdast/link.tsx > internal/page_builder/default_theme/from_mdast/link.tsx
-
@@ -4,15 +4,15 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers, type State, } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { type OfmWikilink } from "../../../content_parser/obsidian_markdown/mdast_util_ofm_wikilink.ts"; import { type OfmWikilink } from "../../../../lib/mdast_util_ofm_wikilink/mod.ts"; import { buildClasses, css, join } from "../css.ts"; import * as lucide from "../icons/lucide.tsx";
-
-
page_builder/default_theme/from_mdast/list.tsx > internal/page_builder/default_theme/from_mdast/list.tsx
-
@@ -4,9 +4,9 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { buildClasses, css, join } from "../css.ts"; import * as icons from "../icons/lucide.tsx";
-
-
page_builder/default_theme/from_mdast/math.ts > internal/page_builder/default_theme/from_mdast/math.ts
-
@@ -2,19 +2,19 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { type Raw } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { type Raw } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { type InlineMath, type Math, } from "../../../deps/esm.sh/mdast-util-math/mod.ts"; import temml from "../../../deps/esm.sh/temml/mod.ts"; } from "../../../../deps/esm.sh/mdast-util-math/mod.ts"; import temml from "../../../../deps/esm.sh/temml/mod.ts"; import { type Handlers, type State, } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; export function mathHandlers(): Handlers { return {
-
-
page_builder/default_theme/from_mdast/mod.ts > internal/page_builder/default_theme/from_mdast/mod.ts
-
@@ -2,15 +2,13 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { toHast } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { toHast } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { ofmHtml, ofmToHastHandlers, } from "../../../content_parser/obsidian_markdown.ts"; import { ofmHtml } from "../../../../lib/hast_util_ofm_html/mod.ts"; import { ofmToHastHandlers } from "../../../../lib/mdast_util_ofm/mod.ts"; import { buildClasses, css, join as joinCss } from "../css.ts"; import { type BuildContext } from "../context.ts";
-
-
page_builder/default_theme/from_mdast/paragraph.ts > internal/page_builder/default_theme/from_mdast/paragraph.ts
-
@@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { buildClasses, css } from "../css.ts";
-
-
page_builder/default_theme/from_mdast/quote.tsx > internal/page_builder/default_theme/from_mdast/quote.tsx
-
@@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { type Handlers } from "../../../../deps/esm.sh/mdast-util-to-hast/mod.ts"; import { buildClasses, css } from "../css.ts";
-
-
page_builder/default_theme/from_mdast/utils.ts > internal/page_builder/default_theme/from_mdast/utils.ts
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import type * as Mdast from "../../../../deps/esm.sh/mdast/types.ts"; import type { AssetToken, DocumentToken } from "../../../types.ts";
-
-
-
-
@@ -2,10 +2,10 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { assertObjectMatch } from "../../../deps/deno.land/std/assert/mod.ts"; import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { assertObjectMatch } from "../../deps/deno.land/std/assert/mod.ts"; import { h } from "../../deps/esm.sh/hastscript/mod.ts"; import { tocMut } from "./hast_util_toc_mut.ts"; import { tocMut } from "./mod.ts"; Deno.test("Should build outline tree", () => { const toc = tocMut(h(null, [
-
-
-
@@ -2,11 +2,11 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import { SKIP, visit } from "../../../deps/esm.sh/unist-util-visit/mod.ts"; import { fastUslug } from "../../../deps/esm.sh/@shelf/fast-uslug/mod.ts"; import { isElement } from "../../../deps/esm.sh/hast-util-is-element/mod.ts"; import { toString } from "../../../deps/esm.sh/hast-util-to-string/mod.ts"; import type * as Hast from "../../deps/esm.sh/hast/types.ts"; import { SKIP, visit } from "../../deps/esm.sh/unist-util-visit/mod.ts"; import { fastUslug } from "../../deps/esm.sh/@shelf/fast-uslug/mod.ts"; import { isElement } from "../../deps/esm.sh/hast-util-is-element/mod.ts"; import { toString } from "../../deps/esm.sh/hast-util-to-string/mod.ts"; export interface TocItem<Node = Hast.ElementContent[]> { id: string;
-
-
-
@@ -7,7 +7,7 @@ // See NOTICE file at the project root for its own license./** @jsx s */ import { s } from "../../../deps/esm.sh/hastscript/mod.ts"; import { s } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { buildClasses, css, cx } from "../css.ts";
-
-
page_builder/default_theme/json_canvas/layout.ts > internal/page_builder/default_theme/json_canvas/layout.ts
-
page_builder/default_theme/json_canvas/mod.tsx > internal/page_builder/default_theme/json_canvas/mod.tsx
-
@@ -4,9 +4,9 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx s */ import { extname } from "../../../deps/deno.land/std/path/mod.ts"; import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import { h, s } from "../../../deps/esm.sh/hastscript/mod.ts"; import { extname } from "../../../../deps/deno.land/std/path/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import { h, s } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { logger } from "../../../logger.ts"; import type {
-
-
-
@@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { visit } from "../../../deps/esm.sh/unist-util-visit/mod.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { visit } from "../../deps/esm.sh/unist-util-visit/mod.ts"; /** * This mutates given tree.
-
-
-
@@ -12,11 +12,14 @@ ** @module */ import type * as Hast from "../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../deps/esm.sh/mdast/types.ts"; import { headingRange } from "../../deps/esm.sh/mdast-util-heading-range/mod.ts"; import { toHtml } from "../../deps/esm.sh/hast-util-to-html/mod.ts"; import * as csso from "../../deps/esm.sh/csso/mod.ts"; import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import type * as Mdast from "../../../deps/esm.sh/mdast/types.ts"; import { headingRange } from "../../../deps/esm.sh/mdast-util-heading-range/mod.ts"; import { toHtml } from "../../../deps/esm.sh/hast-util-to-html/mod.ts"; import * as csso from "../../../deps/esm.sh/csso/mod.ts"; import { tocMut } from "../../../lib/hast_util_toc/mod.ts"; import { deleteId } from "../../../lib/mdast_util_delete_id/mod.ts"; import { logger } from "../../logger.ts";
-
@@ -39,9 +42,6 @@import * as css from "./css.ts"; import { globalStyles } from "./global_styles.ts"; import type { Assets, BuildContext } from "./context.ts"; import { tocMut } from "./hast/hast_util_toc_mut.ts"; import { deleteId } from "./mdast/mdast_util_delete_id.ts"; import { fromMdast,
-
-
page_builder/default_theme/pages/index_redirect.tsx > internal/page_builder/default_theme/pages/index_redirect.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; export interface IndexRedirectProps { redirectTo: string;
-
-
page_builder/default_theme/pages/json_canvas.tsx > internal/page_builder/default_theme/pages/json_canvas.tsx
-
@@ -4,8 +4,8 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import type { JSONCanvas } from "../../../content_parser/json_canvas/types.ts";
-
-
page_builder/default_theme/pages/markdown.tsx > internal/page_builder/default_theme/pages/markdown.tsx
-
@@ -4,12 +4,13 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import type * as Hast from "../../../deps/esm.sh/hast/types.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type * as Hast from "../../../../deps/esm.sh/hast/types.ts"; import type { TocItem } from "../../../../lib/hast_util_toc/mod.ts"; import type { BuildContext } from "../context.ts"; import { buildClasses, css, join } from "../css.ts"; import type { TocItem } from "../hast/hast_util_toc_mut.ts"; import { javascript } from "../script.ts"; import { layout, layoutScript, layoutStyles } from "../widgets/layout.tsx";
-
-
page_builder/default_theme/pages/template.tsx > internal/page_builder/default_theme/pages/template.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { type Child, h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type Child, h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type { BuildContext } from "../context.ts";
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { minify_sync } from "../../deps/esm.sh/terser/mod.ts"; import { minify_sync } from "../../../deps/esm.sh/terser/mod.ts"; /** * Tagged template literal function for JavaScript code.
-
-
page_builder/default_theme/widgets/datetime.tsx > internal/page_builder/default_theme/widgets/datetime.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; export const datetimeScript = ` document.querySelectorAll("[data-macana-datetime]").forEach(el => {
-
-
page_builder/default_theme/widgets/document_tree.tsx > internal/page_builder/default_theme/widgets/document_tree.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type { Document, DocumentDirectory } from "../../../types.ts";
-
-
page_builder/default_theme/widgets/footer.tsx > internal/page_builder/default_theme/widgets/footer.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { Child, h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { Child, h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { buildClasses, css } from "../css.ts";
-
-
page_builder/default_theme/widgets/layout.tsx > internal/page_builder/default_theme/widgets/layout.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h, type Result } from "../../../deps/esm.sh/hastscript/mod.ts"; import { h, type Result } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type { BuildContext } from "../context.ts"; import { buildClasses, css, join } from "../css.ts";
-
-
page_builder/default_theme/widgets/page_metadata.tsx > internal/page_builder/default_theme/widgets/page_metadata.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type { BuildContext } from "../context.ts";
-
-
page_builder/default_theme/widgets/title.tsx > internal/page_builder/default_theme/widgets/title.tsx
-
@@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { type Child, h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { type Child, h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import { buildClasses, css } from "../css.ts";
-
-
-
@@ -4,9 +4,10 @@ // SPDX-License-Identifier: Apache-2.0/** @jsx h */ import { h } from "../../../deps/esm.sh/hastscript/mod.ts"; import { h } from "../../../../deps/esm.sh/hastscript/mod.ts"; import type { TocItem } from "../../../../lib/hast_util_toc/mod.ts"; import type { TocItem } from "../hast/hast_util_toc_mut.ts"; import { buildClasses, css, cx } from "../css.ts"; const c = buildClasses("w-toc", ["root", "list", "item", "link"]);
-
-
-
-
@@ -8,7 +8,7 @@ assertNotEquals,assertObjectMatch, assertRejects, unreachable, } from "../deps/deno.land/std/assert/mod.ts"; } from "../../deps/deno.land/std/assert/mod.ts"; import { MemoryFsReader } from "../filesystem_reader/memory_fs.ts"; import type { ContentParser } from "../content_parser/interface.ts";
-
-
-
@@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>// // SPDX-License-Identifier: Apache-2.0 import { extname } from "../deps/deno.land/std/path/mod.ts"; import { extname } from "../../deps/deno.land/std/path/mod.ts"; import { logger } from "../logger.ts";
-
-
-