ikoamu / publish-org-roam-ui

Generates a static site for org-roam-ui from org-roam files managed on GitHub. And it is easy to publish to GitHub Pages.
https://ikoamu.github.io/publish-org-roam-ui/
GNU General Public License v3.0
45 stars 4 forks source link

(could not find node) #28

Closed Titikomba closed 2 weeks ago

Titikomba commented 1 month ago

Hi, First of all, thank you very much for developing this :)

I run the script locally. The database has been found and launching index.html reveals the expected structure. Sadly, all the nodes are empty, the message (could not find node) being displayed instead... Could this behaviour be caused by the internal structure of my roam-dir ?

.
├── 01_references
│   ...
│   ├── 20241006163832-ag_l90_basic_local_aligment_search_tool.org
│   └── 20241006164507-kent02_blat_the_blast_like_alignment_tool.org
├── 02_concepts
│   ├── 20240927082424-kmer.org
│   ...
...
├── 06_assets
│   └── yddb15_framework.jpg
└── org-roam.db

Best,

ikoamu commented 1 month ago

@Titikomba Hello. Thank you for creating the issue!

To help resolve this problem, I have two questions:

Thank you.

Titikomba commented 1 month ago

I'm using ./local.sh. Here is the part of my config responsible for this clustering of files

  (org-roam-capture-templates
   '(
     ("r" "reference note" plain (file "~/Documents/01_research/02_notes/05_templates/template_reference.org")
      :if-new (file+head "01_references/%<%Y%m%d%H%M%S>-${slug}.org" "#+Title: ${title}\n")
      :unnarrowed t)
     ("c" "concept" plain (file "~/Documents/01_research/02_notes/05_templates/template_concept.org")
      :if-new (file+head "02_concepts/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
      :unnarrowed t)
     ("a" "argument" plain (file "~/Documents/01_research/02_notes/05_templates/template_argument.org")
      :if-new (file+head "03_arguments/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
      :unnarrowed t)
     ("t" "track" plain (file "~/Documents/01_research/02_notes/05_templates/template_track.org")
      :if-new (file+head "04_tracks/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
      :unnarrowed t)))

Best,

thargosu commented 1 month ago

Hi,

Did you start a web server to access the generated website or are you directly accessing the index with your browser via file:///path/to/index ?

Titikomba commented 1 month ago

Hi, I directly (perhaps naively) opened index.html

Best,

Le 12 oct. 2024 à 13:39, ThArGos @.***> a écrit :

 Hi,

Did you start a web server to access the generated website or are you directly accessing the index with your browser via file:///path/to/index ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

hermanhel commented 1 month ago

I can confirm that my generated website served succesfully on https://hermanhel.codeberg.page/braindump-ui/ have the same behaviour when open locally with file:///path/to/index in firefox. (could not find node)

I tried npx serve, npx http-server, next dev, next start, none worked. npx http-server will crash when index.html is opened, next dev and start failed to run.

edit: The above is done with node version 12 installed with nvm. After I switch back to system which is node 20.13, npx serve worked: on localhost:3000 there is a generated site served, with correct node text and not "(could not find node)"

@Titikomba can you try this way (npx serve in the dir where your index.html resides.)

Titikomba commented 1 month ago

I followed @.hermanhel suggestion, and this indeed create a localhost instance with the roam interface accessible. The (could not find node) does not appear anymore but (no content yet) is here instead...

ikoamu commented 1 month ago

@Titikomba Could you please check two things for investigation?

const fs = require('fs')

// const d3packages = fs.readdirSync('node_modules').filter((name) => name.startsWith('d3-'))
// const withTM = require('next-transpile-modules')(d3packages)
/**
 * @type {import('next').NextConfig}
 */
const nextConfig =  {
  distDir: 'build',
  images: {
    domains: ['localhost'],
    loader: 'custom',
  },
- assetPrefix: './', // delete this line
  output: "export",
  distDir: 'standalone/out/',
}

module.exports = nextConfig
Titikomba commented 1 month ago

@ikoamu It did the job for almost all nodes! Thank you :) Note that I needed to use npx serve as indicated earlier.

I'm responsible for the last ones: my setup is a bit special. I use symlinks for some nodes (I trick org-roam with (setq find-file-visit-truename t)): typically, experiment notes that lie within an experiment folder (with data, scripts, etc). Symlinks to those folders appear in org-roam subfolders. Hence:

Best,

ikoamu commented 2 weeks ago

I apologize. At this point, I cannot think of a solution to handle such a special case. If you have any ideas, please feel free to create an issue. Thank you!