Link Search Menu Expand Document

Import

Summary

Import markdown files stored locally.

The pod finds all files from the root, and copies over the files into your vault, cleaning the file names to fit dendron's naming hierarchy. You can see an example below.

Example

  • Original
.
└── projects
    ├── p1
    │   ├── one.md
    │   ├── two.md
    │   └── one.pdf
    └── p2
        ├── three.md
        ├── four.md
        └── three.gif
  • After Import
.
└── vault
    ├── assets
    │   ├── one-{uuid}.pdf
    │   └── three-{uuid}.gif
    ├── projects.p1.md
    ├── projects.p1.one.md
    ├── projects.p1.two.md
    ├── projects.p2.md
    ├── projects.p2.three.md
    └── projects.p2.four.md

Non-markdown files within a directory will be moved into the assets folder of your vault. A uuid will be added to non-markdown file names to ensure it does not overwrite any existing files. A link of the original filenames will be made in the note that corresponds to the imported directory

...
# Imported Assets
- [one.pdf](assets/one-c91d4cb3-1db8-4703-884f-c4f5f9a00734.pdf)

Note that all files starting with a . will be ignored during the import.

Configuration

src

  • description: "Where to import from"
  • type: "string" as const
  • required: true

vaultName

  • description: "name of vault to import into"
  • type: "string" as const
  • required: true

concatenate

  • description: "whether to concatenate everything into one note"
  • type: "boolean"
  • default: false

When importing, you can either import everything from source as multiple files or concatenate it all together as one file

frontmatter

  • description: "frontmatter to add to each note"
  • type: "object"

You can add custom frontmatter to notes as you import them. This is useful for example, when you want to set custom publishing options for imported notes

fnameAsId

  • description: "use the file name as the id"
  • type: "boolean"

By default, random uuids are generated as the id for each imported note. This makes the id equivalent to that of the filename

destName

  • description: "If concatenate option is set, this is the name of the destination path
  • type: "string" as const

noAddUUID

  • default: false
  • description: if set, don't append random uuid to asset files

indexName

  • default: none

If set, match the given indexName and combine it with the imported directory. For example, some services like gitbook will use index.md as an index for a directory.

.
└── foo/
    ├── index.md
    ├── one.md
    └── two.md

A naive import into dendron will result in the following files

.
├── foo.index.md
├── foo.one.md
└── foo.two.md

If you set indexName to index (matching is case insensitive and doesn't require the extension), the import will result in the following instead

.
├── foo.md
├── foo.one.md
└── foo.two.md

In this example, the contents of index.md were combined with foo.md

If you are importing from tools like Obsidian that support wiki-links, Dendron will convert those wiki-links to Dendron's dot based format (eg. [[project/p1]] -> [[project.p1]])