This commit is contained in:
OleehyO
2025-04-21 05:05:53 +00:00
commit ee4061b322
162 changed files with 11592 additions and 0 deletions

4
.buildinfo Normal file
View File

@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: cd25d183ca7b8fcfe3287f78547eaaed
tags: 645f666f9bcd5a90fca523b33c5a78b7

0
.nojekyll Normal file
View File

386
_modules/index.html Normal file
View File

@@ -0,0 +1,386 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; TexTeller documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../_static/documentation_options.js?v=9eb32ce0"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=f281be69"></script>
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script src="../_static/design-tabs.js?v=f930bc37"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = '_modules/index';</script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search..."
aria-label="Search..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="../index.html">
<img src="../_static/logo.svg" class="logo__image only-light" alt="TexTeller documentation - Home"/>
<script>document.write(`<img src="../_static/logo.svg" class="logo__image only-dark" alt="TexTeller documentation - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Reference</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-source-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://github.com/OleehyO/TexTeller" target="_blank"
class="btn btn-sm btn-source-repository-button dropdown-item"
title="Source repository"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="btn__text-container">Repository</span>
</a>
</li>
<li><a href="https://github.com/OleehyO/TexTeller/issues/new?title=Issue%20on%20page%20%2F_modules/index.html&body=Your%20issue%20content%20here." target="_blank"
class="btn btn-sm btn-source-issues-button dropdown-item"
title="Open an issue"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="btn__text-container">Open issue</span>
</a>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1></h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<h1>All modules for which code is available</h1>
<ul><li><a href="texteller/api/detection/detect.html">texteller.api.detection.detect</a></li>
<li><a href="texteller/api/inference.html">texteller.api.inference</a></li>
<li><a href="texteller/api/katex.html">texteller.api.katex</a></li>
<li><a href="texteller/api/load.html">texteller.api.load</a></li>
</ul>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
</div>
</footer>
</div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By TexTeller Team
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2025, TexTeller Team.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>

View File

@@ -0,0 +1,454 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../../../../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>texteller.api.detection.detect &#8212; TexTeller documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../../../../_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../../_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../../_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../../_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../../_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="../../../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../../../_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="../../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="../../../../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../../_static/documentation_options.js?v=9eb32ce0"></script>
<script src="../../../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../../../_static/copybutton.js?v=f281be69"></script>
<script src="../../../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script src="../../../../_static/design-tabs.js?v=f930bc37"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = '_modules/texteller/api/detection/detect';</script>
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="../../../../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search..."
aria-label="Search..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="../../../../index.html">
<img src="../../../../_static/logo.svg" class="logo__image only-light" alt="TexTeller documentation - Home"/>
<script>document.write(`<img src="../../../../_static/logo.svg" class="logo__image only-dark" alt="TexTeller documentation - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../../api.html">API Reference</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-source-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://github.com/OleehyO/TexTeller" target="_blank"
class="btn btn-sm btn-source-repository-button dropdown-item"
title="Source repository"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="btn__text-container">Repository</span>
</a>
</li>
<li><a href="https://github.com/OleehyO/TexTeller/issues/new?title=Issue%20on%20page%20%2F_modules/texteller/api/detection/detect.html&body=Your%20issue%20content%20here." target="_blank"
class="btn btn-sm btn-source-issues-button dropdown-item"
title="Open an issue"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="btn__text-container">Open issue</span>
</a>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1></h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<h1>Source code for texteller.api.detection.detect</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">List</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">onnxruntime</span><span class="w"> </span><span class="kn">import</span> <span class="n">InferenceSession</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.types</span><span class="w"> </span><span class="kn">import</span> <span class="n">Bbox</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">.preprocess</span><span class="w"> </span><span class="kn">import</span> <span class="n">Compose</span>
<span class="n">_config</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;mode&quot;</span><span class="p">:</span> <span class="s2">&quot;paddle&quot;</span><span class="p">,</span>
<span class="s2">&quot;draw_threshold&quot;</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">,</span>
<span class="s2">&quot;metric&quot;</span><span class="p">:</span> <span class="s2">&quot;COCO&quot;</span><span class="p">,</span>
<span class="s2">&quot;use_dynamic_shape&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;DETR&quot;</span><span class="p">,</span>
<span class="s2">&quot;min_subgraph_size&quot;</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="s2">&quot;preprocess&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span><span class="s2">&quot;interp&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="s2">&quot;keep_ratio&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">&quot;target_size&quot;</span><span class="p">:</span> <span class="p">[</span><span class="mi">1600</span><span class="p">,</span> <span class="mi">1600</span><span class="p">],</span> <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;Resize&quot;</span><span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;mean&quot;</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span>
<span class="s2">&quot;norm_type&quot;</span><span class="p">:</span> <span class="s2">&quot;none&quot;</span><span class="p">,</span>
<span class="s2">&quot;std&quot;</span><span class="p">:</span> <span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">],</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;NormalizeImage&quot;</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;Permute&quot;</span><span class="p">},</span>
<span class="p">],</span>
<span class="s2">&quot;label_list&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;isolated&quot;</span><span class="p">,</span> <span class="s2">&quot;embedding&quot;</span><span class="p">],</span>
<span class="p">}</span>
<div class="viewcode-block" id="latex_detect">
<a class="viewcode-back" href="../../../../api.html#texteller.api.detection.latex_detect">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">latex_detect</span><span class="p">(</span><span class="n">img_path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">predictor</span><span class="p">:</span> <span class="n">InferenceSession</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Bbox</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Detect LaTeX formulas in an image and classify them as isolated or embedded.</span>
<span class="sd"> This function uses an ONNX model to detect LaTeX formulas in images. The model</span>
<span class="sd"> identifies two types of LaTeX formulas:</span>
<span class="sd"> - &#39;isolated&#39;: Standalone LaTeX formulas (typically displayed equations)</span>
<span class="sd"> - &#39;embedding&#39;: Inline LaTeX formulas embedded within text</span>
<span class="sd"> Args:</span>
<span class="sd"> img_path: Path to the input image file</span>
<span class="sd"> predictor: ONNX InferenceSession model for LaTeX detection</span>
<span class="sd"> Returns:</span>
<span class="sd"> List of Bbox objects representing the detected LaTeX formulas with their</span>
<span class="sd"> positions, classifications, and confidence scores</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller.api import load_latexdet_model, latex_detect</span>
<span class="sd"> &gt;&gt;&gt; model = load_latexdet_model()</span>
<span class="sd"> &gt;&gt;&gt; bboxes = latex_detect(&quot;path/to/image.png&quot;, model)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">transforms</span> <span class="o">=</span> <span class="n">Compose</span><span class="p">(</span><span class="n">_config</span><span class="p">[</span><span class="s2">&quot;preprocess&quot;</span><span class="p">])</span>
<span class="n">inputs</span> <span class="o">=</span> <span class="n">transforms</span><span class="p">(</span><span class="n">img_path</span><span class="p">)</span>
<span class="n">inputs_name</span> <span class="o">=</span> <span class="p">[</span><span class="n">var</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="n">predictor</span><span class="o">.</span><span class="n">get_inputs</span><span class="p">()]</span>
<span class="n">inputs</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">inputs</span><span class="p">[</span><span class="n">k</span><span class="p">][</span><span class="kc">None</span><span class="p">,]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">inputs_name</span><span class="p">}</span>
<span class="n">outputs</span> <span class="o">=</span> <span class="n">predictor</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">output_names</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">input_feed</span><span class="o">=</span><span class="n">inputs</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">res</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">output</span> <span class="ow">in</span> <span class="n">outputs</span><span class="p">:</span>
<span class="n">cls_name</span> <span class="o">=</span> <span class="n">_config</span><span class="p">[</span><span class="s2">&quot;label_list&quot;</span><span class="p">][</span><span class="nb">int</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="mi">0</span><span class="p">])]</span>
<span class="n">score</span> <span class="o">=</span> <span class="n">output</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="n">xmin</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="mi">0</span><span class="p">))</span>
<span class="n">ymin</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="mi">0</span><span class="p">))</span>
<span class="n">xmax</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span>
<span class="n">ymax</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="mi">5</span><span class="p">])</span>
<span class="k">if</span> <span class="n">score</span> <span class="o">&gt;</span> <span class="mf">0.5</span><span class="p">:</span>
<span class="n">res</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Bbox</span><span class="p">(</span><span class="n">xmin</span><span class="p">,</span> <span class="n">ymin</span><span class="p">,</span> <span class="n">ymax</span> <span class="o">-</span> <span class="n">ymin</span><span class="p">,</span> <span class="n">xmax</span> <span class="o">-</span> <span class="n">xmin</span><span class="p">,</span> <span class="n">cls_name</span><span class="p">,</span> <span class="n">score</span><span class="p">))</span>
<span class="k">return</span> <span class="n">res</span></div>
</pre></div>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
</div>
</footer>
</div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By TexTeller Team
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2025, TexTeller Team.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>

View File

