Skip to content

Commit

Permalink
feat: migrate to html copy, searching and improved fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
cuppajoeman committed Oct 14, 2024
1 parent 395c2c9 commit f89a89a
Show file tree
Hide file tree
Showing 539 changed files with 20,880 additions and 73,022 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
node_modules
openmath_startup.vim
__pycache__
generated_html
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "scripts/precompiled_html_generation_new/fast-html"]
path = scripts/precompiled_html_generation_new/fast-html
url = [email protected]:simple-web-tools/fast-html.git
[submodule "html/js/search"]
path = html/js/search
url = [email protected]:simple-web-tools/search.git
[submodule "html/styles/math-fonts"]
path = html/styles/math-fonts
url = [email protected]:simple-web-tools/math-fonts.git
38 changes: 38 additions & 0 deletions extract_thin_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import os
from bs4 import BeautifulSoup

def extract_thin_wrapper(file_path):
"""Extracts the content of the thin-wrapper div from an HTML file."""
try:
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()

# Parse the HTML
soup = BeautifulSoup(content, 'html.parser')

# Extract the content of the thin-wrapper div
thin_wrapper = soup.find('div', class_='thin-wrapper')
print(file_path)

if thin_wrapper:
# Overwrite the original file with the extracted content
with open(file_path, 'w', encoding='utf-8') as file:
file.write(str(thin_wrapper.decode_contents()).replace("&", "&"))
print(f"Updated: {file_path}")
else:
print(f"No <div class='thin-wrapper'> found in {file_path}.")
except Exception as e:
print(f"Error processing {file_path}: {e}")

def process_directory(directory):
"""Recursively processes all HTML files in the given directory."""
for root, _, files in os.walk(directory):
for file in files:
if file.endswith('.html'):
file_path = os.path.join(root, file)
extract_thin_wrapper(file_path)

if __name__ == "__main__":
# Specify the directory containing HTML files
directory_path = 'html_copy' # Replace with your directory path
process_directory(directory_path)
410 changes: 187 additions & 223 deletions html/algebra/complex/algebra_of_the_complex_plane.html

Large diffs are not rendered by default.

399 changes: 182 additions & 217 deletions html/algebra/complex/complex_numbers.html

Large diffs are not rendered by default.

221 changes: 87 additions & 134 deletions html/algebra/fields.html

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions html/algebra/galois_theory/classical_formulas.html
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
317 changes: 117 additions & 200 deletions html/algebra/galois_theory/domains_and_fields.html

Large diffs are not rendered by default.

253 changes: 62 additions & 191 deletions html/algebra/galois_theory/homomorphisms.html

Large diffs are not rendered by default.

534 changes: 211 additions & 323 deletions html/algebra/galois_theory/ideals.html

Large diffs are not rendered by default.

67 changes: 32 additions & 35 deletions html/algebra/galois_theory/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Galois Theory</title>

<link rel="stylesheet" href="/styles/styles.css">
<script src="/js/script.js" defer></script>

</head>
<body>

<div class="thin-wrapper">
<fieldset>
<legend><h1>Galois Theory</h1></legend>
<ul>
<li><a href="rings.html">Rings</a></li>
<li><a href="domains_and_fields.html">Domains and Fields</a></li>
<li><a href="homomorphisms.html">Homomorphisms</a></li>
<li><a href="ideals.html">Ideals</a></li>
<li><a href="quotient_rings.html">Quotient Rings</a></li>
<li><a href="polynomial_rings_over_fields.html">Polynomial Rings over Fields</a></li>
<li><a href="prime_ideals_and_maximal_ideals.html">Prime Ideals and Maximal Ideals</a></li>
<li><a href="splitting_fields.html">Splitting Fields</a></li>
<li><a href="the_galois_group.html">The Galois Group</a></li>
</ul>
</fieldset>

</div>

</body>
</html>
<fieldset>
<h1><legend>Galois Theory</legend></h1>
<ul>
<li>
<a href="rings.html">Rings</a>
</li>
<li>
<a href="domains_and_fields.html">Domains and Fields</a>
</li>
<li>
<a href="homomorphisms.html">Homomorphisms</a>
</li>
<li>
<a href="ideals.html">Ideals</a>
</li>
<li>
<a href="quotient_rings.html">Quotient Rings</a>
</li>
<li>
<a href="polynomial_rings_over_fields.html">Polynomial Rings over Fields</a>
</li>
<li>
<a href="prime_ideals_and_maximal_ideals.html">Prime Ideals and Maximal Ideals</a>
</li>
<li>
<a href="splitting_fields.html">Splitting Fields</a>
</li>
<li>
<a href="the_galois_group.html">The Galois Group</a>
</li>
</ul>
</fieldset>
9 changes: 0 additions & 9 deletions html/algebra/galois_theory/irreducible_polynomials.html
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
180 changes: 72 additions & 108 deletions html/algebra/galois_theory/polynomial_rings_over_fields.html
Original file line number Diff line number Diff line change
@@ -1,108 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Polynomial Rings over Fields</title>
<script src="/js/script.js"></script>
<link rel="stylesheet" href="/styles/styles.css">
</head>
<body>
<div class="thin-wrapper">

