326 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
a7513ffcac Improves changelog generation with sections
Enhances the changelog generation script to categorize updates into Frontmatter, Chapters, Labs, and Appendix sections.

This improves readability and organization by grouping related changes together. It also adds logic to determine if the sections should be open or closed (details tag) based on if it's the latest entry. Finally, it correctly titles each of the items in the chapter lookup.
2025-06-10 13:08:19 -04:00
Vijay Janapa Reddi
be754759b6 Refactors and updates book content structure
Massively reorganizes the textbook's file structure, improving maintainability, and adding references to datasets.
The updates involve sorting files into a new folder structure with subfolders within the images directory based on file type.
Distributes references so each chapter now has its own reference files.
2025-06-10 12:00:54 -04:00
Vijay Janapa Reddi
23986986f2 Improves text processing in QMD files
Addresses minor textual inconsistencies across multiple QMD files to enhance readability and maintain consistency.

Updates the dash processing script to handle both em-dashes and triple hyphens, improving the accuracy of text transformations in QMD files. This ensures consistent formatting and enhances the overall quality of the generated content.
2025-06-10 09:46:26 -04:00
Vijay Janapa Reddi
5e3826bd9a Improves em-dash clause rewriting with OpenAI
Updates the prompt template for better handling of Markdown formatting, including lists, bold/italic text, inline code, and citations. It also ensures that bullets are respected during paragraph splitting.

This allows the script to correctly process more complex documents and bulleted lists, improving the quality of the rewritten text.
2025-06-05 15:03:26 -04:00
Vijay Janapa Reddi
1b1faf1195 Adds script to fix em-dashes in text
Introduces a script that leverages OpenAI's GPT models to
reformat em-dash clauses in .qmd files, replacing them with
more formal structures like commas or parentheses.

The script processes files in either interactive or batch mode,
allowing users to review and accept changes, or automatically
apply them across a directory of files. It utilizes the gpt-4o model
to rewrite the clauses, ensuring the preservation of existing
Markdown formatting and citations.

This improves the formal tone of academic writing by addressing
the overuse of em-dashes.
2025-06-05 14:59:12 -04:00
Vijay Janapa Reddi
4357941346 Introduces script to fix em-dashes with OpenAI
Adds a script that uses OpenAI to rewrite clauses enclosed in em-dashes in .qmd files.

The script provides both interactive and batch modes, allowing users to review and accept changes, or automatically process files. It refactors em-dash clauses using commas or parentheses for improved formal writing style.
2025-06-05 14:34:53 -04:00
Vijay Janapa Reddi
e5767f07d6 Moves changelog update script
Moves the changelog update script to the `scripts` directory for better organization and discoverability.
2025-06-04 19:31:42 -04:00
Vijay Janapa Reddi
03febd1097 Removes unused scripts.
Deletes obsolete scripts that are no longer needed.
This cleans up the repository and removes potential maintenance overhead.
2025-06-04 19:31:38 -04:00
Vijay Janapa Reddi
4a16d94fbe Adds check for macOS quarantined images
Adds a pre-commit hook that checks for quarantined images on macOS.
This prevents accidentally committing images that have quarantine flags set, which can cause issues for other users.
2025-05-27 17:09:12 -04:00
Vijay Janapa Reddi
bdfcbbc9ae Extends label matching to include new delimiters
Updates regular expressions to correctly identify labels
defined with "%%| label:" and listings defined with
attributes. This ensures that the script accurately finds
all unreferenced labels in the documentation.
2025-05-21 17:19:20 -04:00
Vijay Janapa Reddi
c67a60df03 Updates script to use GPT-4o and improve YAML parsing
Switches the OpenAI model to "gpt-4o" for potentially improved performance and cost.

Adds a function to strip YAML fence blocks (```yaml ... ```) from the raw output of the OpenAI model. This improves the robustness of the YAML parsing by handling cases where the model includes these fences.
2025-05-14 15:11:44 -04:00
Vijay Janapa Reddi
45c53b1ec9 Updates prompt for header revision task
Refines the prompt used for generating revised section headers for the textbook.

The new prompt includes specific guidelines for conciseness, hierarchical awareness, consistent tone, and formatting.
It also emphasizes the importance of evaluating all headers and provides clear instructions for the expected output format.
2025-05-14 14:05:53 -04:00
Vijay Janapa Reddi
a690290d4a Updates OpenAI API usage
Migrates to the new OpenAI client library for improved compatibility
and to align with the latest API standards.

This change replaces the deprecated `openai.ChatCompletion.create` method
with `client.chat.completions.create`, ensuring the script remains
functional with future OpenAI API updates.
2025-05-14 13:30:25 -04:00
Vijay Janapa Reddi
9c60c3faae Improves script execution and header handling
Refactors the `fixtitle.py` script to accept file or directory input via command-line arguments, enhancing usability and flexibility. Includes argument validation and usage instructions for improved user experience.

The `header_update.py` script is updated to allow processing of single files in addition to directories and includes validation. Code is factored into functions for better readability and maintainability.
2025-05-14 13:30:01 -04:00
Zeljko Hrcek
15990fa5b2 Fix: Removed Unicode character from print to avoid encoding error 2025-04-07 11:47:27 +02:00
Vijay Janapa Reddi
9a8bf95559 Fixes minor issues and improves label checking
Addresses a typo in the privacy_security file.

