Let's use pymdownx.snippets for the move

This commit is contained in:
Oleh Prypin
2023-12-09 15:16:38 +01:00
parent f40f3bfe92
commit 9af473c71c
3 changed files with 4 additions and 8 deletions

View File

@@ -22,6 +22,9 @@
// Allow inline HTML
"MD033": false,
// First line heading
"MD041": false,
// Disable named references validation
"MD052": false
}

View File

@@ -0,0 +1 @@
--8<-- "CONTRIBUTING.md"

View File

@@ -4,19 +4,11 @@ import re
from pathlib import Path
from typing import TYPE_CHECKING
from mkdocs.structure.files import File, Files
if TYPE_CHECKING:
from mkdocs.config.defaults import MkDocsConfig
from mkdocs.structure.nav import Page
def on_files(files: Files, config: MkDocsConfig) -> None:
f = File('about/contributing.md', config.docs_dir, config.site_dir, config.use_directory_urls)
f.abs_src_path = str(Path(config.config_file_path).parent.joinpath('CONTRIBUTING.md'))
files.append(f)
def _get_language_of_translation_file(path: Path) -> str:
with path.open(encoding='utf-8') as f:
translation_line = f.readline()