Merge pull request #1420 from spotify/emmaindal/mkdocs-core-monorepo-plugin

techdocs: add mkdocs monorepo plugin to techdocs core plugin
This commit is contained in:
Emma Indal
2020-06-24 12:11:06 +02:00
committed by GitHub
5 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
FROM python:3.7.7-alpine3.12
RUN apk update && apk --no-cache add gcc musl-dev
RUN pip install mkdocs==1.1.2 mkdocs-material==5.3.2
RUN pip install mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5
ADD ./techdocs-core /techdocs-core
RUN pip install --no-index /techdocs-core
@@ -19,6 +19,8 @@ from mkdocs.theme import Theme
from mkdocs.contrib.search import SearchPlugin
from mkdocs_monorepo_plugin.plugin import MonorepoPlugin
class TechDocsCore(BasePlugin):
def on_config(self, config):
@@ -28,6 +30,15 @@ class TechDocsCore(BasePlugin):
# Plugins
del config["plugins"]["techdocs-core"]
search_plugin = SearchPlugin()
search_plugin.load_config({})
monorepo_plugin = MonorepoPlugin()
monorepo_plugin.load_config({})
config["plugins"]["search"] = search_plugin
config["plugins"]["monorepo"] = monorepo_plugin
search_plugin = SearchPlugin()
search_plugin.load_config({})
config["plugins"]["search"] = search_plugin
@@ -2,6 +2,7 @@ site_name: 'mock-docs'
nav:
- Home: index.md
- SubDocs: '!include ./sub-docs/mkdocs.yml'
plugins:
- techdocs-core
@@ -0,0 +1 @@
### This is an md file in another docs folder using the [MkDocs Monorepo Plugin](https://github.com/spotify/mkdocs-monorepo-plugin)
@@ -0,0 +1,4 @@
site_name: subdocs
nav:
- Home 2: "index.md"