<div class="definition" id="definition-gcd-for-polynomials">
<div class="title">GCD for Polynomials</div>
<div class="content">
Let \(R\) be a domain, and let \(f(x), g(x) \in R[x]\). The greatest common divisor (gcd) of \(f(x)\) and \(g(x)\) is a polynomial \(d(x) \in R[x]\) such that:
<ul>
<li>
\(d(x)\) is a common divisor of \(f(x)\) and \(g(x)\); that is, \(d \mid f\) and \(d \mid g\);
</li>
<li>
if \(c(x)\) is any common divisor of \(f(x)\) and \(g(x)\), then \(c(x) \mid d(x)\);
</li>
<li>
\(d(x)\) is monic.
</li>
</ul>
</div>
</div>

<div class="corollary" id="corollary-gcd-for-polynomials-is-unique">
<div class="title">GCD for Polynomials Is Unique</div>
<div class="content">
As per title.
</div>
<div class="proof">
<p>
Note that gcd (denoted by \(d\)) of \(f\) and \(g\), if it exists, is unique. If we had \(d^{\prime}\) which is another gcd, then since it also divides both polynomials we know that \(d^{\prime} \mid d\).
</p>
<p>
Similarly, \(d \mid d^{\prime}\) if one regards \(d\) merely as a common divisor. By Exercise 4, \(d^{\prime}=u d\) for some unit \(u \in F[x]\); that is, \(d^{\prime}=u d\) for some nonzero constant \(u\) (prove why). Since \(d\) and \(d^{\prime}\) are both monic, however, \(u=1\) and \(d^{\prime}=d\).
</p>
</div>
</div>

<div class="proposition" id="proposition-gcd-as-a-linear-combination">
<div class="title">GCD as a Linear Combination</div>
<div class="content">
Let \(F\) be a field and let \(f(x), g(x) \in F[x]\) with \(g(x) \neq 0\). Then the \(\operatorname{gcd}(f(x), g(x))=d(x)\) exists, and it is a linear combination of \(f(x)\) and \(g(x)\); that is, there are polynomials \(a(x)\) and \(b(x)\) with
\[
d(x)=a(x) f(x)+b(x) g(x)
\]
</div>
<div class="proof">

</div>
</div>

<div class="proposition" id="proposition-every-polynomial-ideal-is-principal">
<div class="title">Every Polynomial Ideal is Principal</div>
<div class="content">
If \( F \) is a field, then every ideal in \( F \left[ x \right] \) is a principal ideal
</div>
<div class="proof">

</div>
</div>

<div class="definition" id="definition-principal-ideal-domain">
<div class="title">Principal Ideal Domain</div>
<div class="content">
A crone \( R \) is called a <b>principal ideal domain</b> if it is a domain such that every ideal is a principal ideal.
</div>
</div>

<div class="exercise" id="exercise-the-integers-are-a-principal-ideal-domain">
<div class="title">Show that \( \mathbb{ Z } \) is a Principal Ideal Domain</div>
<div class="content">
As per title.
</div>
<div class="proof">

</div>
</div>

<div class="theorem" id="theorem-if-F-is-a-field-then-F[x]-is-a-pid">
<div class="title">If \( F \) is a Field then \( F \left[ x \right] \) is a Principal Ideal Domain</div>
<div class="content">
As per title.
</div>
<div class="proof">
<p>
Let \( I \) be an ideal in \( F \left[ x \right] \), if \( I = \left\{ 0 \right\} \) then \( I = \left( 0 \right) _ \diamond \), which shows that it is a principal ideal. Now suppose that \( I \neq \left\{ 0 \right\} \), and let \( m \left( x \right) \in I \) of smallest degree, we'll show that \( I = \left( m \left( x \right) \right) _ \diamond \).
</p>
<p>
We can see that \( \left( m \left( x \right) \right) _ \diamond \subseteq I \) because for any element in an ideal, all of it's multiples are a part of it. Looking at \( \left( m \left( x \right) \right) _ \diamond \supseteq I \), then given some \( f \left( x \right) \in I \) then by the division algorithm we have \( q \left( x \right) , r \left( x \right) \) such that
\[
f \left( x \right) = q \left( x \right) m \left( x \right) + r \left( x \right)
\]
where either \( r \left( x \right) = 0 \) or \( \operatorname{ deg } \left( r \right) \lt \operatorname{ deg } \left( m \right) \) but then \( r \left( x \right) = f \left( x \right) - q \left( x \right) m \left( x \right) \in I \). Now if \( \operatorname{ deg } \left( r \right) \lt \operatorname{ deg } \left( m \right) \) then we've found a polynomial with a smaller degree than \( m \left( x \right) \) in \( I \) (namely \( r \left( x \right) \)), so therefore we must have that \( r \left( x \right) = 0 \) which means that \( f \left( x \right) = q \left( x \right) m \left( x \right) \in \left( m \left( x \right) \right) _ \diamond \).
</p>
</div>
</div>



