File: hatch_build.py

package info (click to toggle)
python-mkdocs 1.6.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,816 kB
  • sloc: python: 14,346; javascript: 10,535; perl: 143; sh: 57; makefile: 30; xml: 11
file content (14 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os

from hatchling.builders.hooks.plugin.interface import BuildHookInterface


class CustomBuildHook(BuildHookInterface):
    def initialize(self, version, build_data):
        from babel.messages.frontend import compile_catalog

        for theme in 'mkdocs', 'readthedocs':
            cmd = compile_catalog()
            cmd.directory = os.path.join('mkdocs', 'themes', theme, 'locales')
            cmd.finalize_options()
            cmd.run()