feat(mkdocs) add mkdocs monorepo plugin to techdocs core plugin
This commit is contained in:
@@ -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,14 +19,24 @@ 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):
|
||||
# Theme
|
||||
config["theme"] = Theme(name="material")
|
||||
# Theme
|
||||
config['theme'] = Theme(name="material")
|
||||
|
||||
# Plugins
|
||||
del config["plugins"]["techdocs-core"]
|
||||
# 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({})
|
||||
|
||||
@@ -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 a 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"
|
||||
Reference in New Issue
Block a user