Skip to content

Commit

Permalink
generation: rewrite generation script (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Nov 28, 2023
1 parent 4cd6cd3 commit 12d56ee
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
7 changes: 1 addition & 6 deletions assets/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
all: build

build:
echo -e "<!--This file is auto-generated by Makefile\n----DO NOT EDIT -->" > index.md
for i in `find notes/ -type f|sort`; do \
echo "$$i"; \
echo -e "---\n_Notatki z pliku \`$$i\`_" >> index.md; \
echo -e "\`\`\`{include} $${i}\n\`\`\`" >> index.md; \
done
sh generate.sh
12 changes: 12 additions & 0 deletions assets/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
echo -e "<!--This file is auto-generated by Makefile\n----DO NOT EDIT -->" > index.rst
for i in `find notes/ -maxdepth 1 -type d|sort`; do
echo "Scanning directory $i"
echo -e "<!--This file is auto-generated by Makefile\n----DO NOT EDIT -->" > $i.md
echo -e ".. toctree::\n\t:maxdepth: 3\n\t:caption: xd\n\n\t$i.md\n" >> index.rst
for j in `find $i -type f -name \\*md|sort`; do
echo "$j"
echo -e "---\n_Notatki z pliku \`$j\`_" >> $i.md
echo -e "\`\`\`{include} ../${j}\n\`\`\`" >> $i.md
done
done

30 changes: 30 additions & 0 deletions assets/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. toctree::
:maxdepth: 3
:caption: xd

notes/.md

.. toctree::
:maxdepth: 3
:caption: xd

notes/algebra.md

.. toctree::
:maxdepth: 3
:caption: xd

notes/matematyka.md

.. toctree::
:maxdepth: 3
:caption: xd

notes/matematyka_cw.md

.. toctree::
:maxdepth: 3
:caption: xd

notes/mechanika_cw.md

6 changes: 1 addition & 5 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ W szczególności następującym przedmiotom:
- Matematyka
- Metody analizy algebraicznej w fizyce

.. toctree::
:maxdepth: 3
:caption: Zawartość:

assets/index.md
.. include:: assets/index.rst

.. important::

Expand Down

0 comments on commit 12d56ee

Please sign in to comment.