@@ -0,0 +1,669 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../../../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>texteller.api.inference &#8212; TexTeller documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../../../_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="../../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../../_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="../../../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../_static/documentation_options.js?v=9eb32ce0"></script>
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../../_static/copybutton.js?v=f281be69"></script>
<script src="../../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script src="../../../_static/design-tabs.js?v=f930bc37"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = '_modules/texteller/api/inference';</script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="../../../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search..."
aria-label="Search..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="../../../index.html">
<img src="../../../_static/logo.svg" class="logo__image only-light" alt="TexTeller documentation - Home"/>
<script>document.write(`<img src="../../../_static/logo.svg" class="logo__image only-dark" alt="TexTeller documentation - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../api.html">API Reference</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-source-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://github.com/OleehyO/TexTeller" target="_blank"
class="btn btn-sm btn-source-repository-button dropdown-item"
title="Source repository"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="btn__text-container">Repository</span>
</a>
</li>
<li><a href="https://github.com/OleehyO/TexTeller/issues/new?title=Issue%20on%20page%20%2F_modules/texteller/api/inference.html&body=Your%20issue%20content%20here." target="_blank"
class="btn btn-sm btn-source-issues-button dropdown-item"
title="Open an issue"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="btn__text-container">Open issue</span>
</a>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1></h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<h1>Source code for texteller.api.inference</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span><span class="w"> </span><span class="nn">re</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">time</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">collections</span><span class="w"> </span><span class="kn">import</span> <span class="n">Counter</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">Literal</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">cv2</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">numpy</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nn">np</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">torch</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">onnxruntime</span><span class="w"> </span><span class="kn">import</span> <span class="n">InferenceSession</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">optimum.onnxruntime</span><span class="w"> </span><span class="kn">import</span> <span class="n">ORTModelForVision2Seq</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">transformers</span><span class="w"> </span><span class="kn">import</span> <span class="n">GenerationConfig</span><span class="p">,</span> <span class="n">RobertaTokenizerFast</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.constants</span><span class="w"> </span><span class="kn">import</span> <span class="n">MAX_TOKEN_SIZE</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.logger</span><span class="w"> </span><span class="kn">import</span> <span class="n">get_logger</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.paddleocr</span><span class="w"> </span><span class="kn">import</span> <span class="n">predict_det</span><span class="p">,</span> <span class="n">predict_rec</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.types</span><span class="w"> </span><span class="kn">import</span> <span class="n">Bbox</span><span class="p">,</span> <span class="n">TexTellerModel</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.utils</span><span class="w"> </span><span class="kn">import</span> <span class="p">(</span>
<span class="n">bbox_merge</span><span class="p">,</span>
<span class="n">get_device</span><span class="p">,</span>
<span class="n">mask_img</span><span class="p">,</span>
<span class="n">readimgs</span><span class="p">,</span>
<span class="n">remove_style</span><span class="p">,</span>
<span class="n">slice_from_image</span><span class="p">,</span>
<span class="n">split_conflict</span><span class="p">,</span>
<span class="n">transform</span><span class="p">,</span>
<span class="n">add_newlines</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">.detection</span><span class="w"> </span><span class="kn">import</span> <span class="n">latex_detect</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">.format</span><span class="w"> </span><span class="kn">import</span> <span class="n">format_latex</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">.katex</span><span class="w"> </span><span class="kn">import</span> <span class="n">to_katex</span>
<span class="n">_logger</span> <span class="o">=</span> <span class="n">get_logger</span><span class="p">()</span>
<div class="viewcode-block" id="img2latex">
<a class="viewcode-back" href="../../../api.html#texteller.api.img2latex">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">img2latex</span><span class="p">(</span>
<span class="n">model</span><span class="p">:</span> <span class="n">TexTellerModel</span><span class="p">,</span>
<span class="n">tokenizer</span><span class="p">:</span> <span class="n">RobertaTokenizerFast</span><span class="p">,</span>
<span class="n">images</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="nb">list</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">],</span>
<span class="n">device</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">device</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">out_format</span><span class="p">:</span> <span class="n">Literal</span><span class="p">[</span><span class="s2">&quot;latex&quot;</span><span class="p">,</span> <span class="s2">&quot;katex&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;latex&quot;</span><span class="p">,</span>
<span class="n">keep_style</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">max_tokens</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">MAX_TOKEN_SIZE</span><span class="p">,</span>
<span class="n">num_beams</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
<span class="n">no_repeat_ngram_size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Convert images to LaTeX or KaTeX formatted strings.</span>
<span class="sd"> Args:</span>
<span class="sd"> model: The TexTeller or ORTModelForVision2Seq model instance</span>
<span class="sd"> tokenizer: The tokenizer for the model</span>
<span class="sd"> images: List of image paths or numpy arrays (RGB format)</span>
<span class="sd"> device: The torch device to use (defaults to available GPU or CPU)</span>
<span class="sd"> out_format: Output format, either &quot;latex&quot; or &quot;katex&quot;</span>
<span class="sd"> keep_style: Whether to keep the style of the LaTeX</span>
<span class="sd"> max_tokens: Maximum number of tokens to generate</span>
<span class="sd"> num_beams: Number of beams for beam search</span>
<span class="sd"> no_repeat_ngram_size: Size of n-grams to prevent repetition</span>
<span class="sd"> Returns:</span>
<span class="sd"> List of LaTeX or KaTeX strings corresponding to each input image</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; import torch</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_model, load_tokenizer, img2latex</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; model = load_model(model_path=None, use_onnx=False)</span>
<span class="sd"> &gt;&gt;&gt; tokenizer = load_tokenizer(tokenizer_path=None)</span>
<span class="sd"> &gt;&gt;&gt; device = torch.device(&quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;)</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; res = img2latex(model, tokenizer, [&quot;path/to/image.png&quot;], device=device, out_format=&quot;katex&quot;)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">images</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span>
<span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">images</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span>
<span class="k">if</span> <span class="n">device</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">device</span> <span class="o">=</span> <span class="n">get_device</span><span class="p">()</span>
<span class="k">if</span> <span class="n">device</span><span class="o">.</span><span class="n">type</span> <span class="o">!=</span> <span class="n">model</span><span class="o">.</span><span class="n">device</span><span class="o">.</span><span class="n">type</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">ORTModelForVision2Seq</span><span class="p">):</span>
<span class="n">_logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Onnxruntime device mismatch: detected </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="n">device</span><span class="p">)</span><span class="si">}</span><span class="s2"> but model is on </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">device</span><span class="p">)</span><span class="si">}</span><span class="s2">, using </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">device</span><span class="p">)</span><span class="si">}</span><span class="s2"> instead&quot;</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">model</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">to</span><span class="p">(</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">images</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">images</span> <span class="o">=</span> <span class="n">readimgs</span><span class="p">(</span><span class="n">images</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span> <span class="c1"># already numpy array(rgb format)</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">images</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)</span>
<span class="n">images</span> <span class="o">=</span> <span class="n">images</span>
<span class="n">images</span> <span class="o">=</span> <span class="n">transform</span><span class="p">(</span><span class="n">images</span><span class="p">)</span>
<span class="n">pixel_values</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">stack</span><span class="p">(</span><span class="n">images</span><span class="p">)</span>
<span class="n">generate_config</span> <span class="o">=</span> <span class="n">GenerationConfig</span><span class="p">(</span>
<span class="n">max_new_tokens</span><span class="o">=</span><span class="n">max_tokens</span><span class="p">,</span>
<span class="n">num_beams</span><span class="o">=</span><span class="n">num_beams</span><span class="p">,</span>
<span class="n">do_sample</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">pad_token_id</span><span class="o">=</span><span class="n">tokenizer</span><span class="o">.</span><span class="n">pad_token_id</span><span class="p">,</span>
<span class="n">eos_token_id</span><span class="o">=</span><span class="n">tokenizer</span><span class="o">.</span><span class="n">eos_token_id</span><span class="p">,</span>
<span class="n">bos_token_id</span><span class="o">=</span><span class="n">tokenizer</span><span class="o">.</span><span class="n">bos_token_id</span><span class="p">,</span>
<span class="n">no_repeat_ngram_size</span><span class="o">=</span><span class="n">no_repeat_ngram_size</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">pred</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span>
<span class="n">pixel_values</span><span class="o">.</span><span class="n">to</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">device</span><span class="p">),</span>
<span class="n">generation_config</span><span class="o">=</span><span class="n">generate_config</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">tokenizer</span><span class="o">.</span><span class="n">batch_decode</span><span class="p">(</span><span class="n">pred</span><span class="p">,</span> <span class="n">skip_special_tokens</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="n">out_format</span> <span class="o">==</span> <span class="s2">&quot;katex&quot;</span><span class="p">:</span>
<span class="n">res</span> <span class="o">=</span> <span class="p">[</span><span class="n">to_katex</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res</span><span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">keep_style</span><span class="p">:</span>
<span class="n">res</span> <span class="o">=</span> <span class="p">[</span><span class="n">remove_style</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res</span><span class="p">]</span>
<span class="n">res</span> <span class="o">=</span> <span class="p">[</span><span class="n">format_latex</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res</span><span class="p">]</span>
<span class="n">res</span> <span class="o">=</span> <span class="p">[</span><span class="n">add_newlines</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res</span><span class="p">]</span>
<span class="k">return</span> <span class="n">res</span></div>
<div class="viewcode-block" id="paragraph2md">
<a class="viewcode-back" href="../../../api.html#texteller.api.paragraph2md">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">paragraph2md</span><span class="p">(</span>
<span class="n">img_path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">latexdet_model</span><span class="p">:</span> <span class="n">InferenceSession</span><span class="p">,</span>
<span class="n">textdet_model</span><span class="p">:</span> <span class="n">predict_det</span><span class="o">.</span><span class="n">TextDetector</span><span class="p">,</span>
<span class="n">textrec_model</span><span class="p">:</span> <span class="n">predict_rec</span><span class="o">.</span><span class="n">TextRecognizer</span><span class="p">,</span>
<span class="n">latexrec_model</span><span class="p">:</span> <span class="n">TexTellerModel</span><span class="p">,</span>
<span class="n">tokenizer</span><span class="p">:</span> <span class="n">RobertaTokenizerFast</span><span class="p">,</span>
<span class="n">device</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">device</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">num_beams</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Convert an image containing both text and mathematical formulas to markdown format.</span>
<span class="sd"> This function processes a mixed-content image by:</span>
<span class="sd"> 1. Detecting mathematical formulas using a latex detection model</span>
<span class="sd"> 2. Masking detected formula areas and detecting text regions using OCR</span>
<span class="sd"> 3. Recognizing text in the detected regions</span>
<span class="sd"> 4. Converting formula regions to LaTeX using the latex recognition model</span>
<span class="sd"> 5. Combining all detected elements into a properly formatted markdown string</span>
<span class="sd"> Args:</span>
<span class="sd"> img_path: Path to the input image containing text and formulas</span>
<span class="sd"> latexdet_model: ONNX InferenceSession for LaTeX formula detection</span>
<span class="sd"> textdet_model: OCR text detector model</span>
<span class="sd"> textrec_model: OCR text recognition model</span>
<span class="sd"> latexrec_model: TexTeller model for LaTeX formula recognition</span>
<span class="sd"> tokenizer: Tokenizer for the LaTeX recognition model</span>
<span class="sd"> device: The torch device to use (defaults to available GPU or CPU)</span>
<span class="sd"> num_beams: Number of beams for beam search during LaTeX generation</span>
<span class="sd"> Returns:</span>
<span class="sd"> Markdown formatted string containing the recognized text and formulas</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_latexdet_model, load_textdet_model, load_textrec_model, load_tokenizer, paragraph2md</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; # Load all required models</span>
<span class="sd"> &gt;&gt;&gt; latexdet_model = load_latexdet_model()</span>
<span class="sd"> &gt;&gt;&gt; textdet_model = load_textdet_model()</span>
<span class="sd"> &gt;&gt;&gt; textrec_model = load_textrec_model()</span>
<span class="sd"> &gt;&gt;&gt; latexrec_model = load_model()</span>
<span class="sd"> &gt;&gt;&gt; tokenizer = load_tokenizer()</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; # Convert image to markdown</span>
<span class="sd"> &gt;&gt;&gt; markdown_text = paragraph2md(</span>
<span class="sd"> ... img_path=&quot;path/to/mixed_content_image.jpg&quot;,</span>
<span class="sd"> ... latexdet_model=latexdet_model,</span>
<span class="sd"> ... textdet_model=textdet_model,</span>
<span class="sd"> ... textrec_model=textrec_model,</span>
<span class="sd"> ... latexrec_model=latexrec_model,</span>
<span class="sd"> ... tokenizer=tokenizer,</span>
<span class="sd"> ... )</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">img</span> <span class="o">=</span> <span class="n">cv2</span><span class="o">.</span><span class="n">imread</span><span class="p">(</span><span class="n">img_path</span><span class="p">)</span>
<span class="n">corners</span> <span class="o">=</span> <span class="p">[</span><span class="nb">tuple</span><span class="p">(</span><span class="n">img</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]),</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">img</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">]),</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">img</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]),</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">img</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">])]</span>
<span class="n">bg_color</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">Counter</span><span class="p">(</span><span class="n">corners</span><span class="p">)</span><span class="o">.</span><span class="n">most_common</span><span class="p">(</span><span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
<span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">latex_bboxes</span> <span class="o">=</span> <span class="n">latex_detect</span><span class="p">(</span><span class="n">img_path</span><span class="p">,</span> <span class="n">latexdet_model</span><span class="p">)</span>
<span class="n">end_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;latex_det_model time: </span><span class="si">{</span><span class="n">end_time</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">start_time</span><span class="si">:</span><span class="s2">.2f</span><span class="si">}</span><span class="s2">s&quot;</span><span class="p">)</span>
<span class="n">latex_bboxes</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">latex_bboxes</span><span class="p">)</span>
<span class="n">latex_bboxes</span> <span class="o">=</span> <span class="n">bbox_merge</span><span class="p">(</span><span class="n">latex_bboxes</span><span class="p">)</span>
<span class="n">masked_img</span> <span class="o">=</span> <span class="n">mask_img</span><span class="p">(</span><span class="n">img</span><span class="p">,</span> <span class="n">latex_bboxes</span><span class="p">,</span> <span class="n">bg_color</span><span class="p">)</span>
<span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">det_prediction</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">textdet_model</span><span class="p">(</span><span class="n">masked_img</span><span class="p">)</span>
<span class="n">end_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;ocr_det_model time: </span><span class="si">{</span><span class="n">end_time</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">start_time</span><span class="si">:</span><span class="s2">.2f</span><span class="si">}</span><span class="s2">s&quot;</span><span class="p">)</span>
<span class="n">ocr_bboxes</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">Bbox</span><span class="p">(</span>
<span class="n">p</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span>
<span class="n">p</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">],</span>
<span class="n">p</span><span class="p">[</span><span class="mi">3</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">-</span> <span class="n">p</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">],</span>
<span class="n">p</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">p</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span>
<span class="n">label</span><span class="o">=</span><span class="s2">&quot;text&quot;</span><span class="p">,</span>
<span class="n">confidence</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">content</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">det_prediction</span>
<span class="p">]</span>
<span class="n">ocr_bboxes</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">ocr_bboxes</span><span class="p">)</span>
<span class="n">ocr_bboxes</span> <span class="o">=</span> <span class="n">bbox_merge</span><span class="p">(</span><span class="n">ocr_bboxes</span><span class="p">)</span>
<span class="n">ocr_bboxes</span> <span class="o">=</span> <span class="n">split_conflict</span><span class="p">(</span><span class="n">ocr_bboxes</span><span class="p">,</span> <span class="n">latex_bboxes</span><span class="p">)</span>
<span class="n">ocr_bboxes</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="s2">&quot;text&quot;</span><span class="p">,</span> <span class="n">ocr_bboxes</span><span class="p">))</span>
<span class="n">sliced_imgs</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">]</span> <span class="o">=</span> <span class="n">slice_from_image</span><span class="p">(</span><span class="n">img</span><span class="p">,</span> <span class="n">ocr_bboxes</span><span class="p">)</span>
<span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">rec_predictions</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">textrec_model</span><span class="p">(</span><span class="n">sliced_imgs</span><span class="p">)</span>
<span class="n">end_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;ocr_rec_model time: </span><span class="si">{</span><span class="n">end_time</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">start_time</span><span class="si">:</span><span class="s2">.2f</span><span class="si">}</span><span class="s2">s&quot;</span><span class="p">)</span>
<span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">rec_predictions</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">ocr_bboxes</span><span class="p">)</span>
<span class="k">for</span> <span class="n">content</span><span class="p">,</span> <span class="n">bbox</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">rec_predictions</span><span class="p">,</span> <span class="n">ocr_bboxes</span><span class="p">):</span>
<span class="n">bbox</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">content</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">latex_imgs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">bbox</span> <span class="ow">in</span> <span class="n">latex_bboxes</span><span class="p">:</span>
<span class="n">latex_imgs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">img</span><span class="p">[</span><span class="n">bbox</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">y</span> <span class="p">:</span> <span class="n">bbox</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">bbox</span><span class="o">.</span><span class="n">h</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">x</span> <span class="p">:</span> <span class="n">bbox</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">bbox</span><span class="o">.</span><span class="n">w</span><span class="p">])</span>
<span class="n">start_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">latex_rec_res</span> <span class="o">=</span> <span class="n">img2latex</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="n">latexrec_model</span><span class="p">,</span>
<span class="n">tokenizer</span><span class="o">=</span><span class="n">tokenizer</span><span class="p">,</span>
<span class="n">images</span><span class="o">=</span><span class="n">latex_imgs</span><span class="p">,</span>
<span class="n">num_beams</span><span class="o">=</span><span class="n">num_beams</span><span class="p">,</span>
<span class="n">out_format</span><span class="o">=</span><span class="s2">&quot;katex&quot;</span><span class="p">,</span>
<span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">,</span>
<span class="n">keep_style</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">end_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;latex_rec_model time: </span><span class="si">{</span><span class="n">end_time</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">start_time</span><span class="si">:</span><span class="s2">.2f</span><span class="si">}</span><span class="s2">s&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">bbox</span><span class="p">,</span> <span class="n">content</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">latex_bboxes</span><span class="p">,</span> <span class="n">latex_rec_res</span><span class="p">):</span>
<span class="k">if</span> <span class="n">bbox</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="s2">&quot;embedding&quot;</span><span class="p">:</span>
<span class="n">bbox</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="s2">&quot; $&quot;</span> <span class="o">+</span> <span class="n">content</span> <span class="o">+</span> <span class="s2">&quot;$ &quot;</span>
<span class="k">elif</span> <span class="n">bbox</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="s2">&quot;isolated&quot;</span><span class="p">:</span>
<span class="n">bbox</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="se">\n\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="sa">r</span><span class="s2">&quot;$$&quot;</span> <span class="o">+</span> <span class="n">content</span> <span class="o">+</span> <span class="sa">r</span><span class="s2">&quot;$$&quot;</span> <span class="o">+</span> <span class="s2">&quot;</span><span class="se">\n\n</span><span class="s2">&quot;</span>
<span class="n">bboxes</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">ocr_bboxes</span> <span class="o">+</span> <span class="n">latex_bboxes</span><span class="p">)</span>
<span class="k">if</span> <span class="n">bboxes</span> <span class="o">==</span> <span class="p">[]:</span>
<span class="k">return</span> <span class="s2">&quot;&quot;</span>
<span class="n">md</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">prev</span> <span class="o">=</span> <span class="n">Bbox</span><span class="p">(</span><span class="n">bboxes</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">bboxes</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">&quot;guard&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">curr</span> <span class="ow">in</span> <span class="n">bboxes</span><span class="p">:</span>
<span class="c1"># Add the formula number back to the isolated formula</span>
<span class="k">if</span> <span class="n">prev</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="s2">&quot;isolated&quot;</span> <span class="ow">and</span> <span class="n">curr</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="s2">&quot;text&quot;</span> <span class="ow">and</span> <span class="n">prev</span><span class="o">.</span><span class="n">same_row</span><span class="p">(</span><span class="n">curr</span><span class="p">):</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="k">if</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;(&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">&quot;)&quot;</span><span class="p">):</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="p">[</span><span class="mi">1</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">tag\{.*\}$&quot;</span><span class="p">,</span> <span class="n">md</span><span class="p">[:</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="c1"># in case of multiple tag</span>
<span class="n">md</span> <span class="o">=</span> <span class="n">md</span><span class="p">[:</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="o">+</span> <span class="sa">f</span><span class="s2">&quot;, </span><span class="si">{</span><span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="si">}</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="s2">&quot;}&quot;</span> <span class="o">+</span> <span class="n">md</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">:]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">md</span> <span class="o">=</span> <span class="n">md</span><span class="p">[:</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span> <span class="o">+</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">tag</span><span class="se">{{</span><span class="si">{</span><span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="si">}</span><span class="se">}}</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">md</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">:]</span>
<span class="k">continue</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">prev</span><span class="o">.</span><span class="n">same_row</span><span class="p">(</span><span class="n">curr</span><span class="p">):</span>
<span class="n">md</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span>
<span class="k">if</span> <span class="n">curr</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="s2">&quot;embedding&quot;</span><span class="p">:</span>
<span class="c1"># remove the bold effect from inline formulas</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">remove_style</span><span class="p">(</span><span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="p">)</span>
<span class="c1"># change split environment into aligned</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;\begin</span><span class="si">{split}</span><span class="s2">&quot;</span><span class="p">,</span> <span class="sa">r</span><span class="s2">&quot;\begin</span><span class="si">{aligned}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;\end</span><span class="si">{split}</span><span class="s2">&quot;</span><span class="p">,</span> <span class="sa">r</span><span class="s2">&quot;\end</span><span class="si">{aligned}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="c1"># remove extra spaces (keeping only one)</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot; +&quot;</span><span class="p">,</span> <span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;$&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">&quot;$&quot;</span><span class="p">)</span>
<span class="n">curr</span><span class="o">.</span><span class="n">content</span> <span class="o">=</span> <span class="s2">&quot; $&quot;</span> <span class="o">+</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s2">&quot;$&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;$ &quot;</span>
<span class="n">md</span> <span class="o">+=</span> <span class="n">curr</span><span class="o">.</span><span class="n">content</span>
<span class="n">prev</span> <span class="o">=</span> <span class="n">curr</span>
<span class="k">return</span> <span class="n">md</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span></div>
</pre></div>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
</div>
</footer>
</div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By TexTeller Team
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2025, TexTeller Team.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>

View File

@@ -0,0 +1,517 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../../../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>texteller.api.katex &#8212; TexTeller documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../../../_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="../../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../../_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="../../../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../_static/documentation_options.js?v=9eb32ce0"></script>
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../../_static/copybutton.js?v=f281be69"></script>
<script src="../../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script src="../../../_static/design-tabs.js?v=f930bc37"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = '_modules/texteller/api/katex';</script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="../../../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search..."
aria-label="Search..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="../../../index.html">
<img src="../../../_static/logo.svg" class="logo__image only-light" alt="TexTeller documentation - Home"/>
<script>document.write(`<img src="../../../_static/logo.svg" class="logo__image only-dark" alt="TexTeller documentation - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../api.html">API Reference</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-source-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://github.com/OleehyO/TexTeller" target="_blank"
class="btn btn-sm btn-source-repository-button dropdown-item"
title="Source repository"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="btn__text-container">Repository</span>
</a>
</li>
<li><a href="https://github.com/OleehyO/TexTeller/issues/new?title=Issue%20on%20page%20%2F_modules/texteller/api/katex.html&body=Your%20issue%20content%20here." target="_blank"
class="btn btn-sm btn-source-issues-button dropdown-item"
title="Open an issue"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="btn__text-container">Open issue</span>
</a>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1></h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<h1>Source code for texteller.api.katex</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span><span class="w"> </span><span class="nn">re</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">..utils.latex</span><span class="w"> </span><span class="kn">import</span> <span class="n">change_all</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">.format</span><span class="w"> </span><span class="kn">import</span> <span class="n">format_latex</span>
<span class="k">def</span><span class="w"> </span><span class="nf">_rm_dollar_surr</span><span class="p">(</span><span class="n">content</span><span class="p">):</span>
<span class="n">pattern</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">[a-zA-Z]+\$.*?\$|\$.*?\$&#39;</span><span class="p">)</span>
<span class="n">matches</span> <span class="o">=</span> <span class="n">pattern</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="n">content</span><span class="p">)</span>
<span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="n">matches</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">[a-zA-Z]+&#39;</span><span class="p">,</span> <span class="n">match</span><span class="p">):</span>
<span class="n">new_match</span> <span class="o">=</span> <span class="n">match</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">&#39;$&#39;</span><span class="p">)</span>
<span class="n">content</span> <span class="o">=</span> <span class="n">content</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">match</span><span class="p">,</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="n">new_match</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">content</span>
<div class="viewcode-block" id="to_katex">
<a class="viewcode-back" href="../../../api.html#texteller.api.to_katex">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">to_katex</span><span class="p">(</span><span class="n">formula</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Convert LaTeX formula to KaTeX-compatible format.</span>
<span class="sd"> This function processes a LaTeX formula string and converts it to a format</span>
<span class="sd"> that is compatible with KaTeX rendering. It removes unsupported commands</span>
<span class="sd"> and structures, simplifies LaTeX environments, and optimizes the formula</span>
<span class="sd"> for web display.</span>
<span class="sd"> Args:</span>
<span class="sd"> formula: LaTeX formula string to convert</span>
<span class="sd"> Returns:</span>
<span class="sd"> KaTeX-compatible formula string</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">formula</span>
<span class="c1"># remove mbox surrounding</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\mbox &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\mbox&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="c1"># remove hbox surrounding</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">hbox to ?-? ?\d+\.\d+(pt)?\{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">hbox{&#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\hbox&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="c1"># remove raise surrounding</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">raise ?-? ?\d+\.\d+(pt)?&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="c1"># remove makebox</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">makebox ?\[\d+\.\d+(pt)?\]\{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">makebox{&#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\makebox&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="c1"># remove vbox surrounding, scalebox surrounding</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">raisebox\{-? ?\d+\.\d+(pt)?\}\{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">raisebox{&#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">scalebox\{-? ?\d+\.\d+(pt)?\}\{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">scalebox{&#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\scalebox&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\raisebox&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\vbox&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
<span class="n">origin_instructions</span> <span class="o">=</span> <span class="p">[</span>
<span class="sa">r</span><span class="s1">&#39;\Huge&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\huge&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\LARGE&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Large&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\large&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\normalsize&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\small&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\footnotesize&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\tiny&#39;</span><span class="p">,</span>
<span class="p">]</span>
<span class="k">for</span> <span class="n">old_ins</span><span class="p">,</span> <span class="n">new_ins</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">origin_instructions</span><span class="p">,</span> <span class="n">origin_instructions</span><span class="p">):</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="n">old_ins</span><span class="p">,</span> <span class="n">new_ins</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\mathbf&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\bm&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\boldmath &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\bm&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\boldmath&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\bm&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\boldmath &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\bm&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\boldmath&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\bm&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\scriptsize&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\scriptsize&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\emph&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\textit&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\emph &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\textit&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">)</span>
<span class="c1"># remove bold command</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\bm&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="n">origin_instructions</span> <span class="o">=</span> <span class="p">[</span>
<span class="sa">r</span><span class="s1">&#39;\left&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\middle&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\right&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\big&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Big&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\bigg&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Bigg&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\bigl&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Bigl&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\biggl&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Biggl&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\bigm&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Bigm&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\biggm&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Biggm&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\bigr&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Bigr&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\biggr&#39;</span><span class="p">,</span>
<span class="sa">r</span><span class="s1">&#39;\Biggr&#39;</span><span class="p">,</span>
<span class="p">]</span>
<span class="k">for</span> <span class="n">origin_ins</span> <span class="ow">in</span> <span class="n">origin_instructions</span><span class="p">:</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">change_all</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="n">origin_ins</span><span class="p">,</span> <span class="n">origin_ins</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">\[(.*?)</span><span class="se">\\</span><span class="s1">\]&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\1</span><span class="se">\\</span><span class="s1">newline&#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="k">if</span> <span class="n">res</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;\newline&#39;</span><span class="p">):</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">res</span><span class="p">[:</span><span class="o">-</span><span class="mi">8</span><span class="p">]</span>
<span class="c1"># remove multiple spaces</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;(</span><span class="se">\\</span><span class="s1">,){1,}&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;(</span><span class="se">\\</span><span class="s1">!){1,}&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;(</span><span class="se">\\</span><span class="s1">;){1,}&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;(</span><span class="se">\\</span><span class="s1">:){1,}&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">vspace\{.*?}&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="c1"># merge consecutive text</span>
<span class="k">def</span><span class="w"> </span><span class="nf">merge_texts</span><span class="p">(</span><span class="n">match</span><span class="p">):</span>
<span class="n">texts</span> <span class="o">=</span> <span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">merged_content</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">text\{([^}]*)\}&#39;</span><span class="p">,</span> <span class="n">texts</span><span class="p">))</span>
<span class="k">return</span> <span class="sa">f</span><span class="s1">&#39;</span><span class="se">\\</span><span class="s1">text</span><span class="se">{{</span><span class="si">{</span><span class="n">merged_content</span><span class="si">}</span><span class="se">}}</span><span class="s1">&#39;</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;(</span><span class="se">\\</span><span class="s1">text\{[^}]*\}\s*){2,}&#39;</span><span class="p">,</span> <span class="n">merge_texts</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">res</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;\bf &#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">_rm_dollar_surr</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
<span class="c1"># remove extra spaces (keeping only one)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39; +&#39;</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="n">res</span><span class="p">)</span>
<span class="c1"># format latex</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">res</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">format_latex</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
<span class="k">return</span> <span class="n">res</span></div>
</pre></div>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
</div>
</footer>
</div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By TexTeller Team
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2025, TexTeller Team.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>

