This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import pathlib | |
| from mkdocs.plugins import BasePlugin | |
| base_path = os.path.dirname(os.path.abspath(__file__)) | |
| custom_dir = os.path.join(base_path, 'custom_dir') | |
| # there are some templates in package's custom_dir we want to use to override theme template | |
| # Approach 1: Simulate https://github.com/mkdocs/mkdocs/blob/82bd8ba5ff177347d094b095bd623a85aaa4c80f/mkdocs/theme.py#L42 | |
| # to update theme dirs at begging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Code from open-telemetry/opentelemetry-python-contrib v30.b1 | |
| # https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py | |
| # Copyright The OpenTelemetry Authors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| def twd_to_wgs(coord_x, coord_y): | |
| # coord_x: TWD97橫座標, 南北緯度, latitude N | |
| # coord_y: TWD97縱座標, 東西經度, longitude E | |
| a = 6378137.0 | |
| b = 6356752.314245 | |
| lon0 = 121 * math.pi / 180 |