diff --git a/docs/src/basics/configuration.djot b/docs/src/basics/configuration.dj similarity index 100% rename from docs/src/basics/configuration.djot rename to docs/src/basics/configuration.dj diff --git a/docs/src/basics/deploying.djot b/docs/src/basics/deploying.dj similarity index 100% rename from docs/src/basics/deploying.djot rename to docs/src/basics/deploying.dj diff --git a/docs/src/basics/djockey_command.djot b/docs/src/basics/djockey_command.dj similarity index 100% rename from docs/src/basics/djockey_command.djot rename to docs/src/basics/djockey_command.dj diff --git a/docs/src/basics/djot.djot b/docs/src/basics/djot.dj similarity index 100% rename from docs/src/basics/djot.djot rename to docs/src/basics/djot.dj diff --git a/docs/src/basics/frontmatter.djot b/docs/src/basics/frontmatter.dj similarity index 100% rename from docs/src/basics/frontmatter.djot rename to docs/src/basics/frontmatter.dj diff --git a/docs/src/basics/index.djot b/docs/src/basics/index.dj similarity index 100% rename from docs/src/basics/index.djot rename to docs/src/basics/index.dj diff --git a/docs/src/basics/linking.djot b/docs/src/basics/linking.dj similarity index 80% rename from docs/src/basics/linking.djot rename to docs/src/basics/linking.dj index ab10b87..8df2445 100644 --- a/docs/src/basics/linking.djot +++ b/docs/src/basics/linking.dj @@ -4,7 +4,7 @@ Everything you can do in Markdown, you can also do in Djockey. If you find that ## Extension or no extension, up to you -If you have a doc at `life.djot`, you can link to it with either `[link text](life.djot)` or just `[link text](life)`. +If you have a doc at `life.dj`, you can link to it with either `[link text](life.dj)` or just `[link text](life)`. ## Static files @@ -15,16 +15,16 @@ You can link to static files using relative paths, or absolute paths where the r Let's say you wrote some text you need to refer to in many places across your docs, and gave it a custom identifier: ```djot -{% in /reference/answers/big-questions/life.djot %} +{% in /reference/answers/big-questions/life.dj %} {#the-answer} # The answer to life, the universe, and everything It's 42. ``` -In any other documentation system, you'd need to link to `/reference/answers/big-questions/life#the-answer`{.language-sh}, or use a relative URL like `../../answers/big-questions/life#the-answer`{.language-sh}. But if you move `life.djot`{.language-sh} to another directory, you need to find all those links and update them. +In any other documentation system, you'd need to link to `/reference/answers/big-questions/life#the-answer`{.language-sh}, or use a relative URL like `../../answers/big-questions/life#the-answer`{.language-sh}. But if you move `life.dj`{.language-sh} to another directory, you need to find all those links and update them. -With Djockey, you can link to it anywhere with just `#the-answer`{.language-css}, and Djockey will figure out which doc it lives in. If there are two files containing a heading `#the-answer`{.language-css}, you can use just enough of the path to disambiguate the two, like `life#the-answer`{.language-sh} or `answers/big-questions/life.djot#the-answer`{.language-sh}. +With Djockey, you can link to it anywhere with just `#the-answer`{.language-css}, and Djockey will figure out which doc it lives in. If there are two files containing a heading `#the-answer`{.language-css}, you can use just enough of the path to disambiguate the two, like `life#the-answer`{.language-sh} or `answers/big-questions/life.dj#the-answer`{.language-sh}. The goal of this feature is to make it easier to reorganize your docs on the fly. If there's any ambiguity, Djockey will warn you at build time. diff --git a/docs/src/basics/markup_demo.djot b/docs/src/basics/markup_demo.dj similarity index 100% rename from docs/src/basics/markup_demo.djot rename to docs/src/basics/markup_demo.dj diff --git a/docs/src/basics/sections.dj b/docs/src/basics/sections.dj new file mode 100644 index 0000000..093235c --- /dev/null +++ b/docs/src/basics/sections.dj @@ -0,0 +1,12 @@ +--- +order: 2 +--- +# Sections + +Djockey uses the directory tree to group documents into sections and subsections. + +## `index.dj` + +Put an `index.dj` (or `index.md`) file in any directory to customize its metadata (`title`, `order`) and give the beginning of the section some content. + +If `index.dj` contains front matter but no content, then the section will use the front matter, but no page will be rendered. As an example, see the "Plugins" vs "Writing with Djockey" sections on this site. \ No newline at end of file diff --git a/docs/src/basics/sections.djot b/docs/src/basics/sections.djot deleted file mode 100644 index feede75..0000000 --- a/docs/src/basics/sections.djot +++ /dev/null @@ -1,12 +0,0 @@ ---- -order: 2 ---- -# Sections - -Djockey uses the directory tree to group documents into sections and subsections. - -## `index.djot` - -Put an `index.djot` (or `index.md`) file in any directory to customize its metadata (`title`, `order`) and give the beginning of the section some content. - -If `index.djot` contains front matter but no content, then the section will use the front matter, but no page will be rendered. As an example, see the "Plugins" vs "Writing with Djockey" sections on this site. \ No newline at end of file diff --git a/docs/src/basics/static_files.djot b/docs/src/basics/static_files.dj similarity index 100% rename from docs/src/basics/static_files.djot rename to docs/src/basics/static_files.dj diff --git a/docs/src/contributing/building_and_running.djot b/docs/src/contributing/building_and_running.dj similarity index 100% rename from docs/src/contributing/building_and_running.djot rename to docs/src/contributing/building_and_running.dj diff --git a/docs/src/contributing/client_side_js.djot b/docs/src/contributing/client_side_js.dj similarity index 100% rename from docs/src/contributing/client_side_js.djot rename to docs/src/contributing/client_side_js.dj diff --git a/docs/src/contributing/dependencies.djot b/docs/src/contributing/dependencies.dj similarity index 100% rename from docs/src/contributing/dependencies.djot rename to docs/src/contributing/dependencies.dj diff --git a/docs/src/contributing/index.djot b/docs/src/contributing/index.dj similarity index 100% rename from docs/src/contributing/index.djot rename to docs/src/contributing/index.dj diff --git a/docs/src/features/index.djot b/docs/src/features/index.dj similarity index 100% rename from docs/src/features/index.djot rename to docs/src/features/index.dj diff --git a/docs/src/features/mermaid_diagrams.djot b/docs/src/features/mermaid_diagrams.dj similarity index 100% rename from docs/src/features/mermaid_diagrams.djot rename to docs/src/features/mermaid_diagrams.dj diff --git a/docs/src/features/syntax_highlighting.djot b/docs/src/features/syntax_highlighting.dj similarity index 100% rename from docs/src/features/syntax_highlighting.djot rename to docs/src/features/syntax_highlighting.dj diff --git a/docs/src/getting_started.djot b/docs/src/getting_started.dj similarity index 100% rename from docs/src/getting_started.djot rename to docs/src/getting_started.dj diff --git a/docs/src/index.djot b/docs/src/index.dj similarity index 100% rename from docs/src/index.djot rename to docs/src/index.dj diff --git a/docs/src/installation.djot b/docs/src/installation.dj similarity index 100% rename from docs/src/installation.djot rename to docs/src/installation.dj diff --git a/docs/src/plugins/index.djot b/docs/src/plugins/index.dj similarity index 100% rename from docs/src/plugins/index.djot rename to docs/src/plugins/index.dj diff --git a/docs/src/plugins/plugin_api.djot b/docs/src/plugins/plugin_api.dj similarity index 100% rename from docs/src/plugins/plugin_api.djot rename to docs/src/plugins/plugin_api.dj diff --git a/docs/src/plugins/using_plugins.djot b/docs/src/plugins/using_plugins.dj similarity index 100% rename from docs/src/plugins/using_plugins.djot rename to docs/src/plugins/using_plugins.dj diff --git a/docs/src/why.djot b/docs/src/why.dj similarity index 100% rename from docs/src/why.djot rename to docs/src/why.dj diff --git a/examples/frontmatter.djot b/examples/frontmatter.djot deleted file mode 100644 index 8edf262..0000000 --- a/examples/frontmatter.djot +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Custom Title ---- -# First heading \ No newline at end of file diff --git a/examples/full/.gitignore b/examples/full/.gitignore deleted file mode 100644 index 466e248..0000000 --- a/examples/full/.gitignore +++ /dev/null @@ -1 +0,0 @@ -out/ \ No newline at end of file diff --git a/examples/full/djockey.yaml b/examples/full/djockey.yaml deleted file mode 100644 index c041082..0000000 --- a/examples/full/djockey.yaml +++ /dev/null @@ -1,11 +0,0 @@ -inputDir: docs -outputDir: - html: out/html - gfm: out/gfm -siteName: "Example Site" - -plugins: ["examples/examplePlugin.js"] - -html: - footerText: "©2024 Steve Landey" - linkCSSToInputInsteadOfOutput: true diff --git a/examples/full/docs/crispy.djot b/examples/full/docs/crispy.djot deleted file mode 100644 index c30a3d2..0000000 --- a/examples/full/docs/crispy.djot +++ /dev/null @@ -1 +0,0 @@ -# Crispy \ No newline at end of file diff --git a/examples/full/docs/image.png b/examples/full/docs/image.png deleted file mode 100644 index 284ff52..0000000 Binary files a/examples/full/docs/image.png and /dev/null differ diff --git a/examples/full/docs/index.md b/examples/full/docs/index.md deleted file mode 100644 index 7e52366..0000000 --- a/examples/full/docs/index.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Home ---- - -# Heading 1 - -Here is a [link to the other doc](#second-doc-heading) -[Another link using extension](/second.djot#second-doc-heading) - -![image](image.png) - -## Heading 1.1 - -Content - -### Heading 1.1.1 - -# Heading 2 - -## Heading 2.1 diff --git a/examples/full/docs/layer/inner.djot b/examples/full/docs/layer/inner.djot deleted file mode 100644 index 4d24414..0000000 --- a/examples/full/docs/layer/inner.djot +++ /dev/null @@ -1,3 +0,0 @@ -# Inner heading - -Can I please link to [the same place](#second-doc-heading)? diff --git a/examples/full/docs/layer/layer2/index.djot b/examples/full/docs/layer/layer2/index.djot deleted file mode 100644 index ee3f909..0000000 --- a/examples/full/docs/layer/layer2/index.djot +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Layer Two ---- -# Layer 2: Sacred Ground \ No newline at end of file diff --git a/examples/full/docs/layer/layer2/inner2.djot b/examples/full/docs/layer/layer2/inner2.djot deleted file mode 100644 index c458e13..0000000 --- a/examples/full/docs/layer/layer2/inner2.djot +++ /dev/null @@ -1 +0,0 @@ -# The Innermost Sanctum \ No newline at end of file diff --git a/examples/full/docs/layer/meta.yaml b/examples/full/docs/layer/meta.yaml deleted file mode 100644 index 36f63d7..0000000 --- a/examples/full/docs/layer/meta.yaml +++ /dev/null @@ -1 +0,0 @@ -title: "Title Of Directory" diff --git a/examples/full/docs/second.djot b/examples/full/docs/second.djot deleted file mode 100644 index 4ecca8e..0000000 --- a/examples/full/docs/second.djot +++ /dev/null @@ -1,9 +0,0 @@ -# second doc heading - -Linking [back to top](./index) - -Content - -## Level 2 - -Content \ No newline at end of file diff --git a/examples/full/docs/staticfile.txt b/examples/full/docs/staticfile.txt deleted file mode 100644 index d40f53d..0000000 --- a/examples/full/docs/staticfile.txt +++ /dev/null @@ -1 +0,0 @@ -This file should be copied verbatim. \ No newline at end of file diff --git a/src/input/fileExtensions.ts b/src/input/fileExtensions.ts index debb0e9..2f629a4 100644 --- a/src/input/fileExtensions.ts +++ b/src/input/fileExtensions.ts @@ -3,9 +3,9 @@ import { ALL_INPUT_FORMATS, DjockeyInputFormat } from "../types.js"; export function getExtensionForInputFormat(fmt: DjockeyInputFormat): string[] { switch (fmt) { case "gfm": - return ["md"]; + return ["md", "markdown"]; case "djot": - return ["djot"]; + return ["djot", "dj"]; } } diff --git a/src/plugins/autoTitlePlugin.test.ts b/src/plugins/autoTitlePlugin.test.ts index eb86d10..a765e12 100644 --- a/src/plugins/autoTitlePlugin.test.ts +++ b/src/plugins/autoTitlePlugin.test.ts @@ -21,9 +21,9 @@ test("Title is set to first heading by default", () => { }, title: "Test doc", titleAST: [{ tag: "str", text: "Test doc" }], - originalExtension: ".djot", - absolutePath: "Test Doc.djot", - relativePath: "Test Doc.djot", + originalExtension: ".dj", + absolutePath: "Test Doc.dj", + relativePath: "Test Doc.dj", filename: "Test Doc", frontMatter: {}, data: {}, @@ -34,7 +34,7 @@ test("Title is set to first heading by default", () => { inputDir: ".", rootPath: ".", outputDir: { html: "./dist/html", gfm: "./dist/gfm" }, - fileList: ["Test Doc.djot"], + fileList: ["Test Doc.dj"], urlRoot: "URL_ROOT", inputFormats: { djot: true }, }; @@ -61,9 +61,9 @@ test("Title is set to frontMatter.title if present", () => { }, title: "Test doc", titleAST: [{ tag: "str", text: "Test doc" }], - originalExtension: ".djot", - absolutePath: "Test Doc.djot", - relativePath: "Test Doc.djot", + originalExtension: ".dj", + absolutePath: "Test Doc.dj", + relativePath: "Test Doc.dj", filename: "Test Doc", frontMatter: { title: "Custom title" }, data: {}, @@ -74,7 +74,7 @@ test("Title is set to frontMatter.title if present", () => { inputDir: ".", rootPath: ".", outputDir: { html: "./dist/html", gfm: "./dist/gfm" }, - fileList: ["Test Doc.djot"], + fileList: ["Test Doc.dj"], urlRoot: "URL_ROOT", }; const docSet = new DocSet(config, [new AutoTitlePlugin()], [doc]); diff --git a/src/plugins/tableOfContentsPlugin.test.ts b/src/plugins/tableOfContentsPlugin.test.ts index ffadc1f..193a2d9 100644 --- a/src/plugins/tableOfContentsPlugin.test.ts +++ b/src/plugins/tableOfContentsPlugin.test.ts @@ -23,9 +23,9 @@ test("Generates TOCEntry tree for one doc", () => { }, title: "Test doc", titleAST: [{ tag: "str", text: "Test doc" }], - originalExtension: ".djot", - absolutePath: "Test Doc.djot", - relativePath: "Test Doc.djot", + originalExtension: ".dj", + absolutePath: "Test Doc.dj", + relativePath: "Test Doc.dj", filename: "Test Doc", frontMatter: {}, data: {}, @@ -39,18 +39,18 @@ test("Generates TOCEntry tree for one doc", () => { expect(html).toEqual(`