|
4 | 4 | import subprocess |
5 | 5 | import weasyprint |
6 | 6 |
|
7 | | -import sass |
8 | | - |
9 | 7 | from bs4 import BeautifulSoup |
10 | 8 |
|
11 | 9 | from sphinx import __version__ |
@@ -52,53 +50,6 @@ def __init__(self, *args, **kwargs): |
52 | 50 | } |
53 | 51 | self.app.config.html_context["spd"] = debug_sphinx |
54 | 52 |
|
55 | | - # Generate main.css |
56 | | - logger.info("Generating css files from scss-templates") |
57 | | - css_folder = os.path.join(self.app.outdir, f"_static") |
58 | | - scss_folder = os.path.join( |
59 | | - os.path.dirname(__file__), "..", "themes", "simplepdf_theme", "static", "styles", "sources" |
60 | | - ) |
61 | | - sass.compile( |
62 | | - dirname=(scss_folder, css_folder), |
63 | | - output_style="nested", |
64 | | - custom_functions={ |
65 | | - sass.SassFunction("config", ("$a", "$b"), self.get_config_var), |
66 | | - sass.SassFunction("theme_option", ("$a", "$b"), self.get_theme_option_var), |
67 | | - }, |
68 | | - ) |
69 | | - |
70 | | - def get_config_var(self, name, default): |
71 | | - """ |
72 | | - Gets a config variables for scss out of the Sphinx configuration. |
73 | | - If name is not found in config, the specified default var is returned. |
74 | | -
|
75 | | - Args: |
76 | | - name: Name of the config var to use |
77 | | - default: Default value, if name can not be found in config |
78 | | -
|
79 | | - Returns: Value |
80 | | - """ |
81 | | - simplepdf_vars = self.app.config.simplepdf_vars |
82 | | - if name not in simplepdf_vars: |
83 | | - return default |
84 | | - return simplepdf_vars[name] |
85 | | - |
86 | | - def get_theme_option_var(self, name, default): |
87 | | - """ |
88 | | - Gets a option variables for scss out of the Sphinx theme options. |
89 | | - If name is not found in theme options, the specified default var is returned. |
90 | | -
|
91 | | - Args: |
92 | | - name: Name of the option var to use |
93 | | - default: Default value, if name can not be found in config |
94 | | -
|
95 | | - Returns: Value |
96 | | - """ |
97 | | - simplepdf_theme_options = self.app.config.simplepdf_theme_options |
98 | | - if name not in simplepdf_theme_options: |
99 | | - return default |
100 | | - return simplepdf_theme_options[name] |
101 | | - |
102 | 53 | def finish(self) -> None: |
103 | 54 | super().finish() |
104 | 55 |
|
|
0 commit comments