Skip to content

Commit 16a7aa9

Browse files
committed
Gen docs automation
1 parent df59096 commit 16a7aa9

File tree

5 files changed

+10
-35
lines changed

5 files changed

+10
-35
lines changed

β€Žcodes/test_example.mojoβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.

β€Ždocs/index.mdβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,3 @@
3939

4040
🟒 [ Container With Most Water](water_container_max_area.md) βž” Given an array of line heights, find the two lines that form the container holding the most water.
4141
🟒 [ Count 1s](num_ones.md) βž” Count the number of set bits (Hamming weight) in the binary representation of a positive integer n.
42-
🟒 [ Test Function](test_example.md) βž” A simple test to add two numbers. in the binary representation of a positive integer n.
43-
🟒 [ Test Function](test_example.md) βž” A simple test to add two numbers. βž” A simple test to add two numbers. in the binary representation of a positive integer n.
44-
🟒 [ Test Function](test_example.md) βž” A simple test to add two numbers. βž” A simple test to add two numbers. βž” A simple test to add two numbers. in the binary representation of a positive integer n.
45-
🟒 [ Test Function](test_example.md) βž” A simple test to add two numbers. βž” A simple test to add two numbers. βž” A simple test to add two numbers. βž” A simple test to add two numbers. in the binary representation of a positive integer n.

β€Ždocs/test_example.mdβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Žgenerate_docs.shβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/bash
2+
if [ $# -ne 1 ]; then
3+
echo "Usage: $0 <mojo file name> "
4+
exit 1
5+
fi
6+
FILENAME=$1
7+
python3 scripts/generate_docs.py ${FILENAME}

β€Žscripts/generate_docs.pyβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def update_index(title, description, md_filename):
6969
index_lines.append(new_entry)
7070
INDEX_MD.write_text("\n".join(index_lines) + "\n", encoding="utf-8")
7171
print(f"Updated {INDEX_MD}")
72-
72+
print()
73+
print(INDEX_MD.read_text(encoding="utf-8").splitlines()[-1])
74+
print()
7375

7476
main()

0 commit comments

Comments
Β (0)