mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
33b7d52d31
* moving docs to mkdocs * transfering readme to md and more * fixing build * splitting usage.md * improving schema.md and index.md * fix make_history.rst * models intro * working on data conversation and required fields * more fixes to models.md * list all standard types supported * list of pydantic types * tweaks * update links in code * Apply suggestions from code review incorporate @dmontagu's suggestions. Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com> * Apply suggestions from code review more missed suggestions. Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com> * Apply suggestions from code review more corrects. * cleanup * Field order warning * fix and regenerate benchmarks * format examples better, cleanup * improve schema mapping table * correct highlighting file types in schema.md * add redirects in javascript * add logo
30 lines
938 B
Python
Executable File
30 lines
938 B
Python
Executable File
#!/usr/bin/env python3
|
|
import re
|
|
import sys
|
|
from importlib.machinery import SourceFileLoader
|
|
from pathlib import Path
|
|
|
|
THIS_DIR = Path(__file__).parent
|
|
PROJECT_ROOT = THIS_DIR / '..' / '..'
|
|
|
|
|
|
def main():
|
|
history = (PROJECT_ROOT / 'HISTORY.md').read_text()
|
|
history = re.sub(r'#(\d+)', r'[#\1](https://github.com/samuelcolvin/pydantic/issues/\1)', history)
|
|
history = re.sub(r'( +)@([\w\-]+)', r'\1[@\2](https://github.com/\2)', history, flags=re.I)
|
|
history = re.sub('@@', '@', history)
|
|
|
|
(PROJECT_ROOT / 'docs/.changelog.md').write_text(history)
|
|
|
|
sys.path.append(str(THIS_DIR.resolve()))
|
|
from schema_mapping import build_schema_mappings
|
|
|
|
build_schema_mappings()
|
|
|
|
version = SourceFileLoader('version', str(PROJECT_ROOT / 'pydantic/version.py')).load_module()
|
|
(PROJECT_ROOT / 'docs/.version.md').write_text(f'Documentation for version: **v{version.VERSION}**\n')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|