View File

@@ -0,0 +1,553 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../../../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>texteller.api.load &#8212; TexTeller documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../../../_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../../../_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="../../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../../_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="../../../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../_static/documentation_options.js?v=9eb32ce0"></script>
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../../_static/copybutton.js?v=f281be69"></script>
<script src="../../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script src="../../../_static/design-tabs.js?v=f930bc37"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = '_modules/texteller/api/load';</script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="../../../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search..."
aria-label="Search..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="../../../index.html">
<img src="../../../_static/logo.svg" class="logo__image only-light" alt="TexTeller documentation - Home"/>
<script>document.write(`<img src="../../../_static/logo.svg" class="logo__image only-dark" alt="TexTeller documentation - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../api.html">API Reference</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-source-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://github.com/OleehyO/TexTeller" target="_blank"
class="btn btn-sm btn-source-repository-button dropdown-item"
title="Source repository"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="btn__text-container">Repository</span>
</a>
</li>
<li><a href="https://github.com/OleehyO/TexTeller/issues/new?title=Issue%20on%20page%20%2F_modules/texteller/api/load.html&body=Your%20issue%20content%20here." target="_blank"
class="btn btn-sm btn-source-issues-button dropdown-item"
title="Open an issue"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="btn__text-container">Open issue</span>
</a>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1></h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<h1>Source code for texteller.api.load</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span><span class="w"> </span><span class="nn">pathlib</span><span class="w"> </span><span class="kn">import</span> <span class="n">Path</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">wget</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">onnxruntime</span><span class="w"> </span><span class="kn">import</span> <span class="n">InferenceSession</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">transformers</span><span class="w"> </span><span class="kn">import</span> <span class="n">RobertaTokenizerFast</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.constants</span><span class="w"> </span><span class="kn">import</span> <span class="n">LATEX_DET_MODEL_URL</span><span class="p">,</span> <span class="n">TEXT_DET_MODEL_URL</span><span class="p">,</span> <span class="n">TEXT_REC_MODEL_URL</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.globals</span><span class="w"> </span><span class="kn">import</span> <span class="n">Globals</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.logger</span><span class="w"> </span><span class="kn">import</span> <span class="n">get_logger</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.models</span><span class="w"> </span><span class="kn">import</span> <span class="n">TexTeller</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.paddleocr</span><span class="w"> </span><span class="kn">import</span> <span class="n">predict_det</span><span class="p">,</span> <span class="n">predict_rec</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.paddleocr.utility</span><span class="w"> </span><span class="kn">import</span> <span class="n">parse_args</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.utils</span><span class="w"> </span><span class="kn">import</span> <span class="n">cuda_available</span><span class="p">,</span> <span class="n">mkdir</span><span class="p">,</span> <span class="n">resolve_path</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">texteller.types</span><span class="w"> </span><span class="kn">import</span> <span class="n">TexTellerModel</span>
<span class="n">_logger</span> <span class="o">=</span> <span class="n">get_logger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
<div class="viewcode-block" id="load_model">
<a class="viewcode-back" href="../../../api.html#texteller.api.load_model">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">load_model</span><span class="p">(</span><span class="n">model_dir</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">use_onnx</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">TexTellerModel</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load the TexTeller model for LaTeX recognition.</span>
<span class="sd"> This function loads the main TexTeller model, which is responsible for</span>
<span class="sd"> converting images to LaTeX. It can load either the standard PyTorch model</span>
<span class="sd"> or the optimized ONNX version.</span>
<span class="sd"> Args:</span>
<span class="sd"> model_dir: Directory containing the model files. If None, uses the default model.</span>
<span class="sd"> use_onnx: Whether to load the ONNX version of the model for faster inference.</span>
<span class="sd"> Requires the &#39;optimum&#39; package and ONNX Runtime.</span>
<span class="sd"> Returns:</span>
<span class="sd"> Loaded TexTeller model instance</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_model</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; model = load_model(use_onnx=True)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">TexTeller</span><span class="o">.</span><span class="n">from_pretrained</span><span class="p">(</span><span class="n">model_dir</span><span class="p">,</span> <span class="n">use_onnx</span><span class="o">=</span><span class="n">use_onnx</span><span class="p">)</span></div>
<div class="viewcode-block" id="load_tokenizer">
<a class="viewcode-back" href="../../../api.html#texteller.api.load_tokenizer">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">load_tokenizer</span><span class="p">(</span><span class="n">tokenizer_dir</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">RobertaTokenizerFast</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load the tokenizer for the TexTeller model.</span>
<span class="sd"> This function loads the tokenizer used by the TexTeller model for</span>
<span class="sd"> encoding and decoding LaTeX sequences.</span>
<span class="sd"> Args:</span>
<span class="sd"> tokenizer_dir: Directory containing the tokenizer files. If None, uses the default tokenizer.</span>
<span class="sd"> Returns:</span>
<span class="sd"> RobertaTokenizerFast instance</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_tokenizer</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; tokenizer = load_tokenizer()</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">TexTeller</span><span class="o">.</span><span class="n">get_tokenizer</span><span class="p">(</span><span class="n">tokenizer_dir</span><span class="p">)</span></div>
<div class="viewcode-block" id="load_latexdet_model">
<a class="viewcode-back" href="../../../api.html#texteller.api.load_latexdet_model">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">load_latexdet_model</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">InferenceSession</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load the LaTeX detection model.</span>
<span class="sd"> This function loads the model responsible for detecting LaTeX formulas in images.</span>
<span class="sd"> The model is implemented as an ONNX InferenceSession for optimal performance.</span>
<span class="sd"> Returns:</span>
<span class="sd"> ONNX InferenceSession for LaTeX detection</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_latexdet_model</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; detector = load_latexdet_model()</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">fpath</span> <span class="o">=</span> <span class="n">_maybe_download</span><span class="p">(</span><span class="n">LATEX_DET_MODEL_URL</span><span class="p">)</span>
<span class="k">return</span> <span class="n">InferenceSession</span><span class="p">(</span>
<span class="n">resolve_path</span><span class="p">(</span><span class="n">fpath</span><span class="p">),</span>
<span class="n">providers</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;CUDAExecutionProvider&quot;</span> <span class="k">if</span> <span class="n">cuda_available</span><span class="p">()</span> <span class="k">else</span> <span class="s2">&quot;CPUExecutionProvider&quot;</span><span class="p">],</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="load_textrec_model">
<a class="viewcode-back" href="../../../api.html#texteller.api.load_textrec_model">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">load_textrec_model</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">predict_rec</span><span class="o">.</span><span class="n">TextRecognizer</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load the text recognition model.</span>
<span class="sd"> This function loads the model responsible for recognizing regular text in images.</span>
<span class="sd"> It&#39;s based on PaddleOCR&#39;s text recognition model.</span>
<span class="sd"> Returns:</span>
<span class="sd"> PaddleOCR TextRecognizer instance</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_textrec_model</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; text_recognizer = load_textrec_model()</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">fpath</span> <span class="o">=</span> <span class="n">_maybe_download</span><span class="p">(</span><span class="n">TEXT_REC_MODEL_URL</span><span class="p">)</span>
<span class="n">paddleocr_args</span> <span class="o">=</span> <span class="n">parse_args</span><span class="p">()</span>
<span class="n">paddleocr_args</span><span class="o">.</span><span class="n">use_onnx</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">paddleocr_args</span><span class="o">.</span><span class="n">rec_model_dir</span> <span class="o">=</span> <span class="n">resolve_path</span><span class="p">(</span><span class="n">fpath</span><span class="p">)</span>
<span class="n">paddleocr_args</span><span class="o">.</span><span class="n">use_gpu</span> <span class="o">=</span> <span class="n">cuda_available</span><span class="p">()</span>
<span class="n">predictor</span> <span class="o">=</span> <span class="n">predict_rec</span><span class="o">.</span><span class="n">TextRecognizer</span><span class="p">(</span><span class="n">paddleocr_args</span><span class="p">)</span>
<span class="k">return</span> <span class="n">predictor</span></div>
<div class="viewcode-block" id="load_textdet_model">
<a class="viewcode-back" href="../../../api.html#texteller.api.load_textdet_model">[docs]</a>
<span class="k">def</span><span class="w"> </span><span class="nf">load_textdet_model</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">predict_det</span><span class="o">.</span><span class="n">TextDetector</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load the text detection model.</span>
<span class="sd"> This function loads the model responsible for detecting text regions in images.</span>
<span class="sd"> It&#39;s based on PaddleOCR&#39;s text detection model.</span>
<span class="sd"> Returns:</span>
<span class="sd"> PaddleOCR TextDetector instance</span>
<span class="sd"> Example:</span>
<span class="sd"> &gt;&gt;&gt; from texteller import load_textdet_model</span>
<span class="sd"> &gt;&gt;&gt;</span>
<span class="sd"> &gt;&gt;&gt; text_detector = load_textdet_model()</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">fpath</span> <span class="o">=</span> <span class="n">_maybe_download</span><span class="p">(</span><span class="n">TEXT_DET_MODEL_URL</span><span class="p">)</span>
<span class="n">paddleocr_args</span> <span class="o">=</span> <span class="n">parse_args</span><span class="p">()</span>
<span class="n">paddleocr_args</span><span class="o">.</span><span class="n">use_onnx</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">paddleocr_args</span><span class="o">.</span><span class="n">det_model_dir</span> <span class="o">=</span> <span class="n">resolve_path</span><span class="p">(</span><span class="n">fpath</span><span class="p">)</span>
<span class="n">paddleocr_args</span><span class="o">.</span><span class="n">use_gpu</span> <span class="o">=</span> <span class="n">cuda_available</span><span class="p">()</span>
<span class="n">predictor</span> <span class="o">=</span> <span class="n">predict_det</span><span class="o">.</span><span class="n">TextDetector</span><span class="p">(</span><span class="n">paddleocr_args</span><span class="p">)</span>
<span class="k">return</span> <span class="n">predictor</span></div>
<span class="k">def</span><span class="w"> </span><span class="nf">_maybe_download</span><span class="p">(</span><span class="n">url</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">dirpath</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">force</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Path</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Download a file if it doesn&#39;t already exist.</span>
<span class="sd"> Args:</span>
<span class="sd"> url: URL to download from</span>
<span class="sd"> dirpath: Directory to save the file in. If None, uses the default cache directory.</span>
<span class="sd"> force: Whether to force download even if the file already exists</span>
<span class="sd"> Returns:</span>
<span class="sd"> Path to the downloaded file</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">dirpath</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">dirpath</span> <span class="o">=</span> <span class="n">Globals</span><span class="p">()</span><span class="o">.</span><span class="n">cache_dir</span>
<span class="n">mkdir</span><span class="p">(</span><span class="n">dirpath</span><span class="p">)</span>
<span class="n">fname</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="n">url</span><span class="p">)</span><span class="o">.</span><span class="n">name</span>
<span class="n">fpath</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="n">dirpath</span><span class="p">)</span> <span class="o">/</span> <span class="n">fname</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">fpath</span><span class="o">.</span><span class="n">exists</span><span class="p">()</span> <span class="ow">or</span> <span class="n">force</span><span class="p">:</span>
<span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Downloading </span><span class="si">{</span><span class="n">fname</span><span class="si">}</span><span class="s2"> from </span><span class="si">{</span><span class="n">url</span><span class="si">}</span><span class="s2"> to </span><span class="si">{</span><span class="n">fpath</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">wget</span><span class="o">.</span><span class="n">download</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">resolve_path</span><span class="p">(</span><span class="n">fpath</span><span class="p">))</span>
<span class="k">return</span> <span class="n">fpath</span>
</pre></div>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
</div>
</footer>
</div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By TexTeller Team
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2025, TexTeller Team.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../../../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../../../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>

39
_sources/api.rst Normal file
View File

@@ -0,0 +1,39 @@
API Reference
=============
This section provides detailed API documentation for the TexTeller package. TexTeller is a tool for detecting and recognizing LaTeX formulas in images and converting mixed text and formula images to markdown.
.. contents:: Table of Contents
:local:
:depth: 2
Image to LaTeX Conversion
-------------------------
.. autofunction:: texteller.api.img2latex
Paragraph to Markdown Conversion
------------------------------
.. autofunction:: texteller.api.paragraph2md
LaTeX Detection
---------------
.. autofunction:: texteller.api.detection.latex_detect
Model Loading
-------------
.. autofunction:: texteller.api.load_model
.. autofunction:: texteller.api.load_tokenizer
.. autofunction:: texteller.api.load_latexdet_model
.. autofunction:: texteller.api.load_textdet_model
.. autofunction:: texteller.api.load_textrec_model
KaTeX Conversion
----------------
.. autofunction:: texteller.api.to_katex

76
_sources/index.rst Normal file
View File

@@ -0,0 +1,76 @@
.. TexTeller documentation master file, created by
sphinx-quickstart on Sun Apr 20 13:05:53 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
TexTeller Documentation
===========================================
Features
--------
- **Image to LaTeX Conversion**: Convert images containing LaTeX formulas to LaTeX code
- **LaTeX Detection**: Detect and locate LaTeX formulas in mixed text/formula images
- **Paragraph to Markdown**: Convert mixed text and formula images to Markdown format
Installation
-----------
You can install TexTeller using pip:
.. code-block:: bash
pip install texteller
Quick Start
----------
Converting an image to LaTeX:
.. code-block:: python
from texteller import load_model, load_tokenizer, img2latex
# Load models
model = load_model(use_onnx=False)
tokenizer = load_tokenizer()
# Convert image to LaTeX
latex = img2latex(model, tokenizer, ["path/to/image.png"])[0]
Processing a mixed text/formula image:
.. code-block::python
from texteller import (
load_model, load_tokenizer, load_latexdet_model,
load_textdet_model, load_textrec_model, paragraph2md
)
# Load all required models
latex_model = load_model()
tokenizer = load_tokenizer()
latex_detector = load_latexdet_model()
text_detector = load_textdet_model()
text_recognizer = load_textrec_model()
# Convert to markdown
markdown = paragraph2md(
"path/to/mixed_image.png",
latex_detector,
text_detector,
text_recognizer,
latex_model,
tokenizer
)
API Documentation
----------------
For detailed API documentation, please see :doc:`./api`.
.. toctree::
:maxdepth: 2
:hidden:
api

View File

@@ -0,0 +1,101 @@
// @ts-check
// Extra JS capability for selected tabs to be synced
// The selection is stored in local storage so that it persists across page loads.
/**
* @type {Record<string, HTMLElement[]>}
*/
let sd_id_to_elements = {};
const storageKeyPrefix = "sphinx-design-tab-id-";
/**
* Create a key for a tab element.
* @param {HTMLElement} el - The tab element.
* @returns {[string, string, string] | null} - The key.
*
*/
function create_key(el) {
let syncId = el.getAttribute("data-sync-id");
let syncGroup = el.getAttribute("data-sync-group");
if (!syncId || !syncGroup) return null;
return [syncGroup, syncId, syncGroup + "--" + syncId];
}
/**
* Initialize the tab selection.
*
*/
function ready() {
// Find all tabs with sync data
/** @type {string[]} */
let groups = [];
document.querySelectorAll(".sd-tab-label").forEach((label) => {
if (label instanceof HTMLElement) {
let data = create_key(label);
if (data) {
let [group, id, key] = data;
// add click event listener
// @ts-ignore
label.onclick = onSDLabelClick;
// store map of key to elements
if (!sd_id_to_elements[key]) {
sd_id_to_elements[key] = [];
}
sd_id_to_elements[key].push(label);
if (groups.indexOf(group) === -1) {
groups.push(group);
// Check if a specific tab has been selected via URL parameter
const tabParam = new URLSearchParams(window.location.search).get(
group
);
if (tabParam) {
console.log(
"sphinx-design: Selecting tab id for group '" +
group +
"' from URL parameter: " +
tabParam
);
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam);
}
}
// Check is a specific tab has been selected previously
let previousId = window.sessionStorage.getItem(
storageKeyPrefix + group
);
if (previousId === id) {
// console.log(
// "sphinx-design: Selecting tab from session storage: " + id
// );
// @ts-ignore
label.previousElementSibling.checked = true;
}
}
}
});
}
/**
* Activate other tabs with the same sync id.
*
* @this {HTMLElement} - The element that was clicked.
*/
function onSDLabelClick() {
let data = create_key(this);
if (!data) return;
let [group, id, key] = data;
for (const label of sd_id_to_elements[key]) {
if (label === this) continue;
// @ts-ignore
label.previousElementSibling.checked = true;
}
window.sessionStorage.setItem(storageKeyPrefix + group, id);
}
document.addEventListener("DOMContentLoaded", ready, false);

File diff suppressed because one or more lines are too long

914
_static/basic.css Normal file
View File

@@ -0,0 +1,914 @@
/*
* Sphinx stylesheet -- basic theme.
*/
/* -- main layout ----------------------------------------------------------- */
div.clearer {
clear: both;
}
div.section::after {
display: block;
content: '';
clear: left;
}
/* -- relbar ---------------------------------------------------------------- */
div.related {
width: 100%;
font-size: 90%;
}
div.related h3 {
display: none;
}
div.related ul {
margin: 0;
padding: 0 0 0 10px;
list-style: none;
}
div.related li {
display: inline;
}
div.related li.right {
float: right;
margin-right: 5px;
}
/* -- sidebar --------------------------------------------------------------- */
div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}
div.sphinxsidebar {
float: left;
width: 270px;
margin-left: -100%;
font-size: 90%;
word-wrap: break-word;
overflow-wrap : break-word;
}
div.sphinxsidebar ul {
list-style: none;
}
div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
margin-left: 20px;
list-style: square;
}
div.sphinxsidebar ul ul {
margin-top: 0;
margin-bottom: 0;
}
div.sphinxsidebar form {
margin-top: 10px;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
div.sphinxsidebar #searchbox form.search {
overflow: hidden;
}
div.sphinxsidebar #searchbox input[type="text"] {
float: left;
width: 80%;
padding: 0.25em;
box-sizing: border-box;
}
div.sphinxsidebar #searchbox input[type="submit"] {
float: left;
width: 20%;
border-left: none;
padding: 0.25em;
box-sizing: border-box;
}
img {
border: 0;
max-width: 100%;
}
/* -- search page ----------------------------------------------------------- */
ul.search {
margin-top: 10px;
}
ul.search li {
padding: 5px 0;
}
ul.search li a {
font-weight: bold;
}
ul.search li p.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
}
ul.keywordmatches li.goodmatch a {
font-weight: bold;
}
/* -- index page ------------------------------------------------------------ */
table.contentstable {
width: 90%;
margin-left: auto;
margin-right: auto;
}
table.contentstable p.biglink {
line-height: 150%;
}
a.biglink {
font-size: 1.3em;
}
span.linkdescr {
font-style: italic;
padding-top: 5px;
font-size: 90%;
}
/* -- general index --------------------------------------------------------- */
table.indextable {
width: 100%;
}
table.indextable td {
text-align: left;
vertical-align: top;
}
table.indextable ul {
margin-top: 0;
margin-bottom: 0;
list-style-type: none;
}
table.indextable > tbody > tr > td > ul {
padding-left: 0em;
}
table.indextable tr.pcap {
height: 10px;
}
table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}
img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}
div.modindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
div.genindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
/* -- domain module index --------------------------------------------------- */
table.modindextable td {
padding: 2px;
border-collapse: collapse;
}
/* -- general body styles --------------------------------------------------- */
div.body {
min-width: 360px;
max-width: 800px;
}
div.body p, div.body dd, div.body li, div.body blockquote {
-moz-hyphens: auto;
-ms-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
a.headerlink {
visibility: hidden;
}
a:visited {
color: #551A8B;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
visibility: visible;
}
div.body p.caption {
text-align: inherit;
}
div.body td {
text-align: left;
}
.first {
margin-top: 0 !important;
}
p.rubric {
margin-top: 30px;
font-weight: bold;
}
img.align-left, figure.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
img.align-right, figure.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
img.align-center, figure.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
img.align-default, figure.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
.align-default {
text-align: center;
}
.align-right {
text-align: right;
}
/* -- sidebars -------------------------------------------------------------- */
div.sidebar,
aside.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px;
background-color: #ffe;
width: 40%;
float: right;
clear: right;
overflow-x: auto;
}
p.sidebar-title {
font-weight: bold;
}
nav.contents,
aside.topic,
div.admonition, div.topic, blockquote {
clear: left;
}
/* -- topics ---------------------------------------------------------------- */
nav.contents,
aside.topic,
div.topic {
border: 1px solid #ccc;
padding: 7px;
margin: 10px 0 10px 0;
}
p.topic-title {
font-size: 1.1em;
font-weight: bold;
margin-top: 10px;
}
/* -- admonitions ----------------------------------------------------------- */
div.admonition {
margin-top: 10px;
margin-bottom: 10px;
padding: 7px;
}
div.admonition dt {
font-weight: bold;
}
p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
}
div.body p.centered {
text-align: center;
margin-top: 25px;
}
/* -- content of sidebars/topics/admonitions -------------------------------- */
div.sidebar > :last-child,
aside.sidebar > :last-child,
nav.contents > :last-child,
aside.topic > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}
div.sidebar::after,
aside.sidebar::after,
nav.contents::after,
aside.topic::after,
div.topic::after,
div.admonition::after,
blockquote::after {
display: block;
content: '';
clear: both;
}
/* -- tables ---------------------------------------------------------------- */
table.docutils {
margin-top: 10px;
margin-bottom: 10px;
border: 0;
border-collapse: collapse;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
table.align-default {
margin-left: auto;
margin-right: auto;
}
table caption span.caption-number {
font-style: italic;
}
table caption span.caption-text {
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom: 1px solid #aaa;
}
th {
text-align: left;
padding-right: 5px;
}
table.citation {
border-left: solid 1px gray;
margin-left: 1px;
}
table.citation td {
border-bottom: none;
}
th > :first-child,
td > :first-child {
margin-top: 0px;
}
th > :last-child,
td > :last-child {
margin-bottom: 0px;
}
/* -- figures --------------------------------------------------------------- */
div.figure, figure {
margin: 0.5em;
padding: 0.5em;
}
div.figure p.caption, figcaption {
padding: 0.3em;
}
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}
/* -- field list styles ----------------------------------------------------- */
table.field-list td, table.field-list th {
border: 0 !important;
}
.field-list ul {
margin: 0;
padding-left: 1em;
}
.field-list p {
margin: 0;
}
.field-name {
-moz-hyphens: manual;
-ms-hyphens: manual;
-webkit-hyphens: manual;
hyphens: manual;
}
/* -- hlist styles ---------------------------------------------------------- */
table.hlist {
margin: 1em 0;
}
table.hlist td {
vertical-align: top;
}
/* -- object description styles --------------------------------------------- */
.sig {
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
}
.sig-name, code.descname {
background-color: transparent;
font-weight: bold;
}
.sig-name {
font-size: 1.1em;
}
code.descname {
font-size: 1.2em;
}
.sig-prename, code.descclassname {
background-color: transparent;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.sig-param.n {
font-style: italic;
}
/* C++ specific styling */
.sig-inline.c-texpr,
.sig-inline.cpp-texpr {
font-family: unset;
}
.sig.c .k, .sig.c .kt,
.sig.cpp .k, .sig.cpp .kt {
color: #0033B3;
}
.sig.c .m,
.sig.cpp .m {
color: #1750EB;
}
.sig.c .s, .sig.c .sc,
.sig.cpp .s, .sig.cpp .sc {
color: #067D17;
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
list-style: decimal;
}
ol.loweralpha {
list-style: lower-alpha;
}
ol.upperalpha {
list-style: upper-alpha;
}
ol.lowerroman {
list-style: lower-roman;
}
ol.upperroman {
list-style: upper-roman;
}
:not(li) > ol > li:first-child > :first-child,
:not(li) > ul > li:first-child > :first-child {
margin-top: 0px;
}
:not(li) > ol > li:last-child > :last-child,
:not(li) > ul > li:last-child > :last-child {
margin-bottom: 0px;
}
ol.simple ol p,
ol.simple ul p,
ul.simple ol p,
ul.simple ul p {
margin-top: 0;
}
ol.simple > li:not(:first-child) > p,
ul.simple > li:not(:first-child) > p {
margin-top: 0;
}
ol.simple p,
ul.simple p {
margin-bottom: 0;
}
aside.footnote > span,
div.citation > span {
float: left;
}
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
padding-right: 0.5em;
}
aside.footnote > p {
margin-left: 2em;
}
div.citation > p {
margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
margin-bottom: 0em;
}
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
content: "";
clear: both;
}
dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
}
dl.field-list > dt {
font-weight: bold;
word-break: break-word;
padding-left: 0.5em;
padding-right: 5px;
}
dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
margin-left: 0em;
margin-bottom: 0em;
}
dl {
margin-bottom: 15px;
}
dd > :first-child {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}
.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}
dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
}
dt:target, span.highlighted {
background-color: #fbe54e;
}
rect.highlighted {
fill: #fbe54e;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
.versionmodified {
font-style: italic;
}
.system-message {
background-color: #fda;
padding: 5px;
border: 3px solid red;
}
.footnote:target {
background-color: #ffa;
}
.line-block {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.line-block .line-block {
margin-top: 0;
margin-bottom: 0;
margin-left: 1.5em;
}
.guilabel, .menuselection {
font-family: sans-serif;
}
.accelerator {
text-decoration: underline;
}
.classifier {
font-style: oblique;
}
.classifier:before {
font-style: normal;
margin: 0 0.5em;
content: ":";
display: inline-block;
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}
.translated {
background-color: rgba(207, 255, 207, 0.2)
}
.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}
/* -- code displays --------------------------------------------------------- */
pre {
overflow: auto;
overflow-y: hidden; /* fixes display issues on Chrome browsers */
}
pre, div[class*="highlight-"] {
clear: both;
}
span.pre {
-moz-hyphens: none;
-ms-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
white-space: nowrap;
}
div[class*="highlight-"] {
margin: 1em 0;
}
td.linenos pre {
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
display: block;
}
table.highlighttable tbody {
display: block;
}
table.highlighttable tr {
display: flex;
}
table.highlighttable td {
margin: 0;
padding: 0;
}
table.highlighttable td.linenos {
padding-right: 0.5em;
}
table.highlighttable td.code {
flex: 1;
overflow: hidden;
}
.highlight .hll {
display: block;
}
div.highlight pre,
table.highlighttable pre {
margin: 0;
}
div.code-block-caption + div {
margin-top: 0;
}
div.code-block-caption {
margin-top: 1em;
padding: 2px 5px;
font-size: small;
}
div.code-block-caption code {
background-color: transparent;
}
table.highlighttable td.linenos,
span.linenos,
div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
-webkit-user-select: text; /* Safari fallback only */
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
}
div.code-block-caption span.caption-number {
padding: 0.1em 0.3em;
font-style: italic;
}
div.code-block-caption span.caption-text {
}
div.literal-block-wrapper {
margin: 1em 0;
}
code.xref, a code {
background-color: transparent;
font-weight: bold;
}
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}
.viewcode-link {
float: right;
}
.viewcode-back {
float: right;
font-family: sans-serif;
}
div.viewcode-block:target {
margin: -1px -10px;
padding: 0 10px;
}
/* -- math display ---------------------------------------------------------- */
img.math {
vertical-align: middle;
}
div.body div.math p {
text-align: center;
}
span.eqno {
float: right;
}
span.eqno a.headerlink {
position: absolute;
z-index: 1;
}
div.math:hover a.headerlink {
visibility: visible;
}
/* -- printout stylesheet --------------------------------------------------- */
@media print {
div.document,
div.documentwrapper,
div.bodywrapper {
margin: 0 !important;
width: 100%;
}
div.sphinxsidebar,
div.related,
div.footer,
#top-link {
display: none;
}
}

4
_static/check-solid.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-check" width="44" height="44" viewBox="0 0 24 24" stroke-width="2" stroke="#22863a" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M5 12l5 5l10 -10" />
</svg>

After

Width:  |  Height:  |  Size: 313 B

7
_static/clipboard.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
_static/copy-button.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<rect x="8" y="8" width="12" height="12" rx="2" />
<path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" />
</svg>

After

Width:  |  Height:  |  Size: 411 B

94
_static/copybutton.css Normal file
View File

@@ -0,0 +1,94 @@
/* Copy buttons */
button.copybtn {
position: absolute;
display: flex;
top: .3em;
right: .3em;
width: 1.7em;
height: 1.7em;
opacity: 0;
transition: opacity 0.3s, border .3s, background-color .3s;
user-select: none;
padding: 0;
border: none;
outline: none;
border-radius: 0.4em;
/* The colors that GitHub uses */
border: #1b1f2426 1px solid;
background-color: #f6f8fa;
color: #57606a;
}
button.copybtn.success {
border-color: #22863a;
color: #22863a;
}
button.copybtn svg {
stroke: currentColor;
width: 1.5em;
height: 1.5em;
padding: 0.1em;
}
div.highlight {
position: relative;
}
/* Show the copybutton */
.highlight:hover button.copybtn, button.copybtn.success {
opacity: 1;
}
.highlight button.copybtn:hover {
background-color: rgb(235, 235, 235);
}
.highlight button.copybtn:active {
background-color: rgb(187, 187, 187);
}
/**
* A minimal CSS-only tooltip copied from:
* https://codepen.io/mildrenben/pen/rVBrpK
*
* To use, write HTML like the following:
*
* <p class="o-tooltip--left" data-tooltip="Hey">Short</p>
*/
.o-tooltip--left {
position: relative;
}
.o-tooltip--left:after {
opacity: 0;
visibility: hidden;
position: absolute;
content: attr(data-tooltip);
padding: .2em;
font-size: .8em;
left: -.2em;
background: grey;
color: white;
white-space: nowrap;
z-index: 2;
border-radius: 2px;
transform: translateX(-102%) translateY(0);
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
}
.o-tooltip--left:hover:after {
display: block;
opacity: 1;
visibility: visible;
transform: translateX(-100%) translateY(0);
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
transition-delay: .5s;
}
/* By default the copy button shouldn't show up when printing a page */
@media print {
button.copybtn {
display: none;
}
}

248
_static/copybutton.js Normal file
View File

@@ -0,0 +1,248 @@
// Localization support
const messages = {
'en': {
'copy': 'Copy',
'copy_to_clipboard': 'Copy to clipboard',
'copy_success': 'Copied!',
'copy_failure': 'Failed to copy',
},
'es' : {
'copy': 'Copiar',
'copy_to_clipboard': 'Copiar al portapapeles',
'copy_success': '¡Copiado!',
'copy_failure': 'Error al copiar',
},
'de' : {
'copy': 'Kopieren',
'copy_to_clipboard': 'In die Zwischenablage kopieren',
'copy_success': 'Kopiert!',
'copy_failure': 'Fehler beim Kopieren',
},
'fr' : {
'copy': 'Copier',
'copy_to_clipboard': 'Copier dans le presse-papier',
'copy_success': 'Copié !',
'copy_failure': 'Échec de la copie',
},
'ru': {
'copy': 'Скопировать',
'copy_to_clipboard': 'Скопировать в буфер',
'copy_success': 'Скопировано!',
'copy_failure': 'Не удалось скопировать',
},
'zh-CN': {
'copy': '复制',
'copy_to_clipboard': '复制到剪贴板',
'copy_success': '复制成功!',
'copy_failure': '复制失败',
},
'it' : {
'copy': 'Copiare',
'copy_to_clipboard': 'Copiato negli appunti',
'copy_success': 'Copiato!',
'copy_failure': 'Errore durante la copia',
}
}
let locale = 'en'
if( document.documentElement.lang !== undefined
&& messages[document.documentElement.lang] !== undefined ) {
locale = document.documentElement.lang
}
let doc_url_root = DOCUMENTATION_OPTIONS.URL_ROOT;
if (doc_url_root == '#') {
doc_url_root = '';
}
/**
* SVG files for our copy buttons
*/
let iconCheck = `<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-check" width="44" height="44" viewBox="0 0 24 24" stroke-width="2" stroke="#22863a" fill="none" stroke-linecap="round" stroke-linejoin="round">
<title>${messages[locale]['copy_success']}</title>
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M5 12l5 5l10 -10" />
</svg>`
// If the user specified their own SVG use that, otherwise use the default
let iconCopy = ``;
if (!iconCopy) {
iconCopy = `<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round">
<title>${messages[locale]['copy_to_clipboard']}</title>
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<rect x="8" y="8" width="12" height="12" rx="2" />
<path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" />
</svg>`
}
/**
* Set up copy/paste for code blocks
*/
const runWhenDOMLoaded = cb => {
if (document.readyState != 'loading') {
cb()
} else if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', cb)
} else {
document.attachEvent('onreadystatechange', function() {
if (document.readyState == 'complete') cb()
})
}
}
const codeCellId = index => `codecell${index}`
// Clears selected text since ClipboardJS will select the text when copying
const clearSelection = () => {
if (window.getSelection) {
window.getSelection().removeAllRanges()
} else if (document.selection) {
document.selection.empty()
}
}
// Changes tooltip text for a moment, then changes it back
// We want the timeout of our `success` class to be a bit shorter than the
// tooltip and icon change, so that we can hide the icon before changing back.
var timeoutIcon = 2000;
var timeoutSuccessClass = 1500;
const temporarilyChangeTooltip = (el, oldText, newText) => {
el.setAttribute('data-tooltip', newText)
el.classList.add('success')
// Remove success a little bit sooner than we change the tooltip
// So that we can use CSS to hide the copybutton first
setTimeout(() => el.classList.remove('success'), timeoutSuccessClass)
setTimeout(() => el.setAttribute('data-tooltip', oldText), timeoutIcon)
}
// Changes the copy button icon for two seconds, then changes it back
const temporarilyChangeIcon = (el) => {
el.innerHTML = iconCheck;
setTimeout(() => {el.innerHTML = iconCopy}, timeoutIcon)
}
const addCopyButtonToCodeCells = () => {
// If ClipboardJS hasn't loaded, wait a bit and try again. This
// happens because we load ClipboardJS asynchronously.
if (window.ClipboardJS === undefined) {
setTimeout(addCopyButtonToCodeCells, 250)
return
}
// Add copybuttons to all of our code cells
const COPYBUTTON_SELECTOR = 'div.highlight pre';
const codeCells = document.querySelectorAll(COPYBUTTON_SELECTOR)
codeCells.forEach((codeCell, index) => {
const id = codeCellId(index)
codeCell.setAttribute('id', id)
const clipboardButton = id =>
`<button class="copybtn o-tooltip--left" data-tooltip="${messages[locale]['copy']}" data-clipboard-target="#${id}">
${iconCopy}
</button>`
codeCell.insertAdjacentHTML('afterend', clipboardButton(id))
})
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
/**
* Removes excluded text from a Node.
*
* @param {Node} target Node to filter.
* @param {string} exclude CSS selector of nodes to exclude.
* @returns {DOMString} Text from `target` with text removed.
*/
function filterText(target, exclude) {
const clone = target.cloneNode(true); // clone as to not modify the live DOM
if (exclude) {
// remove excluded nodes
clone.querySelectorAll(exclude).forEach(node => node.remove());
}
return clone.innerText;
}
// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {
var regexp;
var match;
// Do we check for line continuation characters and "HERE-documents"?
var useLineCont = !!lineContinuationChar
var useHereDoc = !!hereDocDelim
// create regexp to capture prompt and remaining line
if (isRegexp) {
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
} else {
regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)')
}
const outputLines = [];
var promptFound = false;
var gotLineCont = false;
var gotHereDoc = false;
const lineGotPrompt = [];
for (const line of textContent.split('\n')) {
match = line.match(regexp)
if (match || gotLineCont || gotHereDoc) {
promptFound = regexp.test(line)
lineGotPrompt.push(promptFound)
if (removePrompts && promptFound) {
outputLines.push(match[2])
} else {
outputLines.push(line)
}
gotLineCont = line.endsWith(lineContinuationChar) & useLineCont
if (line.includes(hereDocDelim) & useHereDoc)
gotHereDoc = !gotHereDoc
} else if (!onlyCopyPromptLines) {
outputLines.push(line)
} else if (copyEmptyLines && line.trim() === '') {
outputLines.push(line)
}
}
// If no lines with the prompt were found then just use original lines
if (lineGotPrompt.some(v => v === true)) {
textContent = outputLines.join('\n');
}
// Remove a trailing newline to avoid auto-running when pasting
if (textContent.endsWith("\n")) {
textContent = textContent.slice(0, -1)
}
return textContent
}
var copyTargetText = (trigger) => {
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
// get filtered text
let exclude = '.linenos';
let text = filterText(target, exclude);
return formatCopyText(text, '', false, true, true, true, '', '')
}
// Initialize with a callback so we can modify the text before copy
const clipboard = new ClipboardJS('.copybtn', {text: copyTargetText})
// Update UI with error/success messages
clipboard.on('success', event => {
clearSelection()
temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_success'])
temporarilyChangeIcon(event.trigger)
})
clipboard.on('error', event => {
temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_failure'])
})
}
runWhenDOMLoaded(addCopyButtonToCodeCells)

View File

@@ -0,0 +1,73 @@
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
/**
* Removes excluded text from a Node.
*
* @param {Node} target Node to filter.
* @param {string} exclude CSS selector of nodes to exclude.
* @returns {DOMString} Text from `target` with text removed.
*/
export function filterText(target, exclude) {
const clone = target.cloneNode(true); // clone as to not modify the live DOM
if (exclude) {
// remove excluded nodes
clone.querySelectorAll(exclude).forEach(node => node.remove());
}
return clone.innerText;
}
// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {
var regexp;
var match;
// Do we check for line continuation characters and "HERE-documents"?
var useLineCont = !!lineContinuationChar
var useHereDoc = !!hereDocDelim
// create regexp to capture prompt and remaining line
if (isRegexp) {
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
} else {
regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)')
}
const outputLines = [];
var promptFound = false;
var gotLineCont = false;
var gotHereDoc = false;
const lineGotPrompt = [];
for (const line of textContent.split('\n')) {
match = line.match(regexp)
if (match || gotLineCont || gotHereDoc) {
promptFound = regexp.test(line)
lineGotPrompt.push(promptFound)
if (removePrompts && promptFound) {
outputLines.push(match[2])
} else {
outputLines.push(line)
}
gotLineCont = line.endsWith(lineContinuationChar) & useLineCont
if (line.includes(hereDocDelim) & useHereDoc)
gotHereDoc = !gotHereDoc
} else if (!onlyCopyPromptLines) {
outputLines.push(line)
} else if (copyEmptyLines && line.trim() === '') {
outputLines.push(line)
}
}
// If no lines with the prompt were found then just use original lines
if (lineGotPrompt.some(v => v === true)) {
textContent = outputLines.join('\n');
}
// Remove a trailing newline to avoid auto-running when pasting
if (textContent.endsWith("\n")) {
textContent = textContent.slice(0, -1)
}
return textContent
}

101
_static/design-tabs.js Normal file
View File

@@ -0,0 +1,101 @@
// @ts-check
// Extra JS capability for selected tabs to be synced
// The selection is stored in local storage so that it persists across page loads.
/**
* @type {Record<string, HTMLElement[]>}
*/
let sd_id_to_elements = {};
const storageKeyPrefix = "sphinx-design-tab-id-";
/**
* Create a key for a tab element.
* @param {HTMLElement} el - The tab element.
* @returns {[string, string, string] | null} - The key.
*
*/
function create_key(el) {
let syncId = el.getAttribute("data-sync-id");
let syncGroup = el.getAttribute("data-sync-group");
if (!syncId || !syncGroup) return null;
return [syncGroup, syncId, syncGroup + "--" + syncId];
}
/**
* Initialize the tab selection.
*
*/
function ready() {
// Find all tabs with sync data
/** @type {string[]} */
let groups = [];
document.querySelectorAll(".sd-tab-label").forEach((label) => {
if (label instanceof HTMLElement) {
let data = create_key(label);
if (data) {
let [group, id, key] = data;
// add click event listener
// @ts-ignore
label.onclick = onSDLabelClick;
// store map of key to elements
if (!sd_id_to_elements[key]) {
sd_id_to_elements[key] = [];
}
sd_id_to_elements[key].push(label);
if (groups.indexOf(group) === -1) {
groups.push(group);
// Check if a specific tab has been selected via URL parameter
const tabParam = new URLSearchParams(window.location.search).get(
group
);
if (tabParam) {
console.log(
"sphinx-design: Selecting tab id for group '" +
group +
"' from URL parameter: " +
tabParam
);
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam);
}
}
// Check is a specific tab has been selected previously
let previousId = window.sessionStorage.getItem(
storageKeyPrefix + group
);
if (previousId === id) {
// console.log(
// "sphinx-design: Selecting tab from session storage: " + id
// );
// @ts-ignore
label.previousElementSibling.checked = true;
}
}
}
});
}
/**
* Activate other tabs with the same sync id.
*
* @this {HTMLElement} - The element that was clicked.
*/
function onSDLabelClick() {
let data = create_key(this);
if (!data) return;
let [group, id, key] = data;
for (const label of sd_id_to_elements[key]) {
if (label === this) continue;
// @ts-ignore
label.previousElementSibling.checked = true;
}
window.sessionStorage.setItem(storageKeyPrefix + group, id);
}
document.addEventListener("DOMContentLoaded", ready, false);

149
_static/doctools.js Normal file
View File

@@ -0,0 +1,149 @@
/*
* Base JavaScript utilities for all Sphinx HTML documentation.
*/
"use strict";
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
"TEXTAREA",
"INPUT",
"SELECT",
"BUTTON",
]);
const _ready = (callback) => {
if (document.readyState !== "loading") {
callback();
} else {
document.addEventListener("DOMContentLoaded", callback);
}
};
/**
* Small JavaScript module for the documentation.
*/
const Documentation = {
init: () => {
Documentation.initDomainIndexTable();
Documentation.initOnKeyListeners();
},
/**
* i18n support
*/
TRANSLATIONS: {},
PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
LOCALE: "unknown",
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext: (string) => {
const translated = Documentation.TRANSLATIONS[string];
switch (typeof translated) {
case "undefined":
return string; // no translation
case "string":
return translated; // translation exists
default:
return translated[0]; // (singular, plural) translation tuple exists
}
},
ngettext: (singular, plural, n) => {
const translated = Documentation.TRANSLATIONS[singular];
if (typeof translated !== "undefined")
return translated[Documentation.PLURAL_EXPR(n)];
return n === 1 ? singular : plural;
},
addTranslations: (catalog) => {
Object.assign(Documentation.TRANSLATIONS, catalog.messages);
Documentation.PLURAL_EXPR = new Function(
"n",
`return (${catalog.plural_expr})`
);
Documentation.LOCALE = catalog.locale;
},
/**
* helper function to focus on search bar
*/
focusSearchBar: () => {
document.querySelectorAll("input[name=q]")[0]?.focus();
},
/**
* Initialise the domain index toggle buttons
*/
initDomainIndexTable: () => {
const toggler = (el) => {
const idNumber = el.id.substr(7);
const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
if (el.src.substr(-9) === "minus.png") {
el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
toggledRows.forEach((el) => (el.style.display = "none"));
} else {
el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
toggledRows.forEach((el) => (el.style.display = ""));
}
};
const togglerElements = document.querySelectorAll("img.toggler");
togglerElements.forEach((el) =>
el.addEventListener("click", (event) => toggler(event.currentTarget))
);
togglerElements.forEach((el) => (el.style.display = ""));
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
},
initOnKeyListeners: () => {
// only install a listener if it is really needed
if (
!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
)
return;
document.addEventListener("keydown", (event) => {
// bail for input elements
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
// bail with special keys
if (event.altKey || event.ctrlKey || event.metaKey) return;
if (!event.shiftKey) {
switch (event.key) {
case "ArrowLeft":
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
const prevLink = document.querySelector('link[rel="prev"]');
if (prevLink && prevLink.href) {
window.location.href = prevLink.href;
event.preventDefault();
}
break;
case "ArrowRight":
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
const nextLink = document.querySelector('link[rel="next"]');
if (nextLink && nextLink.href) {
window.location.href = nextLink.href;
event.preventDefault();
}
break;
}
}
// some keyboard layouts may need Shift to get /
switch (event.key) {
case "/":
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
Documentation.focusSearchBar();
event.preventDefault();
}
});
},
};
// quick alias for translations
const _ = Documentation.gettext;
_ready(Documentation.init);

View File

@@ -0,0 +1,13 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '',
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: true,
};

BIN
_static/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 44.4 44.4" style="enable-background:new 0 0 44.4 44.4;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#F5A252;stroke-width:5;stroke-miterlimit:10;}
.st1{fill:none;stroke:#579ACA;stroke-width:5;stroke-miterlimit:10;}
.st2{fill:none;stroke:#E66581;stroke-width:5;stroke-miterlimit:10;}
</style>
<title>logo</title>
<g>
<path class="st0" d="M33.9,6.4c3.6,3.9,3.4,9.9-0.5,13.5s-9.9,3.4-13.5-0.5s-3.4-9.9,0.5-13.5l0,0C24.2,2.4,30.2,2.6,33.9,6.4z"/>
<path class="st1" d="M35.1,27.3c2.6,4.6,1.1,10.4-3.5,13c-4.6,2.6-10.4,1.1-13-3.5s-1.1-10.4,3.5-13l0,0
C26.6,21.2,32.4,22.7,35.1,27.3z"/>
<path class="st2" d="M25.9,17.8c2.6,4.6,1.1,10.4-3.5,13s-10.4,1.1-13-3.5s-1.1-10.4,3.5-13l0,0C17.5,11.7,23.3,13.2,25.9,17.8z"/>
<path class="st1" d="M19.2,26.4c3.1-4.3,9.1-5.2,13.3-2.1c1.1,0.8,2,1.8,2.7,3"/>
<path class="st0" d="M19.9,19.4c-3.6-3.9-3.4-9.9,0.5-13.5s9.9-3.4,13.5,0.5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 128h52.512l29.539-11.077-11.077-43.487-34.051 3.693L0 128Z" fill="#0076D4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M52.513 128s16.6-8.759 19.673-24.277c3.072-15.517-12.091-26.594-35.263-26.594 0-.41 20.343-28.718 20.343-28.718l49.4 1.435L95.71 107.7l-20.452 15.978L52.513 128Z" fill="#002868"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0 60.718 41.025.001s1.006.01 3.282 0c16.082-.068 81.23 3.12 81.23 60.368 0 65.352-73.025 67.631-73.025 67.631s30.495-5.839 30.495-34.816c0-28.978-27.541-32.466-45.264-32.466H0Z" fill="#00A9FF"/></svg>

After

Width:  |  Height:  |  Size: 681 B

View File

@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="38.73" height="50" viewBox="0 0 38.73 50"><defs><style>.cls-1{fill:#767677;}.cls-2{fill:#f37726;}.cls-3{fill:#9e9e9e;}.cls-4{fill:#616262;}.cls-5{font-size:17.07px;fill:#fff;font-family:Roboto-Regular, Roboto;}</style></defs><title>logo_jupyterhub</title><g id="Canvas"><path id="path7_fill" data-name="path7 fill" class="cls-1" d="M39.51,3.53a3,3,0,0,1-1.7,2.9A3,3,0,0,1,34.48,6a3,3,0,0,1-.82-3.26,3,3,0,0,1,1.05-1.41A3,3,0,0,1,37.52.86a2.88,2.88,0,0,1,1,.6,3,3,0,0,1,.7.93,3.18,3.18,0,0,1,.28,1.14Z" transform="translate(-1.87 -0.69)"/><path id="path8_fill" data-name="path8 fill" class="cls-2" d="M21.91,38.39c-8,0-15.06-2.87-18.7-7.12a19.93,19.93,0,0,0,37.39,0C37,35.52,30,38.39,21.91,38.39Z" transform="translate(-1.87 -0.69)"/><path id="path9_fill" data-name="path9 fill" class="cls-2" d="M21.91,10.78c8,0,15.05,2.87,18.69,7.12a19.93,19.93,0,0,0-37.39,0C6.85,13.64,13.86,10.78,21.91,10.78Z" transform="translate(-1.87 -0.69)"/><path id="path10_fill" data-name="path10 fill" class="cls-3" d="M10.88,46.66a3.86,3.86,0,0,1-.52,2.15,3.81,3.81,0,0,1-1.62,1.51,3.93,3.93,0,0,1-2.19.34,3.79,3.79,0,0,1-2-.94,3.73,3.73,0,0,1-1.14-1.9,3.79,3.79,0,0,1,.1-2.21,3.86,3.86,0,0,1,1.33-1.78,3.92,3.92,0,0,1,3.54-.53,3.85,3.85,0,0,1,2.14,1.93,3.74,3.74,0,0,1,.37,1.43Z" transform="translate(-1.87 -0.69)"/><path id="path11_fill" data-name="path11 fill" class="cls-4" d="M4.12,9.81A2.18,2.18,0,0,1,2.9,9.48a2.23,2.23,0,0,1-.84-1A2.26,2.26,0,0,1,1.9,7.26a2.13,2.13,0,0,1,.56-1.13,2.18,2.18,0,0,1,2.36-.56,2.13,2.13,0,0,1,1,.76,2.18,2.18,0,0,1,.42,1.2A2.22,2.22,0,0,1,4.12,9.81Z" transform="translate(-1.87 -0.69)"/></g><text class="cls-5" transform="translate(5.24 30.01)">Hub</text></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

192
_static/language_data.js Normal file
View File

@@ -0,0 +1,192 @@
/*
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*/
var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
/* Non-minified version is copied as a separate JS file, if available */
/**
* Porter Stemmer
*/
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "بواسطة"
msgid "By"
msgstr "بواسطة"
msgid "Contents"
msgstr "محتويات"
msgid "Copyright"
msgstr "حقوق النشر"
msgid "Download notebook file"
msgstr "تنزيل ملف دفتر الملاحظات"
msgid "Download source file"
msgstr "تنزيل ملف المصدر"
msgid "Download this page"
msgstr "قم بتنزيل هذه الصفحة"
msgid "Edit this page"
msgstr "قم بتحرير هذه الصفحة"
msgid "Fullscreen mode"
msgstr "وضع ملء الشاشة"
msgid "Last updated on"
msgstr "آخر تحديث في"
msgid "Launch"
msgstr "إطلاق"
msgid "Open an issue"
msgstr "افتح قضية"
msgid "Print to PDF"
msgstr "طباعة إلى PDF"
msgid "Source repository"
msgstr "مستودع المصدر"
msgid "Sphinx Book Theme"
msgstr "موضوع كتاب أبو الهول"
msgid "Theme by the"
msgstr "موضوع بواسطة"
msgid "Toggle navigation"
msgstr "تبديل التنقل"
msgid "next page"
msgstr "الصفحة التالية"
msgid "open issue"
msgstr "قضية مفتوحة"
msgid "previous page"
msgstr "الصفحة السابقة"
msgid "repository"
msgstr "مخزن"
msgid "suggest edit"
msgstr "أقترح تحرير"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "По"
msgid "By"
msgstr "От"
msgid "Contents"
msgstr "Съдържание"
msgid "Copyright"
msgstr "Авторско право"
msgid "Download notebook file"
msgstr "Изтеглете файла на бележника"
msgid "Download source file"
msgstr "Изтеглете изходния файл"
msgid "Download this page"
msgstr "Изтеглете тази страница"
msgid "Edit this page"
msgstr "Редактирайте тази страница"
msgid "Fullscreen mode"
msgstr "Режим на цял екран"
msgid "Last updated on"
msgstr "Последна актуализация на"
msgid "Launch"
msgstr "Стартиране"
msgid "Open an issue"
msgstr "Отворете проблем"
msgid "Print to PDF"
msgstr "Печат в PDF"
msgid "Source repository"
msgstr "Хранилище на източника"
msgid "Sphinx Book Theme"
msgstr "Тема на книгата Sphinx"
msgid "Theme by the"
msgstr "Тема от"
msgid "Toggle navigation"
msgstr "Превключване на навигацията"
msgid "next page"
msgstr "Следваща страница"
msgid "open issue"
msgstr "отворен брой"
msgid "previous page"
msgstr "предишна страница"
msgid "repository"
msgstr "хранилище"
msgid "suggest edit"
msgstr "предложи редактиране"

Binary file not shown.

View File

@@ -0,0 +1,63 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: bn\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "দ্বারা"
msgid "By"
msgstr "দ্বারা"
msgid "Copyright"
msgstr "কপিরাইট"
msgid "Download notebook file"
msgstr "নোটবুক ফাইল ডাউনলোড করুন"
msgid "Download source file"
msgstr "উত্স ফাইল ডাউনলোড করুন"
msgid "Download this page"
msgstr "এই পৃষ্ঠাটি ডাউনলোড করুন"
msgid "Edit this page"
msgstr "এই পৃষ্ঠাটি সম্পাদনা করুন"
msgid "Last updated on"
msgstr "সর্বশেষ আপডেট"
msgid "Launch"
msgstr "শুরু করা"
msgid "Open an issue"
msgstr "একটি সমস্যা খুলুন"
msgid "Print to PDF"
msgstr "পিডিএফ প্রিন্ট করুন"
msgid "Source repository"
msgstr "উত্স সংগ্রহস্থল"
msgid "Sphinx Book Theme"
msgstr "স্পিনিক্স বুক থিম"
msgid "Theme by the"
msgstr "থিম দ্বারা"
msgid "Toggle navigation"
msgstr "নেভিগেশন টগল করুন"
msgid "next page"
msgstr "পরবর্তী পৃষ্ঠা"
msgid "open issue"
msgstr "খোলা সমস্যা"
msgid "previous page"
msgstr "আগের পৃষ্ঠা"

Binary file not shown.

View File

@@ -0,0 +1,66 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Per la"
msgid "By"
msgstr "Per"
msgid "Copyright"
msgstr "Copyright"
msgid "Download notebook file"
msgstr "Descarregar fitxer de quadern"
msgid "Download source file"
msgstr "Baixeu el fitxer font"
msgid "Download this page"
msgstr "Descarregueu aquesta pàgina"
msgid "Edit this page"
msgstr "Editeu aquesta pàgina"
msgid "Last updated on"
msgstr "Darrera actualització el"
msgid "Launch"
msgstr "Llançament"
msgid "Open an issue"
msgstr "Obriu un número"
msgid "Print to PDF"
msgstr "Imprimeix a PDF"
msgid "Source repository"
msgstr "Dipòsit de fonts"
msgid "Sphinx Book Theme"
msgstr "Tema del llibre Esfinx"
msgid "Theme by the"
msgstr "Tema del"
msgid "Toggle navigation"
msgstr "Commuta la navegació"
msgid "next page"
msgstr "pàgina següent"
msgid "open issue"
msgstr "número obert"
msgid "previous page"
msgstr "Pàgina anterior"
msgid "suggest edit"
msgstr "suggerir edició"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Podle"
msgid "By"
msgstr "Podle"
msgid "Contents"
msgstr "Obsah"
msgid "Copyright"
msgstr "autorská práva"
msgid "Download notebook file"
msgstr "Stáhnout soubor poznámkového bloku"
msgid "Download source file"
msgstr "Stáhněte si zdrojový soubor"
msgid "Download this page"
msgstr "Stáhněte si tuto stránku"
msgid "Edit this page"
msgstr "Upravit tuto stránku"
msgid "Fullscreen mode"
msgstr "Režim celé obrazovky"
msgid "Last updated on"
msgstr "Naposledy aktualizováno"
msgid "Launch"
msgstr "Zahájení"
msgid "Open an issue"
msgstr "Otevřete problém"
msgid "Print to PDF"
msgstr "Tisk do PDF"
msgid "Source repository"
msgstr "Zdrojové úložiště"
msgid "Sphinx Book Theme"
msgstr "Téma knihy Sfinga"
msgid "Theme by the"
msgstr "Téma od"
msgid "Toggle navigation"
msgstr "Přepnout navigaci"
msgid "next page"
msgstr "další strana"
msgid "open issue"
msgstr "otevřené číslo"
msgid "previous page"
msgstr "předchozí stránka"
msgid "repository"
msgstr "úložiště"
msgid "suggest edit"
msgstr "navrhnout úpravy"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: da\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Ved"
msgid "By"
msgstr "Ved"
msgid "Contents"
msgstr "Indhold"
msgid "Copyright"
msgstr "ophavsret"
msgid "Download notebook file"
msgstr "Download notesbog-fil"
msgid "Download source file"
msgstr "Download kildefil"
msgid "Download this page"
msgstr "Download denne side"
msgid "Edit this page"
msgstr "Rediger denne side"
msgid "Fullscreen mode"
msgstr "Fuldskærmstilstand"
msgid "Last updated on"
msgstr "Sidst opdateret den"
msgid "Launch"
msgstr "Start"
msgid "Open an issue"
msgstr "Åbn et problem"
msgid "Print to PDF"
msgstr "Udskriv til PDF"
msgid "Source repository"
msgstr "Kildelager"
msgid "Sphinx Book Theme"
msgstr "Sphinx bogtema"
msgid "Theme by the"
msgstr "Tema af"
msgid "Toggle navigation"
msgstr "Skift navigation"
msgid "next page"
msgstr "Næste side"
msgid "open issue"
msgstr "åbent nummer"
msgid "previous page"
msgstr "forrige side"
msgid "repository"
msgstr "lager"
msgid "suggest edit"
msgstr "foreslå redigering"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Bis zum"
msgid "By"
msgstr "Durch"
msgid "Contents"
msgstr "Inhalt"
msgid "Copyright"
msgstr "Urheberrechte ©"
msgid "Download notebook file"
msgstr "Notebook-Datei herunterladen"
msgid "Download source file"
msgstr "Quelldatei herunterladen"
msgid "Download this page"
msgstr "Laden Sie diese Seite herunter"
msgid "Edit this page"
msgstr "Bearbeite diese Seite"
msgid "Fullscreen mode"
msgstr "Vollbildmodus"
msgid "Last updated on"
msgstr "Zuletzt aktualisiert am"
msgid "Launch"
msgstr "Starten"
msgid "Open an issue"
msgstr "Öffnen Sie ein Problem"
msgid "Print to PDF"
msgstr "In PDF drucken"
msgid "Source repository"
msgstr "Quell-Repository"
msgid "Sphinx Book Theme"
msgstr "Sphinx-Buch-Thema"
msgid "Theme by the"
msgstr "Thema von der"
msgid "Toggle navigation"
msgstr "Navigation umschalten"
msgid "next page"
msgstr "Nächste Seite"
msgid "open issue"
msgstr "offenes Thema"
msgid "previous page"
msgstr "vorherige Seite"
msgid "repository"
msgstr "Repository"
msgid "suggest edit"
msgstr "vorschlagen zu bearbeiten"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: el\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Από το"
msgid "By"
msgstr "Με"
msgid "Contents"
msgstr "Περιεχόμενα"
msgid "Copyright"
msgstr "Πνευματική ιδιοκτησία"
msgid "Download notebook file"
msgstr "Λήψη αρχείου σημειωματάριου"
msgid "Download source file"
msgstr "Λήψη αρχείου προέλευσης"
msgid "Download this page"
msgstr "Λήψη αυτής της σελίδας"
msgid "Edit this page"
msgstr "Επεξεργαστείτε αυτήν τη σελίδα"
msgid "Fullscreen mode"
msgstr "ΛΕΙΤΟΥΡΓΙΑ ΠΛΗΡΟΥΣ ΟΘΟΝΗΣ"
msgid "Last updated on"
msgstr "Τελευταία ενημέρωση στις"
msgid "Launch"
msgstr "Εκτόξευση"
msgid "Open an issue"
msgstr "Ανοίξτε ένα ζήτημα"
msgid "Print to PDF"
msgstr "Εκτύπωση σε PDF"
msgid "Source repository"
msgstr "Αποθήκη πηγής"
msgid "Sphinx Book Theme"
msgstr "Θέμα βιβλίου Sphinx"
msgid "Theme by the"
msgstr "Θέμα από το"
msgid "Toggle navigation"
msgstr "Εναλλαγή πλοήγησης"
msgid "next page"
msgstr "επόμενη σελίδα"
msgid "open issue"
msgstr "ανοιχτό ζήτημα"
msgid "previous page"
msgstr "προηγούμενη σελίδα"
msgid "repository"
msgstr "αποθήκη"
msgid "suggest edit"
msgstr "προτείνω επεξεργασία"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: eo\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Per la"
msgid "By"
msgstr "De"
msgid "Contents"
msgstr "Enhavo"
msgid "Copyright"
msgstr "Kopirajto"
msgid "Download notebook file"
msgstr "Elŝutu kajeran dosieron"
msgid "Download source file"
msgstr "Elŝutu fontodosieron"
msgid "Download this page"
msgstr "Elŝutu ĉi tiun paĝon"
msgid "Edit this page"
msgstr "Redaktu ĉi tiun paĝon"
msgid "Fullscreen mode"
msgstr "Plenekrana reĝimo"
msgid "Last updated on"
msgstr "Laste ĝisdatigita la"
msgid "Launch"
msgstr "Lanĉo"
msgid "Open an issue"
msgstr "Malfermu numeron"
msgid "Print to PDF"
msgstr "Presi al PDF"
msgid "Source repository"
msgstr "Fonto-deponejo"
msgid "Sphinx Book Theme"
msgstr "Sfinksa Libro-Temo"
msgid "Theme by the"
msgstr "Temo de la"
msgid "Toggle navigation"
msgstr "Ŝalti navigadon"
msgid "next page"
msgstr "sekva paĝo"
msgid "open issue"
msgstr "malferma numero"
msgid "previous page"
msgstr "antaŭa paĝo"
msgid "repository"
msgstr "deponejo"
msgid "suggest edit"
msgstr "sugesti redaktadon"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Por el"
msgid "By"
msgstr "Por"
msgid "Contents"
msgstr "Contenido"
msgid "Copyright"
msgstr "Derechos de autor"
msgid "Download notebook file"
msgstr "Descargar archivo de cuaderno"
msgid "Download source file"
msgstr "Descargar archivo fuente"
msgid "Download this page"
msgstr "Descarga esta pagina"
msgid "Edit this page"
msgstr "Edita esta página"
msgid "Fullscreen mode"
msgstr "Modo de pantalla completa"
msgid "Last updated on"
msgstr "Ultima actualización en"
msgid "Launch"
msgstr "Lanzamiento"
msgid "Open an issue"
msgstr "Abrir un problema"
msgid "Print to PDF"
msgstr "Imprimir en PDF"
msgid "Source repository"
msgstr "Repositorio de origen"
msgid "Sphinx Book Theme"
msgstr "Tema del libro de la esfinge"
msgid "Theme by the"
msgstr "Tema por el"
msgid "Toggle navigation"
msgstr "Navegación de palanca"
msgid "next page"
msgstr "siguiente página"
msgid "open issue"
msgstr "Tema abierto"
msgid "previous page"
msgstr "pagina anterior"
msgid "repository"
msgstr "repositorio"
msgid "suggest edit"
msgstr "sugerir editar"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: et\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Autor"
msgid "By"
msgstr "Kõrval"
msgid "Contents"
msgstr "Sisu"
msgid "Copyright"
msgstr "Autoriõigus"
msgid "Download notebook file"
msgstr "Laadige sülearvuti fail alla"
msgid "Download source file"
msgstr "Laadige alla lähtefail"
msgid "Download this page"
msgstr "Laadige see leht alla"
msgid "Edit this page"
msgstr "Muutke seda lehte"
msgid "Fullscreen mode"
msgstr "Täisekraanirežiim"
msgid "Last updated on"
msgstr "Viimati uuendatud"
msgid "Launch"
msgstr "Käivitage"
msgid "Open an issue"
msgstr "Avage probleem"
msgid "Print to PDF"
msgstr "Prindi PDF-i"
msgid "Source repository"
msgstr "Allikahoidla"
msgid "Sphinx Book Theme"
msgstr "Sfinksiraamatu teema"
msgid "Theme by the"
msgstr "Teema"
msgid "Toggle navigation"
msgstr "Lülita navigeerimine sisse"
msgid "next page"
msgstr "järgmine leht"
msgid "open issue"
msgstr "avatud küsimus"
msgid "previous page"
msgstr "eelmine leht"
msgid "repository"
msgstr "hoidla"
msgid "suggest edit"
msgstr "soovita muuta"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Mukaan"
msgid "By"
msgstr "Tekijä"
msgid "Contents"
msgstr "Sisällys"
msgid "Copyright"
msgstr "Tekijänoikeus"
msgid "Download notebook file"
msgstr "Lataa muistikirjatiedosto"
msgid "Download source file"
msgstr "Lataa lähdetiedosto"
msgid "Download this page"
msgstr "Lataa tämä sivu"
msgid "Edit this page"
msgstr "Muokkaa tätä sivua"
msgid "Fullscreen mode"
msgstr "Koko näytön tila"
msgid "Last updated on"
msgstr "Viimeksi päivitetty"
msgid "Launch"
msgstr "Tuoda markkinoille"
msgid "Open an issue"
msgstr "Avaa ongelma"
msgid "Print to PDF"
msgstr "Tulosta PDF-tiedostoon"
msgid "Source repository"
msgstr "Lähteen arkisto"
msgid "Sphinx Book Theme"
msgstr "Sphinx-kirjan teema"
msgid "Theme by the"
msgstr "Teeman tekijä"
msgid "Toggle navigation"
msgstr "Vaihda navigointia"
msgid "next page"
msgstr "seuraava sivu"
msgid "open issue"
msgstr "avoin ongelma"
msgid "previous page"
msgstr "Edellinen sivu"
msgid "repository"
msgstr "arkisto"
msgid "suggest edit"
msgstr "ehdottaa muokkausta"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Par le"
msgid "By"
msgstr "Par"
msgid "Contents"
msgstr "Contenu"
msgid "Copyright"
msgstr "droits d'auteur"
msgid "Download notebook file"
msgstr "Télécharger le fichier notebook"
msgid "Download source file"
msgstr "Télécharger le fichier source"
msgid "Download this page"
msgstr "Téléchargez cette page"
msgid "Edit this page"
msgstr "Modifier cette page"
msgid "Fullscreen mode"
msgstr "Mode plein écran"
msgid "Last updated on"
msgstr "Dernière mise à jour le"
msgid "Launch"
msgstr "lancement"
msgid "Open an issue"
msgstr "Ouvrez un problème"
msgid "Print to PDF"
msgstr "Imprimer au format PDF"
msgid "Source repository"
msgstr "Dépôt source"
msgid "Sphinx Book Theme"
msgstr "Thème du livre Sphinx"
msgid "Theme by the"
msgstr "Thème par le"
msgid "Toggle navigation"
msgstr "Basculer la navigation"
msgid "next page"
msgstr "page suivante"
msgid "open issue"
msgstr "signaler un problème"
msgid "previous page"
msgstr "page précédente"
msgid "repository"
msgstr "dépôt"
msgid "suggest edit"
msgstr "suggestion de modification"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hr\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Od strane"
msgid "By"
msgstr "Po"
msgid "Contents"
msgstr "Sadržaj"
msgid "Copyright"
msgstr "Autorska prava"
msgid "Download notebook file"
msgstr "Preuzmi datoteku bilježnice"
msgid "Download source file"
msgstr "Preuzmi izvornu datoteku"
msgid "Download this page"
msgstr "Preuzmite ovu stranicu"
msgid "Edit this page"
msgstr "Uredite ovu stranicu"
msgid "Fullscreen mode"
msgstr "Način preko cijelog zaslona"
msgid "Last updated on"
msgstr "Posljednje ažuriranje:"
msgid "Launch"
msgstr "Pokrenite"
msgid "Open an issue"
msgstr "Otvorite izdanje"
msgid "Print to PDF"
msgstr "Ispis u PDF"
msgid "Source repository"
msgstr "Izvorno spremište"
msgid "Sphinx Book Theme"
msgstr "Tema knjige Sphinx"
msgid "Theme by the"
msgstr "Tema autora"
msgid "Toggle navigation"
msgstr "Uključi / isključi navigaciju"
msgid "next page"
msgstr "sljedeća stranica"
msgid "open issue"
msgstr "otvoreno izdanje"
msgid "previous page"
msgstr "Prethodna stranica"
msgid "repository"
msgstr "spremište"
msgid "suggest edit"
msgstr "predloži uređivanje"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: id\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Oleh"
msgid "By"
msgstr "Oleh"
msgid "Contents"
msgstr "Isi"
msgid "Copyright"
msgstr "hak cipta"
msgid "Download notebook file"
msgstr "Unduh file notebook"
msgid "Download source file"
msgstr "Unduh file sumber"
msgid "Download this page"
msgstr "Unduh halaman ini"
msgid "Edit this page"
msgstr "Edit halaman ini"
msgid "Fullscreen mode"
msgstr "Mode layar penuh"
msgid "Last updated on"
msgstr "Terakhir diperbarui saat"
msgid "Launch"
msgstr "Meluncurkan"
msgid "Open an issue"
msgstr "Buka masalah"
msgid "Print to PDF"
msgstr "Cetak ke PDF"
msgid "Source repository"
msgstr "Repositori sumber"
msgid "Sphinx Book Theme"
msgstr "Tema Buku Sphinx"
msgid "Theme by the"
msgstr "Tema oleh"
msgid "Toggle navigation"
msgstr "Alihkan navigasi"
msgid "next page"
msgstr "halaman selanjutnya"
msgid "open issue"
msgstr "masalah terbuka"
msgid "previous page"
msgstr "halaman sebelumnya"
msgid "repository"
msgstr "gudang"
msgid "suggest edit"
msgstr "menyarankan edit"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Dal"
msgid "By"
msgstr "Di"
msgid "Contents"
msgstr "Contenuti"
msgid "Copyright"
msgstr "Diritto d'autore"
msgid "Download notebook file"
msgstr "Scarica il file del taccuino"
msgid "Download source file"
msgstr "Scarica il file sorgente"
msgid "Download this page"
msgstr "Scarica questa pagina"
msgid "Edit this page"
msgstr "Modifica questa pagina"
msgid "Fullscreen mode"
msgstr "Modalità schermo intero"
msgid "Last updated on"
msgstr "Ultimo aggiornamento il"
msgid "Launch"
msgstr "Lanciare"
msgid "Open an issue"
msgstr "Apri un problema"
msgid "Print to PDF"
msgstr "Stampa in PDF"
msgid "Source repository"
msgstr "Repository di origine"
msgid "Sphinx Book Theme"
msgstr "Tema del libro della Sfinge"
msgid "Theme by the"
msgstr "Tema di"
msgid "Toggle navigation"
msgstr "Attiva / disattiva la navigazione"
msgid "next page"
msgstr "pagina successiva"
msgid "open issue"
msgstr "questione aperta"
msgid "previous page"
msgstr "pagina precedente"
msgid "repository"
msgstr "repository"
msgid "suggest edit"
msgstr "suggerisci modifica"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: iw\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "דרך"
msgid "By"
msgstr "על ידי"
msgid "Contents"
msgstr "תוכן"
msgid "Copyright"
msgstr "זכויות יוצרים"
msgid "Download notebook file"
msgstr "הורד קובץ מחברת"
msgid "Download source file"
msgstr "הורד את קובץ המקור"
msgid "Download this page"
msgstr "הורד דף זה"
msgid "Edit this page"
msgstr "ערוך דף זה"
msgid "Fullscreen mode"
msgstr "מצב מסך מלא"
msgid "Last updated on"
msgstr "עודכן לאחרונה ב"
msgid "Launch"
msgstr "לְהַשִׁיק"
msgid "Open an issue"
msgstr "פתח גיליון"
msgid "Print to PDF"
msgstr "הדפס לקובץ PDF"
msgid "Source repository"
msgstr "מאגר המקורות"
msgid "Sphinx Book Theme"
msgstr "נושא ספר ספינקס"
msgid "Theme by the"
msgstr "נושא מאת"
msgid "Toggle navigation"
msgstr "החלף ניווט"
msgid "next page"
msgstr "עמוד הבא"
msgid "open issue"
msgstr "בעיה פתוחה"
msgid "previous page"
msgstr "עמוד קודם"
msgid "repository"
msgstr "מאגר"
msgid "suggest edit"
msgstr "מציע לערוך"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "によって"
msgid "By"
msgstr "著者"
msgid "Contents"
msgstr "目次"
msgid "Copyright"
msgstr "Copyright"
msgid "Download notebook file"
msgstr "ノートブックファイルをダウンロード"
msgid "Download source file"
msgstr "ソースファイルをダウンロード"
msgid "Download this page"
msgstr "このページをダウンロード"
msgid "Edit this page"
msgstr "このページを編集"
msgid "Fullscreen mode"
msgstr "全画面モード"
msgid "Last updated on"
msgstr "最終更新日"
msgid "Launch"
msgstr "起動"
msgid "Open an issue"
msgstr "問題を報告"
msgid "Print to PDF"
msgstr "PDFに印刷"
msgid "Source repository"
msgstr "ソースリポジトリ"
msgid "Sphinx Book Theme"
msgstr "スフィンクスの本のテーマ"
msgid "Theme by the"
msgstr "のテーマ"
msgid "Toggle navigation"
msgstr "ナビゲーションを切り替え"
msgid "next page"
msgstr "次のページ"
msgid "open issue"
msgstr "未解決の問題"
msgid "previous page"
msgstr "前のページ"
msgid "repository"
msgstr "リポジトリ"
msgid "suggest edit"
msgstr "編集を提案する"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ko\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "에 의해"
msgid "By"
msgstr "으로"
msgid "Contents"
msgstr "내용"
msgid "Copyright"
msgstr "저작권"
msgid "Download notebook file"
msgstr "노트북 파일 다운로드"
msgid "Download source file"
msgstr "소스 파일 다운로드"
msgid "Download this page"
msgstr "이 페이지 다운로드"
msgid "Edit this page"
msgstr "이 페이지 편집"
msgid "Fullscreen mode"
msgstr "전체 화면으로보기"
msgid "Last updated on"
msgstr "마지막 업데이트"
msgid "Launch"
msgstr "시작하다"
msgid "Open an issue"
msgstr "이슈 열기"
msgid "Print to PDF"
msgstr "PDF로 인쇄"
msgid "Source repository"
msgstr "소스 저장소"
msgid "Sphinx Book Theme"
msgstr "스핑크스 도서 테마"
msgid "Theme by the"
msgstr "테마별"
msgid "Toggle navigation"
msgstr "탐색 전환"
msgid "next page"
msgstr "다음 페이지"
msgid "open issue"
msgstr "열린 문제"
msgid "previous page"
msgstr "이전 페이지"
msgid "repository"
msgstr "저장소"
msgid "suggest edit"
msgstr "편집 제안"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: lt\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Prie"
msgid "By"
msgstr "Iki"
msgid "Contents"
msgstr "Turinys"
msgid "Copyright"
msgstr "Autorių teisės"
msgid "Download notebook file"
msgstr "Atsisiųsti nešiojamojo kompiuterio failą"
msgid "Download source file"
msgstr "Atsisiųsti šaltinio failą"
msgid "Download this page"
msgstr "Atsisiųskite šį puslapį"
msgid "Edit this page"
msgstr "Redaguoti šį puslapį"
msgid "Fullscreen mode"
msgstr "Pilno ekrano režimas"
msgid "Last updated on"
msgstr "Paskutinį kartą atnaujinta"
msgid "Launch"
msgstr "Paleiskite"
msgid "Open an issue"
msgstr "Atidarykite problemą"
msgid "Print to PDF"
msgstr "Spausdinti į PDF"
msgid "Source repository"
msgstr "Šaltinio saugykla"
msgid "Sphinx Book Theme"
msgstr "Sfinkso knygos tema"
msgid "Theme by the"
msgstr "Tema"
msgid "Toggle navigation"
msgstr "Perjungti naršymą"
msgid "next page"
msgstr "Kitas puslapis"
msgid "open issue"
msgstr "atviras klausimas"
msgid "previous page"
msgstr "Ankstesnis puslapis"
msgid "repository"
msgstr "saugykla"
msgid "suggest edit"
msgstr "pasiūlyti redaguoti"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: lv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Ar"
msgid "By"
msgstr "Autors"
msgid "Contents"
msgstr "Saturs"
msgid "Copyright"
msgstr "Autortiesības"
msgid "Download notebook file"
msgstr "Lejupielādēt piezīmju grāmatiņu"
msgid "Download source file"
msgstr "Lejupielādēt avota failu"
msgid "Download this page"
msgstr "Lejupielādējiet šo lapu"
msgid "Edit this page"
msgstr "Rediģēt šo lapu"
msgid "Fullscreen mode"
msgstr "Pilnekrāna režīms"
msgid "Last updated on"
msgstr "Pēdējoreiz atjaunināts"
msgid "Launch"
msgstr "Uzsākt"
msgid "Open an issue"
msgstr "Atveriet problēmu"
msgid "Print to PDF"
msgstr "Drukāt PDF formātā"
msgid "Source repository"
msgstr "Avota krātuve"
msgid "Sphinx Book Theme"
msgstr "Sfinksa grāmatas tēma"
msgid "Theme by the"
msgstr "Autora tēma"
msgid "Toggle navigation"
msgstr "Pārslēgt navigāciju"
msgid "next page"
msgstr "nākamā lapaspuse"
msgid "open issue"
msgstr "atklāts jautājums"
msgid "previous page"
msgstr "iepriekšējā lapa"
msgid "repository"
msgstr "krātuve"
msgid "suggest edit"
msgstr "ieteikt rediģēt"

Binary file not shown.

View File

@@ -0,0 +1,66 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ml\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "എഴുതിയത്"
msgid "By"
msgstr "എഴുതിയത്"
msgid "Copyright"
msgstr "പകർപ്പവകാശം"
msgid "Download notebook file"
msgstr "നോട്ട്ബുക്ക് ഫയൽ ഡൺലോഡ് ചെയ്യുക"
msgid "Download source file"
msgstr "ഉറവിട ഫയൽ ഡൗൺലോഡുചെയ്യുക"
msgid "Download this page"
msgstr "ഈ പേജ് ഡൗൺലോഡുചെയ്യുക"
msgid "Edit this page"
msgstr "ഈ പേജ് എഡിറ്റുചെയ്യുക"
msgid "Last updated on"
msgstr "അവസാനം അപ്‌ഡേറ്റുചെയ്‌തത്"
msgid "Launch"
msgstr "സമാരംഭിക്കുക"
msgid "Open an issue"
msgstr "ഒരു പ്രശ്നം തുറക്കുക"
msgid "Print to PDF"
msgstr "PDF- ലേക്ക് പ്രിന്റുചെയ്യുക"
msgid "Source repository"
msgstr "ഉറവിട ശേഖരം"
msgid "Sphinx Book Theme"
msgstr "സ്ഫിങ്ക്സ് പുസ്തക തീം"
msgid "Theme by the"
msgstr "പ്രമേയം"
msgid "Toggle navigation"
msgstr "നാവിഗേഷൻ ടോഗിൾ ചെയ്യുക"
msgid "next page"
msgstr "അടുത്ത പേജ്"
msgid "open issue"
msgstr "തുറന്ന പ്രശ്നം"
msgid "previous page"
msgstr "മുൻപത്തെ താൾ"
msgid "suggest edit"
msgstr "എഡിറ്റുചെയ്യാൻ നിർദ്ദേശിക്കുക"

Binary file not shown.

View File

@@ -0,0 +1,66 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: mr\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "द्वारा"
msgid "By"
msgstr "द्वारा"
msgid "Copyright"
msgstr "कॉपीराइट"
msgid "Download notebook file"
msgstr "नोटबुक फाईल डाउनलोड करा"
msgid "Download source file"
msgstr "स्त्रोत फाइल डाउनलोड करा"
msgid "Download this page"
msgstr "हे पृष्ठ डाउनलोड करा"
msgid "Edit this page"
msgstr "हे पृष्ठ संपादित करा"
msgid "Last updated on"
msgstr "अखेरचे अद्यतनित"
msgid "Launch"
msgstr "लाँच करा"
msgid "Open an issue"
msgstr "एक मुद्दा उघडा"
msgid "Print to PDF"
msgstr "पीडीएफवर मुद्रित करा"
msgid "Source repository"
msgstr "स्त्रोत भांडार"
msgid "Sphinx Book Theme"
msgstr "स्फिंक्स बुक थीम"
msgid "Theme by the"
msgstr "द्वारा थीम"
msgid "Toggle navigation"
msgstr "नेव्हिगेशन टॉगल करा"
msgid "next page"
msgstr "पुढील पृष्ठ"
msgid "open issue"
msgstr "खुला मुद्दा"
msgid "previous page"
msgstr "मागील पान"
msgid "suggest edit"
msgstr "संपादन सुचवा"

Binary file not shown.

View File

@@ -0,0 +1,66 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ms\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Oleh"
msgid "By"
msgstr "Oleh"
msgid "Copyright"
msgstr "hak cipta"
msgid "Download notebook file"
msgstr "Muat turun fail buku nota"
msgid "Download source file"
msgstr "Muat turun fail sumber"
msgid "Download this page"
msgstr "Muat turun halaman ini"
msgid "Edit this page"
msgstr "Edit halaman ini"
msgid "Last updated on"
msgstr "Terakhir dikemas kini pada"
msgid "Launch"
msgstr "Lancarkan"
msgid "Open an issue"
msgstr "Buka masalah"
msgid "Print to PDF"
msgstr "Cetak ke PDF"
msgid "Source repository"
msgstr "Repositori sumber"
msgid "Sphinx Book Theme"
msgstr "Tema Buku Sphinx"
msgid "Theme by the"
msgstr "Tema oleh"
msgid "Toggle navigation"
msgstr "Togol navigasi"
msgid "next page"
msgstr "muka surat seterusnya"
msgid "open issue"
msgstr "isu terbuka"
msgid "previous page"
msgstr "halaman sebelumnya"
msgid "suggest edit"
msgstr "cadangkan edit"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Door de"
msgid "By"
msgstr "Door"
msgid "Contents"
msgstr "Inhoud"
msgid "Copyright"
msgstr "auteursrechten"
msgid "Download notebook file"
msgstr "Download notebookbestand"
msgid "Download source file"
msgstr "Download het bronbestand"
msgid "Download this page"
msgstr "Download deze pagina"
msgid "Edit this page"
msgstr "bewerk deze pagina"
msgid "Fullscreen mode"
msgstr "Volledig scherm"
msgid "Last updated on"
msgstr "Laatst geupdate op"
msgid "Launch"
msgstr "Lancering"
msgid "Open an issue"
msgstr "Open een probleem"
msgid "Print to PDF"
msgstr "Afdrukken naar pdf"
msgid "Source repository"
msgstr "Bronopslagplaats"
msgid "Sphinx Book Theme"
msgstr "Sphinx-boekthema"
msgid "Theme by the"
msgstr "Thema door de"
msgid "Toggle navigation"
msgstr "Schakel navigatie"
msgid "next page"
msgstr "volgende bladzijde"
msgid "open issue"
msgstr "open probleem"
msgid "previous page"
msgstr "vorige pagina"
msgid "repository"
msgstr "repository"
msgid "suggest edit"
msgstr "suggereren bewerken"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: no\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Ved"
msgid "By"
msgstr "Av"
msgid "Contents"
msgstr "Innhold"
msgid "Copyright"
msgstr "opphavsrett"
msgid "Download notebook file"
msgstr "Last ned notatbokfilen"
msgid "Download source file"
msgstr "Last ned kildefilen"
msgid "Download this page"
msgstr "Last ned denne siden"
msgid "Edit this page"
msgstr "Rediger denne siden"
msgid "Fullscreen mode"
msgstr "Fullskjerm-modus"
msgid "Last updated on"
msgstr "Sist oppdatert den"
msgid "Launch"
msgstr "Start"
msgid "Open an issue"
msgstr "Åpne et problem"
msgid "Print to PDF"
msgstr "Skriv ut til PDF"
msgid "Source repository"
msgstr "Kildedepot"
msgid "Sphinx Book Theme"
msgstr "Sphinx boktema"
msgid "Theme by the"
msgstr "Tema av"
msgid "Toggle navigation"
msgstr "Bytt navigasjon"
msgid "next page"
msgstr "neste side"
msgid "open issue"
msgstr "åpent nummer"
msgid "previous page"
msgstr "forrige side"
msgid "repository"
msgstr "oppbevaringssted"
msgid "suggest edit"
msgstr "foreslå redigering"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Przez"
msgid "By"
msgstr "Przez"
msgid "Contents"
msgstr "Zawartość"
msgid "Copyright"
msgstr "prawa autorskie"
msgid "Download notebook file"
msgstr "Pobierz plik notatnika"
msgid "Download source file"
msgstr "Pobierz plik źródłowy"
msgid "Download this page"
msgstr "Pobierz tę stronę"
msgid "Edit this page"
msgstr "Edytuj tę strone"
msgid "Fullscreen mode"
msgstr "Pełny ekran"
msgid "Last updated on"
msgstr "Ostatnia aktualizacja"
msgid "Launch"
msgstr "Uruchomić"
msgid "Open an issue"
msgstr "Otwórz problem"
msgid "Print to PDF"
msgstr "Drukuj do PDF"
msgid "Source repository"
msgstr "Repozytorium źródłowe"
msgid "Sphinx Book Theme"
msgstr "Motyw książki Sphinx"
msgid "Theme by the"
msgstr "Motyw autorstwa"
msgid "Toggle navigation"
msgstr "Przełącz nawigację"
msgid "next page"
msgstr "Następna strona"
msgid "open issue"
msgstr "otwarty problem"
msgid "previous page"
msgstr "Poprzednia strona"
msgid "repository"
msgstr "magazyn"
msgid "suggest edit"
msgstr "zaproponuj edycję"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pt\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Pelo"
msgid "By"
msgstr "De"
msgid "Contents"
msgstr "Conteúdo"
msgid "Copyright"
msgstr "direito autoral"
msgid "Download notebook file"
msgstr "Baixar arquivo de notebook"
msgid "Download source file"
msgstr "Baixar arquivo fonte"
msgid "Download this page"
msgstr "Baixe esta página"
msgid "Edit this page"
msgstr "Edite essa página"
msgid "Fullscreen mode"
msgstr "Modo tela cheia"
msgid "Last updated on"
msgstr "Última atualização em"
msgid "Launch"
msgstr "Lançamento"
msgid "Open an issue"
msgstr "Abra um problema"
msgid "Print to PDF"
msgstr "Imprimir em PDF"
msgid "Source repository"
msgstr "Repositório fonte"
msgid "Sphinx Book Theme"
msgstr "Tema do livro Sphinx"
msgid "Theme by the"
msgstr "Tema por"
msgid "Toggle navigation"
msgstr "Alternar de navegação"
msgid "next page"
msgstr "próxima página"
msgid "open issue"
msgstr "questão aberta"
msgid "previous page"
msgstr "página anterior"
msgid "repository"
msgstr "repositório"
msgid "suggest edit"
msgstr "sugerir edição"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ro\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Langa"
msgid "By"
msgstr "De"
msgid "Contents"
msgstr "Cuprins"
msgid "Copyright"
msgstr "Drepturi de autor"
msgid "Download notebook file"
msgstr "Descărcați fișierul notebook"
msgid "Download source file"
msgstr "Descărcați fișierul sursă"
msgid "Download this page"
msgstr "Descarcă această pagină"
msgid "Edit this page"
msgstr "Editați această pagină"
msgid "Fullscreen mode"
msgstr "Modul ecran întreg"
msgid "Last updated on"
msgstr "Ultima actualizare la"
msgid "Launch"
msgstr "Lansa"
msgid "Open an issue"
msgstr "Deschideți o problemă"
msgid "Print to PDF"
msgstr "Imprimați în PDF"
msgid "Source repository"
msgstr "Depozit sursă"
msgid "Sphinx Book Theme"
msgstr "Tema Sphinx Book"
msgid "Theme by the"
msgstr "Tema de"
msgid "Toggle navigation"
msgstr "Comutare navigare"
msgid "next page"
msgstr "pagina următoare"
msgid "open issue"
msgstr "problema deschisă"
msgid "previous page"
msgstr "pagina anterioară"
msgid "repository"
msgstr "repertoriu"
msgid "suggest edit"
msgstr "sugerează editare"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Посредством"
msgid "By"
msgstr "Автор:"
msgid "Contents"
msgstr "Содержание"
msgid "Copyright"
msgstr "авторское право"
msgid "Download notebook file"
msgstr "Скачать файл записной книжки"
msgid "Download source file"
msgstr "Скачать исходный файл"
msgid "Download this page"
msgstr "Загрузите эту страницу"
msgid "Edit this page"
msgstr "Редактировать эту страницу"
msgid "Fullscreen mode"
msgstr "Полноэкранный режим"
msgid "Last updated on"
msgstr "Последнее обновление"
msgid "Launch"
msgstr "Запуск"
msgid "Open an issue"
msgstr "Открыть вопрос"
msgid "Print to PDF"
msgstr "Распечатать в PDF"
msgid "Source repository"
msgstr "Исходный репозиторий"
msgid "Sphinx Book Theme"
msgstr "Тема книги Сфинкс"
msgid "Theme by the"
msgstr "Тема от"
msgid "Toggle navigation"
msgstr "Переключить навигацию"
msgid "next page"
msgstr "Следующая страница"
msgid "open issue"
msgstr "открытый вопрос"
msgid "previous page"
msgstr "Предыдущая страница"
msgid "repository"
msgstr "хранилище"
msgid "suggest edit"
msgstr "предложить редактировать"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sk\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Podľa"
msgid "By"
msgstr "Autor:"
msgid "Contents"
msgstr "Obsah"
msgid "Copyright"
msgstr "Autorské práva"
msgid "Download notebook file"
msgstr "Stiahnite si zošit"
msgid "Download source file"
msgstr "Stiahnite si zdrojový súbor"
msgid "Download this page"
msgstr "Stiahnite si túto stránku"
msgid "Edit this page"
msgstr "Upraviť túto stránku"
msgid "Fullscreen mode"
msgstr "Režim celej obrazovky"
msgid "Last updated on"
msgstr "Posledná aktualizácia dňa"
msgid "Launch"
msgstr "Spustiť"
msgid "Open an issue"
msgstr "Otvorte problém"
msgid "Print to PDF"
msgstr "Tlač do PDF"
msgid "Source repository"
msgstr "Zdrojové úložisko"
msgid "Sphinx Book Theme"
msgstr "Téma knihy Sfinga"
msgid "Theme by the"
msgstr "Téma od"
msgid "Toggle navigation"
msgstr "Prepnúť navigáciu"
msgid "next page"
msgstr "ďalšia strana"
msgid "open issue"
msgstr "otvorené vydanie"
msgid "previous page"
msgstr "predchádzajúca strana"
msgid "repository"
msgstr "Úložisko"
msgid "suggest edit"
msgstr "navrhnúť úpravu"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Avtor"
msgid "By"
msgstr "Avtor"
msgid "Contents"
msgstr "Vsebina"
msgid "Copyright"
msgstr "avtorske pravice"
msgid "Download notebook file"
msgstr "Prenesite datoteko zvezka"
msgid "Download source file"
msgstr "Prenesite izvorno datoteko"
msgid "Download this page"
msgstr "Prenesite to stran"
msgid "Edit this page"
msgstr "Uredite to stran"
msgid "Fullscreen mode"
msgstr "Celozaslonski način"
msgid "Last updated on"
msgstr "Nazadnje posodobljeno dne"
msgid "Launch"
msgstr "Kosilo"
msgid "Open an issue"
msgstr "Odprite številko"
msgid "Print to PDF"
msgstr "Natisni v PDF"
msgid "Source repository"
msgstr "Izvorno skladišče"
msgid "Sphinx Book Theme"
msgstr "Tema knjige Sphinx"
msgid "Theme by the"
msgstr "Tema avtorja"
msgid "Toggle navigation"
msgstr "Preklopi navigacijo"
msgid "next page"
msgstr "Naslednja stran"
msgid "open issue"
msgstr "odprto vprašanje"
msgid "previous page"
msgstr "Prejšnja stran"
msgid "repository"
msgstr "odlagališče"
msgid "suggest edit"
msgstr "predlagajte urejanje"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sr\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Од"
msgid "By"
msgstr "Од стране"
msgid "Contents"
msgstr "Садржај"
msgid "Copyright"
msgstr "Ауторско право"
msgid "Download notebook file"
msgstr "Преузмите датотеку бележнице"
msgid "Download source file"
msgstr "Преузми изворну датотеку"
msgid "Download this page"
msgstr "Преузмите ову страницу"
msgid "Edit this page"
msgstr "Уредите ову страницу"
msgid "Fullscreen mode"
msgstr "Режим целог екрана"
msgid "Last updated on"
msgstr "Последње ажурирање"
msgid "Launch"
msgstr "Лансирање"
msgid "Open an issue"
msgstr "Отворите издање"
msgid "Print to PDF"
msgstr "Испис у ПДФ"
msgid "Source repository"
msgstr "Изворно спремиште"
msgid "Sphinx Book Theme"
msgstr "Тема књиге Спхинк"
msgid "Theme by the"
msgstr "Тхеме би"
msgid "Toggle navigation"
msgstr "Укључи / искључи навигацију"
msgid "next page"
msgstr "Следећа страна"
msgid "open issue"
msgstr "отворено издање"
msgid "previous page"
msgstr "Претходна страница"
msgid "repository"
msgstr "спремиште"
msgid "suggest edit"
msgstr "предложи уређивање"

Binary file not shown.

View File

@@ -0,0 +1,75 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "Av den"
msgid "By"
msgstr "Av"
msgid "Contents"
msgstr "Innehåll"
msgid "Copyright"
msgstr "Upphovsrätt"
msgid "Download notebook file"
msgstr "Ladda ner notebook-fil"
msgid "Download source file"
msgstr "Ladda ner källfil"
msgid "Download this page"
msgstr "Ladda ner den här sidan"
msgid "Edit this page"
msgstr "Redigera den här sidan"
msgid "Fullscreen mode"
msgstr "Fullskärmsläge"
msgid "Last updated on"
msgstr "Senast uppdaterad den"
msgid "Launch"
msgstr "Öppna"
msgid "Open an issue"
msgstr "Öppna en problemrapport"
msgid "Print to PDF"
msgstr "Skriv ut till PDF"
msgid "Source repository"
msgstr "Källkodsrepositorium"
msgid "Sphinx Book Theme"
msgstr "Sphinx Boktema"
msgid "Theme by the"
msgstr "Tema av"
msgid "Toggle navigation"
msgstr "Växla navigering"
msgid "next page"
msgstr "nästa sida"
msgid "open issue"
msgstr "öppna problemrapport"
msgid "previous page"
msgstr "föregående sida"
msgid "repository"
msgstr "repositorium"
msgid "suggest edit"
msgstr "föreslå ändring"

Binary file not shown.

View File

@@ -0,0 +1,66 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ta\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "மூலம்"
msgid "By"
msgstr "வழங்கியவர்"
msgid "Copyright"
msgstr "பதிப்புரிமை"
msgid "Download notebook file"
msgstr "நோட்புக் கோப்பைப் பதிவிறக்கவும்"
msgid "Download source file"
msgstr "மூல கோப்பைப் பதிவிறக்குக"
msgid "Download this page"
msgstr "இந்தப் பக்கத்தைப் பதிவிறக்கவும்"
msgid "Edit this page"
msgstr "இந்தப் பக்கத்தைத் திருத்தவும்"
msgid "Last updated on"
msgstr "கடைசியாக புதுப்பிக்கப்பட்டது"
msgid "Launch"
msgstr "தொடங்க"
msgid "Open an issue"
msgstr "சிக்கலைத் திறக்கவும்"
msgid "Print to PDF"
msgstr "PDF இல் அச்சிடுக"
msgid "Source repository"
msgstr "மூல களஞ்சியம்"
msgid "Sphinx Book Theme"
msgstr "ஸ்பிங்க்ஸ் புத்தக தீம்"
msgid "Theme by the"
msgstr "வழங்கிய தீம்"
msgid "Toggle navigation"
msgstr "வழிசெலுத்தலை நிலைமாற்று"
msgid "next page"
msgstr "அடுத்த பக்கம்"
msgid "open issue"
msgstr "திறந்த பிரச்சினை"
msgid "previous page"
msgstr "முந்தைய பக்கம்"
msgid "suggest edit"
msgstr "திருத்த பரிந்துரைக்கவும்"

Binary file not shown.

View File

@@ -0,0 +1,66 @@
msgid ""
msgstr ""
"Project-Id-Version: Sphinx-Book-Theme\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: te\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "By the"
msgstr "ద్వారా"
msgid "By"
msgstr "ద్వారా"
msgid "Copyright"
msgstr "కాపీరైట్"
msgid "Download notebook file"
msgstr "నోట్బుక్ ఫైల్ను డౌన్లోడ్ చేయండి"
msgid "Download source file"
msgstr "మూల ఫైల్‌ను డౌన్‌లోడ్ చేయండి"
msgid "Download this page"
msgstr "ఈ పేజీని డౌన్‌లోడ్ చేయండి"
msgid "Edit this page"
msgstr "ఈ పేజీని సవరించండి"
msgid "Last updated on"
msgstr "చివరిగా నవీకరించబడింది"
msgid "Launch"
msgstr "ప్రారంభించండి"
msgid "Open an issue"
msgstr "సమస్యను తెరవండి"
msgid "Print to PDF"
msgstr "PDF కి ముద్రించండి"
msgid "Source repository"
msgstr "మూల రిపోజిటరీ"
msgid "Sphinx Book Theme"
msgstr "సింహిక పుస్తక థీమ్"
msgid "Theme by the"
msgstr "ద్వారా థీమ్"
msgid "Toggle navigation"
msgstr "నావిగేషన్‌ను టోగుల్ చేయండి"
msgid "next page"
msgstr "తరువాతి పేజీ"
msgid "open issue"
msgstr "ఓపెన్ ఇష్యూ"
msgid "previous page"
msgstr "ముందు పేజి"
msgid "suggest edit"
msgstr "సవరించమని సూచించండి"

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More