backstage / mkdocs-monorepo-plugin

✚ Build multiple documentation folders in a single Mkdocs. Designed for large codebases.
https://backstage.github.io/mkdocs-monorepo-plugin/
Apache License 2.0
314 stars 75 forks source link

searching on numbers #34

Open avhulzen opened 3 years ago

avhulzen commented 3 years ago

Thank you for creating this plugin.

We are using it to connect multiple MkDocs sites as one big help system for our users.

We want to search on numbers like 2020 or X2GO. So we changed the regular expression for wordCharacters in /usr/local/lib/python3.8/site-packages/mkdocs/contrib/search/lunr-language/lunr.nl.js and /usr/local/lib/python3.8/site-packages/material/assets/javascripts/lunr/min/lunr.nl.min.js to include numbers. This works fine with a single MkDocs site. However when we use it with monorepo this does not work. Can you fix this?

emmaindal commented 3 years ago

Hey @avhulzen thanks for reporting this. Can you give us a little more information around where you changed this? What the configs look like. Thanks!

avhulzen commented 3 years ago

I change to two files with this these commands:

sed -i 's/lunr.nl.wordCharacters = "/lunr.nl.wordCharacters = "0-9/' ${PYTHON_DIR}/site-packages/mkdocs/contrib/search/lunr-language/lunr.nl.js
sed -i 's/r.nl.wordCharacters="/r.nl.wordCharacters="0-9/' ${PYTHON_DIR}/site-packages/material/assets/javascripts/lunr/min/lunr.nl.min.js

The config looks like:

site_name: MySite
site_url: http://localhost:8000 # this value is replaced with the correct value when building with mkdocs 
docs_dir: mysite
use_directory_urls: false

plugins:
  - search:
     lang: ['nl']
     prebuild_index: true
  - monorepo

theme:
  name: material
  palette:
    primary: deep orange
    accent: deep orange
  language: nl
  custom_dir: /v1/custom

markdown_extensions:
  - meta
  - admonition
  - footnotes
  - codehilite:
      guess_lang: false

nav: