timvink / mkdocs-table-reader-plugin

MkDocs plugin that enables a markdown tag like {{ read_csv('table.csv') }} to directly insert various table formats into a page
https://timvink.github.io/mkdocs-table-reader-plugin/
MIT License
129 stars 20 forks source link

MKDocs Search only works in Read_CSV #71

Closed scottsignal closed 2 months ago

scottsignal commented 2 months ago

Hello,

I'm not sure if this is a bug or a limitation how MKDOC works. Was unable to find any more information on it.

I have only tested CSV, JSON, and RAW, however, it seems like CSV is the only format in which the contents are searchable via the MKDOCs Search. JSON and Raw are absent. Is this a bug?

Thanks!

timvink commented 2 months ago

That sounds strange, as these things are totally unrelated. I would need a bit more info.

Can you give me a small, reproducable example (table, markdown file, mkdocs.yml) and some info on your system (OS, python version (python -V), and version of mkdocs and table-reader.

scottsignal commented 2 months ago

That sounds strange, as these things are totally unrelated. I would need a bit more info.

Can you give me a small, reproducable example (table, markdown file, mkdocs.yml) and some info on your system (OS, python version (python -V), and version of mkdocs and table-reader.

Sure, happy to provide. Possible this is just an order of operations issue/conflict with another plugin we are using. I can do some more testing with removing other extensions/plugins temporally and report back.

YAML Config (slightly redacted)

theme:
  name: material
  palette:
    scheme: custom
  features:
    - navigation.tabs
    - toc.integrate
    - navigation.top
    - content.code.copy
    - content.code.annotate
extra_css:
  - assets/extra.css
plugins: 
  - search
  - awesome-pages
  - table-reader
  - markdownextradata
markdown_extensions:
  - attr_list
  - md_in_html
  - pymdownx.critic
  - pymdownx.caret
  - pymdownx.keys 
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.mark
  - pymdownx.tilde
  - pymdownx.superfences
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - admonition
  - pymdownx.details
  - pymdownx.emoji:
      emoji_index: !!python/name:material.extensions.emoji.twemoji
      emoji_generator: !!python/name:material.extensions.emoji.to_svg

The box I am running from is running the following (Note this also occurs on Github pages)

Ubuntu 20.04 MKDocs 1.6.0 Python 3.8.10 TableReader 3.0.1

In my MD file:

{{ read_raw('config.json') }}

-OR-

{{ read_json('config.json') }}

config.json:

{
  "configuration": [
    {
      "category": "Advanced",
      "component": "NetworkModel",
      "defaultvalue": "false",
      "description": "This will determine if the admin is allowed to deploy.",
      "displaytext": "Admin is allowed to deploy",
      "group": "Miscellaneous",
      "isdynamic": true,
      "name": "deploy.anywhere",
      "subgroup": "Others",
      "type": "Boolean",
      "value": "true"
    }
  ]
}

Searching anything (like NetworkModel) in the above JSON file doesn't show up in search results.

That being said, if I create a basic CSV file with some of the information above and do a Read_CSV, these items show up in search just fine. The only difference I see is that Read_CSV is creating a table.

scottsignal commented 2 months ago

Reducing the addons/extentions to just the following results in the same behavior.

theme:
  name: material
  features:
    - navigation.tabs
plugins: 
  - search
  - table-reader
timvink commented 2 months ago

So I created the site, but it's not related to table-reader.

I inserted your config.json directly into markdown (without table reader), and the contents won't show up in search

image

Indeed if you create a table, it's normal content which is searchable.

Please open an issue with mkdocs-material instead.

scottsignal commented 2 months ago

So I created the site, but it's not related to table-reader.

I inserted your config.json directly into markdown (without table reader), and the contents won't show up in search

image

Indeed if you create a table, it's normal content which is searchable.

Please open an issue with mkdocs-material instead.

Ahh, I didn't even think about testing without tablereader. I will take this over to the MKDocs folks. Thanks for your help.