mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

searchable hidden files ?

Open parmentelat opened this issue 2 months ago • 2 comments

files declared as hidden in the toc are part of the global search

it makes it very easy to land on a hidden page, which generally is not the purpose of having them hidden in the first place

Proposal

  1. either not make hidden files part of the search scope
  2. or make it configurable (with default: not searchable)

not quite sure where the setting should go if we decide to go in the yaml tree if we go for 2.

Additional notes

parmentelat avatar Oct 03 '25 14:10 parmentelat

We came across this a lot while teaching, it would be fantastic to control this behavior. Side note: even though technically the source code for the hidden pages was available in the repo, this was never an issue with our students.

For this enhancement I'd like to address it within the toc for each page, or at book level.

I note that individual pages can be hidden (described here, so I'd add the searchable option like this:

version: 1
project:
  toc:
    - file: accessible-from-the-toc.md
    - file: built-but-not-mentioned-in-the-toc.md
      hidden: true
      searchable: false

For the book level "make all hidden pages not searchable"

...
site:
  template: book-theme
  options:
    hidden_files_searchable: false
...

Page level settings override book level settings.

I think default true would be wise, but this is not a strong opinion. My reasoning is that if you are new to JB, maknig a book, searching for something while editing/reviewing, you can find it easier.

rlanzafame avatar Oct 14 '25 12:10 rlanzafame

agreed on all accounts opting out is fine, I hear your argument

parmentelat avatar Oct 15 '25 09:10 parmentelat