Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mopolz2 committed Dec 5, 2024
2 parents c6f244c + 86a4c2e commit fbe4dc6
Show file tree
Hide file tree
Showing 51 changed files with 13,296 additions and 400 deletions.
16 changes: 15 additions & 1 deletion cbtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def explore_dir_and_move(home, dir):
"href=\"/sta/": "href=\"../sta/",
"href=\"/sol/": "href=\"../sol/",
"href=\"/dyn/": "href=\"../dyn/",
"\"link\":\"/sta": "\"link\":\"../sta",
"\"link\":\"/dyn": "\"link\":\"../dyn",
"\"link\":\"/sol": "\"link\":\"../sol",
"href=\"/about/\"": "href=\"../about.html\"",
"href=\"/about\"": "href=\"../about.html\"",
"src=\"/about/": "src=\"../about/",
Expand All @@ -116,7 +119,11 @@ def explore_dir_and_move(home, dir):
"src=\"/Statics/": "src=\"../Statics/",
"src=\"/Solid_Mechanics/": "src=\"../Solid_Mechanics/",
"src=\"/Dynamics/": "src=\"../Dynamics/",
"href=\"${e['item']['link']}\"": "href=\"..${e['item']['link']}\""
"href=\"${e['item']['link']}\"": "href=\"..${e['item']['link']}\"",
"url(/fonts/source-sans-pro/SourceSansPro-Regular.otf": "url(../fonts/source-sans-pro/SourceSansPro-Regular.otf",
"url(/fonts/source-sans-pro/SourceSansPro-Semibold.otf": "url(../fonts/source-sans-pro/SourceSansPro-Semibold.otf",
"url(/fonts/source-sans-pro/SourceSansPro-Bold.otf": "url(../fonts/source-sans-pro/SourceSansPro-Bold.otf",
"url(/fonts/Montserrat-Bold.ttf": "url(../fonts/Montserrat-Bold.ttf"
}

all_content_pages = os.listdir(os.path.join(home, 'sta')) + os.listdir(os.path.join(home, 'sol')) + os.listdir(os.path.join(home, 'dyn'))
Expand Down Expand Up @@ -173,6 +180,9 @@ def explore_dir_and_move(home, dir):
"href=\"/sta/": "href=\"./sta/",
"href=\"/sol/": "href=\"./sol/",
"href=\"/dyn/": "href=\"./dyn/",
"\"link\":\"/sta": "\"link\":\"./sta",
"\"link\":\"/dyn": "\"link\":\"./dyn",
"\"link\":\"/sol": "\"link\":\"./sol",
"src=\"/Statics/": "src=\"./Statics/",
"src=\"/Solid_Mechanics/": "src=\"./Solid_Mechanics/",
"src=\"/Dynamics/": "src=\"./Dynamics/",
Expand All @@ -182,6 +192,10 @@ def explore_dir_and_move(home, dir):
"href=\"/about/\"": "href=\"./about.html\"",
"href=\"/about\"": "href=\"./about.html\"",
"src=\"/about/": "src=\"./about/",
"url(/fonts/source-sans-pro/SourceSansPro-Regular.otf": "url(./fonts/source-sans-pro/SourceSansPro-Regular.otf",
"url(/fonts/source-sans-pro/SourceSansPro-Semibold.otf": "url(./fonts/source-sans-pro/SourceSansPro-Semibold.otf",
"url(/fonts/source-sans-pro/SourceSansPro-Bold.otf": "url(./fonts/source-sans-pro/SourceSansPro-Bold.otf",
"url(/fonts/Montserrat-Bold.ttf": "url(./fonts/Montserrat-Bold.ttf"
}