</div>
</body>
</html>
<div class="definition" id="definition-gcd-for-polynomials">
<div class="title">
GCD for Polynomials
</div>
<div class="content">
Let \(R\) be a domain, and let \(f(x), g(x) \in R[x]\). The greatest common divisor (gcd) of \(f(x)\) and \(g(x)\) is a polynomial \(d(x) \in R[x]\) such that:
<ul>
<li>\(d(x)\) is a common divisor of \(f(x)\) and \(g(x)\); that is, \(d \mid f\) and \(d \mid g\);</li>
<li>if \(c(x)\) is any common divisor of \(f(x)\) and \(g(x)\), then \(c(x) \mid d(x)\);</li>
<li>\(d(x)\) is monic.</li>
</ul>
</div>
</div>
<div class="corollary" id="corollary-gcd-for-polynomials-is-unique">
<div class="title">
GCD for Polynomials Is Unique
</div>
<div class="content">
As per title.
</div>
<div class="proof">
<p>Note that gcd (denoted by \(d\)) of \(f\) and \(g\), if it exists, is unique. If we had \(d^{\prime}\) which is another gcd, then since it also divides both polynomials we know that \(d^{\prime} \mid d\).</p>
<p>Similarly, \(d \mid d^{\prime}\) if one regards \(d\) merely as a common divisor. By Exercise 4, \(d^{\prime}=u d\) for some unit \(u \in F[x]\); that is, \(d^{\prime}=u d\) for some nonzero constant \(u\) (prove why). Since \(d\) and \(d^{\prime}\) are both monic, however, \(u=1\) and \(d^{\prime}=d\).</p>
</div>
</div>
<div class="proposition" id="proposition-gcd-as-a-linear-combination">
<div class="title">
GCD as a Linear Combination
</div>
<div class="content">
Let \(F\) be a field and let \(f(x), g(x) \in F[x]\) with \(g(x) \neq 0\). Then the \(\operatorname{gcd}(f(x), g(x))=d(x)\) exists, and it is a linear combination of \(f(x)\) and \(g(x)\); that is, there are polynomials \(a(x)\) and \(b(x)\) with \[ d(x)=a(x) f(x)+b(x) g(x) \]
</div>
<div class="proof"></div>
</div>
<div class="proposition" id="proposition-every-polynomial-ideal-is-principal">
<div class="title">
Every Polynomial Ideal is Principal
</div>
<div class="content">
If \( F \) is a field, then every ideal in \( F \left[ x \right] \) is a principal ideal
</div>
<div class="proof"></div>
</div>
<div class="definition" id="definition-principal-ideal-domain">
<div class="title">
Principal Ideal Domain
</div>
<div class="content">
A crone \( R \) is called a <b>principal ideal domain</b> if it is a domain such that every ideal is a principal ideal.
</div>
</div>
<div class="exercise" id="exercise-the-integers-are-a-principal-ideal-domain">
<div class="title">
Show that \( \mathbb{ Z } \) is a Principal Ideal Domain
</div>
<div class="content">
As per title.
</div>
<div class="proof"></div>
</div>
<div class="theorem" id="theorem-if-F-is-a-field-then-F[x]-is-a-pid">
<div class="title">
If \( F \) is a Field then \( F \left[ x \right] \) is a Principal Ideal Domain
</div>
<div class="content">
As per title.
</div>
<div class="proof">
<p>Let \( I \) be an ideal in \( F \left[ x \right] \), if \( I = \left\{ 0 \right\} \) then \( I = \left( 0 \right) _ \diamond \), which shows that it is a principal ideal. Now suppose that \( I \neq \left\{ 0 \right\} \), and let \( m \left( x \right) \in I \) of smallest degree, we'll show that \( I = \left( m \left( x \right) \right) _ \diamond \).</p>
<p>We can see that \( \left( m \left( x \right) \right) _ \diamond \subseteq I \) because for any element in an ideal, all of it's multiples are a part of it. Looking at \( \left( m \left( x \right) \right) _ \diamond \supseteq I \), then given some \( f \left( x \right) \in I \) then by the division algorithm we have \( q \left( x \right) , r \left( x \right) \) such that \[ f \left( x \right) = q \left( x \right) m \left( x \right) + r \left( x \right) \] where either \( r \left( x \right) = 0 \) or \( \operatorname{ deg } \left( r \right) \lt \operatorname{ deg } \left( m \right) \) but then \( r \left( x \right) = f \left( x \right) - q \left( x \right) m \left( x \right) \in I \). Now if \( \operatorname{ deg } \left( r \right) \lt \operatorname{ deg } \left( m \right) \) then we've found a polynomial with a smaller degree than \( m \left( x \right) \) in \( I \) (namely \( r \left( x \right) \)), so therefore we must have that \( r \left( x \right) = 0 \) which means that \( f \left( x \right) = q \left( x \right) m \left( x \right) \in \left( m \left( x \right) \right) _ \diamond \).</p>
</div>
</div>
Loading

0 comments on commit f89a89a

Please sign in to comment.