Enveloppe / obsidian-enveloppe

Enveloppe helps you to publish your notes on a GitHub repository from your Obsidian Vault, for free!
https://enveloppe.github.io/
Apache License 2.0
613 stars 38 forks source link

[FR]: Allow upload of files not natively handled by Obsidian #336

Closed tsievert closed 4 months ago

tsievert commented 4 months ago

Issue validation

Is your feature related to a problem ?

I would like to upload Python files (as an example) with my vault, but there is currently no way to do this.

What solution do you want to see ?

Allow upload of files that are linked inside Obsidian such as

## XZ.1 DLC

script::[[DLC_add_videos.py]]  
[[DLC_extract_frames.py]]

Describe the alternative you've considered

You could manually handle this, but with more than a few files this becomes unmanagable

OS

Windows

Anything else?

No response

Plugin version

7.0.6

Obsidian version & debug log

SYSTEM INFO:
    Obsidian version: v1.5.12
    Installer version: v1.4.13
    Operating system: Windows 10 Pro 10.0.19045
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 25
    Plugins enabled: 25
        1: Editing Toolbar v2.4.16
        2: Find orphaned files and broken links v1.10.0
        3: Hider v1.3.1
        4: Minimal Theme Settings v7.5.0
        5: Plugin Update Tracker v1.5.2
        6: Smart Typography v1.0.18
        7: Tag Wrangler v0.6.1
        8: Webpage HTML Export v1.8.01
        9: Templater v2.2.3
        10: Vault Changelog v0.1.0
        11: LanguageTool Integration v0.3.7
        12: Dataview v0.5.66
        13: Advanced Tables v0.21.0
        14: Various Complements v9.4.0
        15: Natural Language Dates v0.6.2
        16: Awesome Image v0.1.3
        17: Omnisearch v1.22.2
        18: Text Extractor v0.5.1
        19: Badges v1.1.0
        20: Callout Manager v1.0.1
        21: Git v2.24.1
        22: Diagrams v1.5.0
        23: Mononote v1.1.1
        24: Github Publisher v7.0.6
        25: Linter v1.24.0

RECOMMENDATIONS:
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
Mara-Li commented 4 months ago

I worked on a branch for this. I also added for support by sharing file using they links. It's late so it needs more test before merging (ie preventing multiple send of the same fils)

Mara-Li commented 4 months ago

You can try the last beta version 7.1.0-0

tsievert commented 4 months ago

Thanks a lot for the quick implementation!

Unfortunately, I don't get it to work. I've added py and sh as extensions to upload, but with the example above it just causes empty commits ( see https://github.com/LassanceLab/DLC_handbook/commit/b8dd4bb167c00eabd5f57f4b5ecaa89202fd80da).

{
  "github": {
    "branch": "main",
    "automaticallyMergePR": true,
    "dryRun": {
      "enable": false,
      "folderName": "github-publisher"
    },
    "tokenPath": "%configDir%/plugins/%pluginID%/env",
    "api": {
      "tiersForApi": "Github Free/Pro/Team (default)",
      "hostname": ""
    },
    "workflow": {
      "commitMessage": "[PUBLISHER] Merge",
      "name": ""
    },
    "verifiedRepo": true
  },
  "upload": {
    "behavior": "fixed",
    "defaultName": "",
    "rootFolder": "",
    "yamlFolderKey": "",
    "frontmatterTitle": {
      "enable": true,
      "key": "title"
    },
    "replaceTitle": [],
    "replacePath": [],
    "autoclean": {
      "enable": false,
      "excluded": []
    },
    "folderNote": {
      "enable": false,
      "rename": "index.md",
      "addTitle": {
        "enable": false,
        "key": "title"
      }
    },
    "metadataExtractorPath": ""
  },
  "conversion": {
    "hardbreak": true,
    "dataview": true,
    "censorText": [
      {
        "entry": "/---\\n([\\s\\S]*?)\\n---/",
        "replace": "",
        "flags": "",
        "after": false
      },
      {
        "entry": "",
        "replace": "",
        "flags": "",
        "after": false
      }
    ],
    "tags": {
      "inline": false,
      "exclude": [],
      "fields": []
    },
    "links": {
      "internal": true,
      "unshared": true,
      "wiki": true,
      "slugify": "strict"
    }
  },
  "embed": {
    "attachments": true,
    "overrideAttachments": [],
    "keySendFile": [
      "script"
    ],
    "notes": true,
    "folder": "",
    "convertEmbedToLinks": "keep",
    "charConvert": "->",
    "unHandledObsidianExt": [
      "py",
      "sh"
    ],
    "sendSimpleLinks": true,
    "useObsidianFolder": true
  },
  "plugin": {
    "shareKey": "share",
    "excludedFolder": [],
    "copyLink": {
      "enable": false,
      "links": "",
      "removePart": [],
      "transform": {
        "toUri": true,
        "slugify": "lower",
        "applyRegex": []
      }
    },
    "setFrontmatterKey": "Set",
    "shareAll": {
      "enable": true,
      "excludedFileName": "DRAFT"
    }
  }
}
tsievert commented 4 months ago

Oh I found the issue! You need to make a change in the note where the file is linked to force the upload, so does not work on existing links without a change to the note.

Mara-Li commented 4 months ago

It's probably the cache that wasn't updated? It's a bit strange, as I list all links directly using the Obsidian API each time a note is send