Skip to content

Bug Report: Templating and Configuration Flags for Front Matter Are Not Respected #676

Open
@powyncify

Description

@powyncify

Bug Report: Templating and Configuration Flags for Front Matter Are Not Respected

Short Description of the Bug

When attempting to use YARLE's templating features (useTemplate, template string, or useJavaScriptTemplates) to customize the output, the configuration is largely ignored. Specifically, flags intended to create YAML front matter and prevent metadata from being appended to the note footer do not work as expected. YARLE continues to output metadata at the bottom of the note, even when the console confirms it is loading the correct configuration file.

This behavior was observed on both the latest version and the pinned stable version 5.3.0.

Steps to Reproduce

  1. Set up a clean project folder.

  2. Create a package.json file to install a specific, stable version of YARLE:

    {
      "name": "yarle-bug-repro",
      "version": "1.0.0",
      "devDependencies": {
        "yarle-evernote-to-md": "5.3.0"
      }
    }
  3. Create a simple .enex file. For this example, name it test-note.enex. The file should contain a single note with at least one tag (e.g., "Tech") and a source URL.

  4. Create a config.js file with the "All-in-One Template" string. This configuration explicitly defines the entire desired output structure.

    // config.js
    module.exports = {
      enexSources: ["./test-note.enex"],
      outputDir: "./output",
      outputFormat: "ObsidianMD",
      resourcesDir: "_resources",
    
      // Activate the All-in-One Template Below
      isMetadataNeeded: true,
      useTemplate: true,
      
      // Define the entire output file structure
      template: "---\n{created-at-block}created: \"{created-at}\"{end-created-at-block}\n{updated-at-block}updated: \"{updated-at}\"{end-updated-at-block}\n{source-url-block}source: \"{source-url}\"{end-source-url-block}\n{tags-block}tags:\n{tag-list}{end-tags-block}\n---\n\n# {title}\n\n{content}",
    
      // Flags to prevent YARLE from adding its own footers
      appendCreationTime: false,
      appendUpdateTime: false,
      appendSourceUrl: false,
      appendTags: false,
    };
  5. Run the conversion process from the terminal (PowerShell in this case):

    # First, install the specified version
    npm install
    
    # Then, run the conversion with the config file
    npx yarle --configFile ./config.js

Expected Behavior

The script should create a markdown file in the ./output folder with the following structure: all metadata is cleanly formatted in the YAML front matter at the top, and there is no metadata footer at the bottom.

---
created: "2025-07-06T10:00:00+03:00"
updated: "2025-07-06T10:01:00+03:00"
source: "http://example.com/source"
tags:
  - Tech
---

# My Test Note Title

This is the content of the test note.

Actual Behavior

YARLE ignores the template string and the append...: false flags. It confirms that it loads the config file but then produces its default, broken output. The metadata is appended to the bottom of the note.

# My Test Note Title

---
Tag(s): Tech

---

This is the content of the test note.

    Created at: 2025-07-06T10:00:00+03:00
    Updated at: 2025-07-06T10:01:00+03:00
    Source URL http://example.com/source

Environment

  • Operating System: Windows 11
  • Terminal: Windows PowerShell
  • Node.js Version: v22.17.0
  • YARLE Version: Behavior confirmed on latest (as of July 2025) and pinned version 5.3.0.

Additional Context & Workaround

The issue appears to be a fundamental breakdown in how YARLE parses and respects its configuration files, specifically regarding templating logic. The only successful method to achieve the desired output was a two-step process:

  1. Run YARLE with a minimal config to dump the raw data, including the messy footers.
  2. Run a custom Node.js "fixer" script that reads the broken markdown files, parses the metadata from the footer and body, and rebuilds each file with the correct YAML front matter.

This workaround proves that the data is being extracted correctly, but YARLE's internal formatting/templating engine is failing to apply the user's configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions