MoltenObsidian icon indicating copy to clipboard operation
MoltenObsidian copied to clipboard

Support for import from GitHub Wiki to Obsidian vault

Open SakuraIsayeki opened this issue 6 months ago • 1 comments

Premise

As an Obsidian user, I would like to be able to import and edit my GitHub Wiki into Obsidian, so I can :

  • Import existing assets into standard or Obsidian-flavoured Markdown
  • streamline my existing editing workflow within Obsidian
  • Integrate my GH wiki assets into a MoltenObsiddian-powered website with little effort.

Implementation

  • A new project (name TBD) should be created, to allow programmatically pulling assets from GitHub Wiki areas on selected repositories.
  • A further integration should be added within the CLI Tool, given the low-effort and turnkey possibility of this operation.

Research Notes

  • No GH API exists as of today that allows pulling wiki assets. However, wikis are stored under a separate git repo (https://github.com/{author}/{repository}.wiki.git). This means that the wiki can be cloned as a regular git repository.
  • Wiki pages are stored in Markdown format, and can be edited as such.
  • Wiki structure is flat. All pages are stored in the root of the repository, and there are no subfolders.
  • By convention, wikis use Home.md as equivalent to index note.
  • Most wikis imitate a tree structure by using the _Sidebar.md and _Footer.md files, in which links to other pages are stored. Conventions here differ from one wiki to another, but most of them use relative links to other pages in the wiki. Tree structure can be detected by using the unordered list syntax (- [Page name](link)) in these files, with indents representing subpages.
    • List items with no links are ignored, unless presenting children items, then they are considered as folders.
    • Further handling could also be achieved by parsing the headings (#[#..] Heading Title), which can also be used to create sections of a tree structure.

SakuraIsayeki avatar Jun 07 '25 05:06 SakuraIsayeki

One day, I noticed that data from the raw.githubusercontent.com path could suddenly be fetched without CORS restrictions, so I generated a manifest and ran a test as shown below. I'm not sure why the document link doesn't work.

git clone https://github.com/naratteu/jurassic.wiki
cd jurassic.wiki
moltenobsidian manifest generate . -f

https://raw.githubusercontent.com/wiki/naratteu/jurassic/moltenobsidian.manifest.json

https://github.com/naratteu/MoltenObsidian/commit/461dbe2d43aa2adf9ac4e86989a14081ed8b1bea

naratteu avatar Aug 25 '25 11:08 naratteu