Skip to content

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
BCsabaEngine committed Aug 14, 2024
1 parent 2198a1a commit e8fc745
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ The content of **generated file** (do not edit, just use)
```c
#define SVELTEESP32_COUNT 5
#define SVELTEESP32_SIZE 145633
#define SVELTEESP32_FILE_index_html
#define SVELTEESP32_FILE_INDEX_HTML
#define SVELTEESP32_HTML_FILES 1
...
const uint8_t data0[12547] = {0x1f, 0x8b, 0x8, 0x0, ...
Expand Down Expand Up @@ -189,30 +190,42 @@ You can use the COUNT and SIZE constants:
...
```

You can include a warning if a named file accidentally missing from the build:
You can include a blocker error if a named file accidentally missing from the build:

```c
...
#include "svelteesp32.h"

#ifndef SVELTEESP32_FILE_index_html
#ifndef SVELTEESP32_FILE_INDEX_HTML
#error Missing index file
#endif
...
```

...or if there are too many of a file type:

```c
...
#include "svelteesp32.h"

#if SVELTEESP32_CSS_FILES > 1
#error Too many CSS files
#endif
...
```

### Command line options

| Option | Required | Description | default |
| ------------- | :------: | ---------------------------------------------------------------- | ----------------------- |
| `-e` | x | The engine for which the include file is created (psychic/async) | psychic |
| `-s` | x | Source dist folder contains compiled web files | |
| `-o` | x | Generated output file with path | `svelteesp32.h` |
| `--etag` | | Use ETag header for cache | false |
| `--no-gzip` | | Do not compress content with gzip | false -> gzip used |
| `--espmethod` | x | Name of generated method | `initSvelteStaticFiles` |
| `--define` | x | Prefix of c++ defines | `SVELTEESP32` |
| `-h` | | Show help | |
| Option | Description | default |
| ------------- | --------------------------------------------------------- | ----------------------- | ------- |
| `-s` | **Source dist folder contains compiled web files** | |
| `-e` | The engine for which the include file is created [psychic | async] | psychic |
| `-o` | Generated output file with path | `svelteesp32.h` |
| `--etag` | Use ETag header for cache | false |
| `--no-gzip` | Do not compress content with gzip | false -> gzip used |
| `--espmethod` | Name of generated method | `initSvelteStaticFiles` |
| `--define` | Prefix of c++ defines | `SVELTEESP32` |
| `-h` | Show help | |

### Q&A

Expand Down
4 changes: 2 additions & 2 deletions demo/esp32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif

#if SVELTEESP32_CSS_FILES > 1
#error Too much CSS files
#error Too many CSS files
#endif

AsyncWebServer server(80);
Expand All @@ -39,7 +39,7 @@ void loop() {}
#endif

#if SVELTEESP32_CSS_FILES > 1
#error Too much CSS files
#error Too many CSS files
#endif

PsychicHttpServer server;
Expand Down

0 comments on commit e8fc745

Please sign in to comment.