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
46 stars 5 forks source link

[feature request] tag filtering in generate_graphdata.js #29

Open hermanhel opened 1 month ago

hermanhel commented 1 month ago

I think we can add some SQL to filter out some tags. This can prevent some nodes from being published, like personal projects, medical/health records and such.

A proposed solution is to

  1. have a list of filtered tags, probably in an json array such as {"tag-filtered":["private"]}, stored in a file in the repo like config.json.
  2. Said array would be read by generate_graphdata.js, and turned into a SQL filter clause to be inserted in a format function call to assemble some SQL query string now exist in generate_graphdata.js. Or else, depend on how tag filtering works in org-roam's sql database schema

Then as following site generation is based on graphdata.json, there should be no appearance of the filtered node whatsoever.

I have forgotten my SQL but I think it will be a quick one. I can work on it but it will be a while before I can make some time up for it.

ikoamu commented 1 month ago

@hermanhel

Hello. This is a wonderful feature! It will allow for uniform management of both private and public nodes, which I believe will be a very useful function for many users.

I also agree with the policy of managing configuration values in JSON. Currently, this project is trying to manage all configuration values through GitHub Actions inputs, but since there are a certain number of users who use local builds (local.sh) to generate sites, we want to make it possible to manage configuration values in the same way whether using GitHub Actions or local builds.

If you can implement it successfully, please don't hesitate to submit a PR. (Of course, you don't need to worry about refactoring the configuration values at this point.)