Skip to content

Commit 450be24

Browse files
compiler script
1 parent 50afd7e commit 450be24

File tree

17 files changed

+3121
-250
lines changed

17 files changed

+3121
-250
lines changed

README.md

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,54 @@ software.
1212

1313
# How to run
1414
Install [stellar](https://github.com/paolobettelini/stellar)
15-
and compile all the snippets.
15+
and clone the repository
16+
```bash
17+
git clone https://github.com/paolobettelini/notes
18+
```
19+
Set the necessary enviromental variables:
20+
```bash
21+
NOTESPATH # pointing to the notes/ directory
22+
MONGO_CONNECTION_URL # connection URL to mongodb
23+
```
24+
Install the required libraries (some snippets require `npm` and `wasm-pack` to compile)
25+
```bash
26+
pacman -S tectonic npm wasm-pack
27+
```
28+
Install the compiler (or download it from the releases)
29+
```bash
30+
cd notes/compiler
31+
cargo build --release
32+
mv target/release/compile /usr/local/bin/notes
33+
```
34+
# Compile everything
1635
```bash
1736
cd source
18-
./compile
37+
notes # compiles everything
1938
cd ..
2039
```
21-
This script uses `tectonic` to compile all the `tex` file and then runs `stellar-cli`
22-
to generate the snippets and import them in the database.
23-
To compile the `nannou` snippets you also need `wasm-pack` and `npm`.
24-
Make sure to open the script and change your configurations. A mongoDB database is needed.
40+
2541
It is advisable to set the `CARGO_TARGET_DIR` variable so that
2642
the rust projects share the same target folder.
2743

28-
Then, open the web server
44+
Then, start the web server
45+
```bash
46+
stellar web --data data/ --connection-url $MONGO_CONNECTION_URL
47+
```
48+
Go to [localhost:8080/search](http://localhost:8080/search).
49+
50+
# Compiler usage
2951
```bash
30-
stellar-cli web --data data/ --connection-url "mongodb://localhost"
52+
notes # compiles everything
53+
notes Something # compiles everything that contains "Something"
54+
notes -r "S|T|N|G" # compiles everything that matches the regex
55+
notes --latex # compiles all the latex files
56+
notes --snippets # compiles all the universes
57+
notes --pages # compiles all the universes
58+
notes --courses # compiles all the universes
59+
notes --universes # compiles all the universes
60+
notes --universes -r "" # compiles all the universes that match the regex
3161
```
32-
Go to [localhost:8080/universe/math](http://localhost:8080/universe/math).
3362

34-
# Periodic fetch
35-
If you want to periodically update the content automatically
36-
you can call `source/try_pull_and_compile` using a scheduler (for example `crontab` or `systemd`).
3763

3864
# Cite me
3965
```bib

0 commit comments

Comments
 (0)