Changes
3 changed files (+31/-31)
-
-
@@ -13,7 +13,7 @@ updatedAt: 2024-05-26T18:50:00+09:00- [ ] Standalone executable CLI file - [ ] Style every tags generated by Markdown ## v0.3 ## v0.2 - [ ] Option for OpenGraph attributes - [ ] Custom fonts per language
-
@@ -21,7 +21,7 @@ updatedAt: 2024-05-26T18:50:00+09:00- [ ] Headings down levelling option (render `# Foo` as `<h2>Foo</h2>`) - [ ] 404 page ## v0.2 ## v0.1.2 - [x] CLI for opinionated build - [x] JSON/JSONC config for CLI
-
-
-
@@ -3,7 +3,7 @@ Pass a URL of the script to `deno run` and provide parameters.Use `--help` to see parameters and arguments. ``` $ deno run https://raw.githubusercontent.com/pocka/macana/03fa7ba42ea1d9d23c878a941811da105cebda96/cli.ts --help $ deno run https://deno.land/x/macana@v0.1.2/cli.ts --help ``` The CLI script accepts taking a config JSON/JSONC file via `--config` option.
-
@@ -11,7 +11,7 @@ Most of the generation options are available both as a CLI parameter and configYou need to grant `read` permission for the config JSON/JSONC file. ``` $ deno run --allow-read=.macana.json https://raw.githubusercontent.com/pocka/macana/03fa7ba42ea1d9d23c878a941811da105cebda96/cli.ts --config .macana.json $ deno run --allow-read=.macana.json https://deno.land/x/macana@v0.1.2/cli.ts --config .macana.json ``` See [Config reference](/en/References/Config) for available options. See [Config reference](/en/References/Config) for available options.
-
-
-
@@ -24,19 +24,19 @@ Read the following sections if you're not sure what these lines are doing.```ts // build.ts import { DenoFsReader } from "https://deno.land/x/macana@v0.1.1/filesystem_reader/deno_fs.ts"; import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/deno_fs.ts"; import { DenoFsReader } from "https://deno.land/x/macana@v0.1.2/filesystem_reader/deno_fs.ts"; import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/deno_fs.ts"; import { DefaultTreeBuilder, fileExtensions, ignoreDotfiles, removeExtFromMetadata, defaultDocumentAt, } from "https://deno.land/x/macana@v0.1.1/tree_builder/default_tree_builder.ts"; import { ObsidianMarkdownParser } from "https://deno.land/x/macana@v0.1.1/content_parser/obsidian_markdown.ts"; import { JSONCanvasParser } from "https://deno.land/x/macana@v0.1.1/content_parser/json_canvas.ts"; import { oneof } from "https://deno.land/x/macana@v0.1.1/content_parser/oneof.ts"; import { DefaultThemeBuilder } from "https://deno.land/x/macana@v0.1.1/page_builder/default_theme/mod.ts"; } from "https://deno.land/x/macana@v0.1.2/tree_builder/default_tree_builder.ts"; import { ObsidianMarkdownParser } from "https://deno.land/x/macana@v0.1.2/content_parser/obsidian_markdown.ts"; import { JSONCanvasParser } from "https://deno.land/x/macana@v0.1.2/content_parser/json_canvas.ts"; import { oneof } from "https://deno.land/x/macana@v0.1.2/content_parser/oneof.ts"; import { DefaultThemeBuilder } from "https://deno.land/x/macana@v0.1.2/page_builder/default_theme/mod.ts"; const fileSystemReader = new DenoFsReader(new URL("./contents", import.meta.url));
-
@@ -82,19 +82,19 @@ await pageBuilder.build({> If you prefer code instead of paragraphs... > > ```ts > import { DenoFsReader } from "https://deno.land/x/macana@v0.1.1/filesystem_reader/deno_fs.ts"; > import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/deno_fs.ts"; > import { DenoFsReader } from "https://deno.land/x/macana@v0.1.2/filesystem_reader/deno_fs.ts"; > import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/deno_fs.ts"; > import { > DefaultTreeBuilder, > fileExtensions, > ignoreDotfiles, > removeExtFromMetadata, > defaultDocumentAt, > } from "https://deno.land/x/macana@v0.1.1/tree_builder/default_tree_builder.ts"; > import { ObsidianMarkdownParser } from "https://deno.land/x/macana@v0.1.1/content_parser/obsidian_markdown.ts"; > import { JSONCanvasParser } from "https://deno.land/x/macana@v0.1.1/content_parser/json_canvas.ts"; > import { oneof } from "https://deno.land/x/macana@v0.1.1/content_parser/oneof.ts"; > import { DefaultThemeBuilder } from "https://deno.land/x/macana@v0.1.1/page_builder/default_theme/mod.ts"; > } from "https://deno.land/x/macana@v0.1.2/tree_builder/default_tree_builder.ts"; > import { ObsidianMarkdownParser } from "https://deno.land/x/macana@v0.1.2/content_parser/obsidian_markdown.ts"; > import { JSONCanvasParser } from "https://deno.land/x/macana@v0.1.2/content_parser/json_canvas.ts"; > import { oneof } from "https://deno.land/x/macana@v0.1.2/content_parser/oneof.ts"; > import { DefaultThemeBuilder } from "https://deno.land/x/macana@v0.1.2/page_builder/default_theme/mod.ts"; > > // Treat `contents/` directory as a Vault. > // By resolving from `import.meta.url`, `contents/` directory next to this
-
@@ -197,7 +197,7 @@ Macana uses abstraction layer for file I/O.FileSystem Reader provides listing directory and reading file contents capability. ```ts import { DenoFsReader } from "https://deno.land/x/macana@v0.1.1/filesystem_reader/deno_fs.ts"; import { DenoFsReader } from "https://deno.land/x/macana@v0.1.2/filesystem_reader/deno_fs.ts"; const fileSystemReader = new DenoFsReader(new URL("./contents", import.meta.url));
-
@@ -222,7 +222,7 @@ $ deno run --allow-read=contents build.tsFileSystem Writer provides capability to write to files and create directories. ```ts import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/deno_fs.ts"; import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/deno_fs.ts"; const fileSystemWriter = new DenoFsWriter(new URL("./.dist", import.meta.url));
-
@@ -250,8 +250,8 @@ Macana exports some useful function to wrap the FileSystem Writer for additionalThe resulted file formats are compatible with [Caddy](https://caddyserver.com/)'s [`precompressed`](https://caddyserver.com/docs/caddyfile/directives/file_server#syntax) directive. ```ts import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/deno_fs.ts"; import { precompress } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/precompress.ts"; import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/deno_fs.ts"; import { precompress } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/precompress.ts"; const fileSystemWriter = precompress()( new DenoFsWriter(new URL("./.dist", import.meta.url))
-
@@ -275,8 +275,8 @@ await fileSystemWriter.write(["index.js"], text);In addition to that, if it detects the writes to different content to the same file, it aborts the build in order to prevent producing inconsistent build output. ```ts import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/deno_fs.ts"; import { noOverwrite } from "https://deno.land/x/macana@v0.1.1/filesystem_writer/no_overwrite.ts"; import { DenoFsWriter } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/deno_fs.ts"; import { noOverwrite } from "https://deno.land/x/macana@v0.1.2/filesystem_writer/no_overwrite.ts"; const fileSystemWriter = noOverwrite( new DenoFsWriter(new URL("./.dist", import.meta.url))
-
@@ -301,10 +301,10 @@ In order not to constrain too much on what you can do, Macana does very little bUses filename as a title as-is, first found document as a default document, tries to parse every file as a document, etc. ```ts import { DefaultTreeBuilder } from "https://deno.land/x/macana@v0.1.1/tree_builder/default_tree_builder.ts"; import { ObsidianMarkdownParser } from "https://deno.land/x/macana@v0.1.1/content_parser/obsidian_markdown.ts"; import { JSONCanvasParser } from "https://deno.land/x/macana@v0.1.1/content_parser/json_canvas.ts"; import { oneof } from "https://deno.land/x/macana@v0.1.1/content_parser/oneof.ts"; import { DefaultTreeBuilder } from "https://deno.land/x/macana@v0.1.2/tree_builder/default_tree_builder.ts"; import { ObsidianMarkdownParser } from "https://deno.land/x/macana@v0.1.2/content_parser/obsidian_markdown.ts"; import { JSONCanvasParser } from "https://deno.land/x/macana@v0.1.2/content_parser/json_canvas.ts"; import { oneof } from "https://deno.land/x/macana@v0.1.2/content_parser/oneof.ts"; // This works, but you may (probably) want to tune it further const treeBuilder = new DefaultTreeBuilder({
-
@@ -338,7 +338,7 @@ import {// Use file timestamps as creation/update date // (does not work with Git, though) useFileSystemTimestamps, } from "https://deno.land/x/macana@v0.1.1/tree_builder/default_tree_builder.ts"; } from "https://deno.land/x/macana@v0.1.2/tree_builder/default_tree_builder.ts"; const treeBuilder = new DefaultTreeBuilder({ defaultLanguage: "en",
-
@@ -359,7 +359,7 @@ Page Builder builds HTML and other assets from a document tree.If you don't like how Macana's default theme builder works, write your own. ```ts import { DefaultThemeBuilder } from "https://deno.land/x/macana@v0.1.1/page_builder/default_theme/mod.ts"; import { DefaultThemeBuilder } from "https://deno.land/x/macana@v0.1.2/page_builder/default_theme/mod.ts"; const pageBuilder = new DefaultThemeBuilder({ siteName: "<YOUR WEBSITE TITLE>",
-