all_content_pages = os.listdir(os.path.join(home, 'sta')) + os.listdir(os.path.join(home, 'sol')) + os.listdir(os.path.join(home, 'dyn'))
Expand Down
95 changes: 40 additions & 55 deletions dev_tools/create_search_index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,68 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"sta/moments\n",
"sta/introduction\n",
"sta/cartesian_coordinates\n",
"sta/force_systems\n",
"sta/vectors_scalars\n",
"sta/reaction_forces\n",
"sta/trusses\n",
"sta/frames_and_machines\n",
"sta/pltips\n",
"sta/free_body_diagrams\n",
"sta/friction\n",
"sta/shear_moment_diagrams\n",
"sta/moment_of_inertia\n",
"sta/virtual_work\n",
"sta/centers_of_mass\n",
"sta/hydrostatic_fluid_pressure\n",
"sol/axial_loading\n",
"sol/combined_loading\n",
"sol/material_properties\n",
"sol/pressure_vessels\n",
"sol/strain\n",
"sol/stress\n",
"sol/material_properties\n",
"sol/axial_loading\n",
"sol/transverse_shear\n",
"sol/torsion\n",
"sol/shear_moment_diagrams\n",
"sol/bending\n",
"sol/transverse_shear\n",
"sol/pressure_vessels\n",
"sol/combined_loading\n",
"sol/stress_transformation\n",
"dyn/vectors\n",
"sol/beam_deflection\n",
"sol/buckling\n",
"sol/bending\n",
"sol/failure_theories\n",
"dyn/vector_calculus\n",
"dyn/vectors\n",
"dyn/particle_kinetics\n",
"dyn/particle_kinematics\n",
"dyn/rigid_body_kinematics\n",
"dyn/rigid_body_kinetics\n",
"dyn/contact_and_rolling\n",
"sta/introduction\n",
"sta/cartesian_coordinates\n",
"sta/vectors_scalars\n",
"sta/free_body_diagrams\n",
"sta/moments\n",
"sta/force_systems\n",
"sta/reaction_forces\n",
"sta/shear_moment_diagrams\n",
"sta/trusses\n",
"sta/frames_and_machines\n",
"sta/friction\n",
"sta/centers_of_mass\n"
"dyn/work_and_energy\n",
"dyn/rigid_body_kinematics\n",
"dyn/rigid_body_kinetics\n"
]
}
],
"source": [
"import requests\n",
"from bs4 import BeautifulSoup\n",
"import json\n",
"import os\n",
"\n",
"pwd = os.path.dirname(os.getcwd())\n",
"\n",
"searchable_pages = []\n",
"\n",
"searchable_pages = [\n",
" \"sol/strain\",\n",
" \"sol/stress\",\n",
" \"sol/material_properties\",\n",
" \"sol/axial_loading\",\n",
" \"sol/torsion\",\n",
" \"sol/shear_moment_diagrams\",\n",
" \"sol/bending\",\n",
" \"sol/transverse_shear\",\n",
" \"sol/pressure_vessels\",\n",
" \"sol/combined_loading\",\n",
" \"sol/stress_transformation\",\n",
" \"dyn/vectors\",\n",
" \"dyn/vector_calculus\",\n",
" \"dyn/particle_kinetics\",\n",
" 'dyn/particle_kinematics',\n",
" 'dyn/rigid_body_kinematics',\n",
" 'dyn/rigid_body_kinetics',\n",
" 'dyn/contact_and_rolling',\n",
" \"sta/introduction\",\n",
" \"sta/cartesian_coordinates\",\n",
" \"sta/vectors_scalars\",\n",
" \"sta/free_body_diagrams\",\n",
" \"sta/moments\",\n",
" \"sta/force_systems\",\n",
" \"sta/reaction_forces\",\n",
" \"sta/shear_moment_diagrams\",\n",
" \"sta/trusses\",\n",
" \"sta/frames_and_machines\",\n",
" \"sta/friction\",\n",
" \"sta/centers_of_mass\"\n",
"]\n",
"for dir in ['sta', 'sol', 'dyn']:\n",
" dir_path = os.path.join(pwd, \"src/pages\", dir)\n",
" for page in os.listdir(dir_path):\n",
" searchable_pages.append(os.path.join(dir, page.replace(\".astro\", '')))\n",
"\n",
"page_text = []\n",
"\n",
Expand Down Expand Up @@ -131,7 +116,7 @@
"\n",
" page_text.append({\"title\": page.split(\"/\")[1].replace(\"_\", \" \").capitalize(),\"text\": text, 'link': \"/\" + page, 'course': page.split('/')[0]})\n",
"\n",
"json.dump(page_text, open(\"./src/search.json\", \"w\"), indent=2)"
"json.dump(page_text, open(\"../src/search.json\", \"w\"), indent=2)"
]
},
{
Expand Down
21 changes: 12 additions & 9 deletions dev_tools/html_to_astro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -261,35 +261,38 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 51,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<DisplayEquation equation=\"\\\\begin{aligned}\\\\Pr \\\\left(T>s+t\\\\mid T>s\\\\right)&={\\\\frac {\\\\Pr \\\\left(T>s+t\\\\cap T>s\\\\right)}{\\\\Pr \\\\left(T>s\\\\right)}}\\\\4pt]&={\\\\frac {\\\\Pr \\\\left(T>s+t\\\\right)}{\\\\Pr \\\\left(T>s\\\\right)}}\\\\4pt]&={\\\\frac {e^{-\\\\lambda (s+t)}}{e^{-\\\\lambda s}}}\\\\4pt]&=e^{-\\\\lambda t}\\\\4pt]&=\\\\Pr(T>t).\\\\end{aligned}\" />\n"
"<DisplayEquation equation=\"\\\\begin{aligned} m_1 \\\\vec{v}_{1, i} + m_2 \\\\vec{v}_{2, i} &amp;= m_1 \\\\vec{v}_{1, f} + m_2 \\\\vec{v}_{2, f} \\\\\\\\ \\\\frac{1}{2} m_1 v_{1, i}^2 + \\\\frac{1}{2} m_2 v_{2, i}^2 &amp; = \\\\frac{1}{2} m_1 v_{1, f}^2 + \\\\frac{1}{2} m_2 v_{2, f}^2 \\\\end{aligned}\" />\n"
]
}
],
"source": [
"e = r\"\"\"\n",
"\\begin{aligned}\\Pr \\left(T>s+t\\mid T>s\\right)&={\\frac {\\Pr \\left(T>s+t\\cap T>s\\right)}{\\Pr \\left(T>s\\right)}}\\\\[4pt]&={\\frac {\\Pr \\left(T>s+t\\right)}{\\Pr \\left(T>s\\right)}}\\\\[4pt]&={\\frac {e^{-\\lambda (s+t)}}{e^{-\\lambda s}}}\\\\[4pt]&=e^{-\\lambda t}\\\\[4pt]&=\\Pr(T>t).\\end{aligned}\n",
"\\[\\begin{aligned}\n",
" m_1 \\vec{v}_{1, i} + m_2 \\vec{v}_{2, i} &amp;= m_1 \\vec{v}_{1, f} + m_2 \\vec{v}_{2, f} \\\\\n",
" \\frac{1}{2} m_1 v_{1, i}^2 + \\frac{1}{2} m_2 v_{2, i}^2 &amp; = \\frac{1}{2} m_1 v_{1, f}^2 + \\frac{1}{2} m_2 v_{2, f}^2\n",
" \\end{aligned}\\]\n",
"\"\"\"\n",
"\n",
"print(\"<DisplayEquation equation=\\\"\" + e.replace('\\n', '').replace(' ', '').replace('$', '').replace(r'\\[', '').replace(r'\\]', '').replace(\"\\\\\", r\"\\\\\") + \"\\\" />\")\n"
"print(\"<DisplayEquation equation=\\\"\" + e.replace('\\n', '').replace('\\t', '').replace('$', '').replace(r'\\[', '').replace(r'\\]', '').replace(\"\\\\\", r\"\\\\\") + \"\\\" />\")\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\\\\Pr \\\\left(T>s+t\\\\mid T>s\\\\right)=\\\\Pr(T>t),\\\\qquad \\\\forall s,t\\\\geq 0.}\n"
"\\\\vec{J} = \\\\int_{t_1}^{t_2} \\\\vec{F} \\\\, dt\n"
]
}
],
Expand All @@ -299,20 +302,20 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<InlineEquation equation=\" \\\\rm\\\\ MPa = 10^6 \\\\ Pa, 12 \\\\ \\\\text{in} = 1 \\\\ \\\\text{ft}\" />\n"
"<InlineEquation equation=\"dw = d\\\\vec{p}_P and u = \\\\vec{r}_{OP}\" />\n"
]
}
],
"source": [
"e = r\"\"\"\n",
" $\\rm\\ MPa = 10^6 \\ Pa$, $12 \\ \\text{in} = 1 \\ \\text{ft}$\n",
"$dw = d\\vec{p}_P$ and $u = \\vec{r}_{OP}$\n",
"\"\"\"\n",
"\n",
"print(\"<InlineEquation equation=\\\"\" + e.replace('\\n', '').replace(' ', '').replace('$', '').replace(r'\\(', '').replace(r'\\)', '').replace(\"\\\\\", r\"\\\\\") + \"\\\" />\")"
Expand Down
File renamed without changes.
Binary file added public/Statics/FluidFigures/CurvedPlateEx.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/FluidFigures/CurvedPlateSol1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/Statics/FluidFigures/CurvedPlateSol2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/FluidFigures/CurvedPlateSol2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/FluidFigures/CurvedPlateSol3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/FluidFigures/CurvedPlateSol4.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/Statics/FluidFigures/SlantedCurveSurf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/FluidFigures/SlantedCurveSurf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/FrictionFigures/BananaPeel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/CoupleMoments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/ThinRod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/ThinRodFBD1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/ThinRodFBD2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/Truss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/TrussFBD1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/TrussFBD2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/VirtualDisp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Statics/VWorkFigures/VirtualWork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fbe4dc6

Please sign in to comment.