Updates the regex for identifying labels in the
find_unreferenced_labels.py script to handle both
{#fig-xyz and #| label: fig-xyz formats.

Adds a check for unresolved references in the
find_unreferenced_labels.py script.

Updates the find_unreferenced_labels.py script to provide
more informative messages about label and reference status.
2025-04-01 14:41:21 -04:00
Zeljko Hrcek
64f1412ee6 Update LABS part 2_seeed_xiao_esp32s3
The file xiao_esp32s3.qmd  has been edited.
The file setup.qmd  has been edited.
The file image_classification.qmd  has been edited.
The file object_detetion.qmd  has been edited.
The file kws.qmd  has been edited.
The file motion_classification.qmd  has been edited.
2025-03-31 21:41:22 +02:00
Vijay Janapa Reddi
996a0ffda0 Produces correct stats for the book's contents 2025-03-28 12:25:57 -04:00
Vijay Janapa Reddi
abcab186eb Merge branch 'dev' into quarto_stats_script 2025-03-28 11:46:58 -04:00
Vijay Janapa Reddi
331352d6d1 Merge branch 'dev' into find_unreferenced_labels 2025-03-28 11:33:49 -04:00
Vijay Janapa Reddi
3061c8ea4b acronym fixes 2025-03-28 11:32:49 -04:00
Vijay Janapa Reddi
3ab346758b Script to find any missing references
Anything defined as @fig @tbl, etc. that is not referenced in the text will raise an error, so there are no figures or sections or tables, etc., that are just dangling.
2025-03-28 11:31:34 -04:00
Vijay Janapa Reddi
a17140e549 Script produces links to unreferenced places 2025-03-26 19:33:54 -04:00
Vijay Janapa Reddi
261789c3b2 first draft, but buggy for a few things 2025-03-26 19:10:28 -04:00
Vijay Janapa Reddi
bf43447358 faster build 2025-03-19 21:10:35 -04:00
Vijay Janapa Reddi
bba35af404 change sorting order 2025-03-19 21:10:18 -04:00
Vijay Janapa Reddi
7d6715d70e count footnotes 2025-03-19 17:58:21 -04:00
Vijay Janapa Reddi
17f976d455 footnote helper 2025-03-19 17:56:29 -04:00
Vijay Janapa Reddi
914f87913d Updated footnote detection to only show defn. count 2025-03-18 07:54:36 -04:00
Vijay Janapa Reddi
7da6e9503d fix section header script using llm 2025-03-10 23:00:18 -04:00
Vijay Janapa Reddi
314694188b This script checks to make sure all tables and figures are cross-referenced 2025-03-06 18:04:39 -05:00
Vijay Janapa Reddi
f46bc3bb25 python script to update bib 2025-03-06 13:50:56 -05:00
Vijay Janapa Reddi
7e31ac5068 fix files 2025-03-03 17:36:33 -08:00
Vijay Janapa Reddi
e732476ee9 fix path issue 2025-03-03 16:01:37 -08:00
Vijay Janapa Reddi
24bb7efe13 fix path bug 2025-03-03 15:20:06 -08:00
Vijay Janapa Reddi
7786b67d05 relocating files 2025-03-01 08:15:06 -05:00
Vijay Janapa Reddi
18c0081915 Remove unused files 2025-03-01 08:14:53 -05:00
Vijay Janapa Reddi
3c707bd4d2 Merge pull request #716 from harvard-edge/quiz_with_sr
update sr fixed quiz and sr - this is a fix for the github issues from 2/12
2025-02-17 08:29:53 -05:00
Kleinbard
73087b524c update sr fixed quiz and sr 2025-02-17 01:44:00 -05:00
Vijay Janapa Reddi
e2f9222819 Removed redundant definitions e.g. (GPUs) with script help 2025-02-16 18:51:57 -05:00
Vijay Janapa Reddi
173a04d04f Added a script to find repeated acrnonyms 2025-02-16 18:13:15 -05:00
Vijay Janapa Reddi
d83eded67b Fix acronyms script 2025-02-16 13:29:54 -05:00
Kleinbard
af17d24f7e updated quiz bug 2025-02-13 22:02:24 -05:00
Kleinbard
2d12afc0a2 new 2025-02-12 14:03:34 -05:00
Vijay Janapa Reddi
a72f109f8f Updating the workflows, likely gonna need debugging! 2025-02-08 11:09:01 -05:00
Vijay Janapa Reddi
a596cebd1b Remove extra lines 2025-02-06 16:33:02 -05:00
Vijay Janapa Reddi
0b0fc1decb Comment some printf 2025-02-06 00:57:01 -05:00
Vijay Janapa Reddi
0939354812 Updated to print output 2025-02-06 00:47:04 -05:00
Vijay Janapa Reddi
dbb93a79be Update formatting 2025-02-05 23:38:40 -05:00
Vijay Janapa Reddi
046ef1970b Updated CHANGELOG.md and just include it in frontmatter 2025-02-05 22:42:47 -05:00