from pathlib import Path from PyTeX.build.build import PyTeXBuilder from PyTeX.build.build.build_dir_spec import BuildDirConfig from PyTeX.build.enums import * from PyTeX.build.paths import RelativePath from PyTeX.format.formatting_config import FormattingConfig from PyTeX.format.generic_text import GenericText spec = BuildDirConfig( source_root=Path('src'), tex_root=Path('build/source'), build_root=Path('build'), doc_root=Path('build/doc'), wrapper_dir=Path('mkessler') ) builder = PyTeXBuilder( build_dir_spec=spec ) p: RelativePath = RelativePath(Path('src'), 'src/hello/bla') rel = p.relative_path q = p / 'test' re2 = q.relative_path p2 = RelativePath(Path('doc'), 'build/doc/mkessler/hello/bla') p3 = p / p2 p4 = p.with_name('myname') d1 = { 'a': 1, 'b': 2 } d2 = { 'a': 3, 'c': 4 } d3 = d1 | d2 config: FormattingConfig = FormattingConfig() dump = config.to_json() config.naming_scheme = 'prepend-author' config.extra_header = GenericText(Path('header.txt')) config.extra_header = GenericText(['hello', 'world']) config.dump_as_yaml(Path('test.yaml')) json = config.to_json() config2 = FormattingConfig() config2.set_from_json(json) config3 = FormattingConfig.from_yaml(Path('test.yaml')) pass