Skip to content

Commit b55936d

Browse files
authored
Merge pull request #96 from earthstar-project/macromania
"macromania"
2 parents 56719fb + 7e06d7b commit b55936d

File tree

3,487 files changed

+67024
-14590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,487 files changed

+67024
-14590
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515

1616
steps:
1717
- name: Clone repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Install Deno
21-
uses: denoland/setup-deno@v1
21+
uses: denoland/setup-deno@v2
2222
with:
23-
deno-version: v1.x
23+
deno-version: v2.x
2424

2525
- name: Build step
2626
run: "deno task build"
@@ -29,4 +29,5 @@ jobs:
2929
uses: denoland/deployctl@v1
3030
with:
3131
project: "macromania"
32-
entrypoint: "./server.ts"
32+
entrypoint: "./server.ts"
33+
root: "."

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
willowtest/build
2-
build
1+
# Automatically generated and populated by `deno build` or `deno watch`
2+
build
3+
.vscode
4+
rustdocs/cached_defs

.nova/Configuration.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"co.gwil.deno.config.formatOnSave" : "false",
3-
"deno.enablePaths" : [
4-
"willowtest",
5-
"deno.json"
6-
]
2+
"co.gwil.deno.config.formatOnSave" : "true",
3+
"workspace.preview_type" : "custom",
4+
"workspace.preview_url" : "http:\/\/localhost:8000"
75
}

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
# We Are Sorry
1+
# Willow-Specs
22

3-
This repository houses a completely undocumented, experimental macro expansion system for generating text documents. It also houses the source of [https://willowprotocol.org/](https://willowprotocol.org/), which augments the undocumented macro expander with a diverse set of undocumented macros, often of abysmal code quality.
3+
Source code for the specifications of [Willow](https://willowprotocol.org/).
44

5-
On the bright side, we consider the macro system a success and will eventually create a clean, well-documented, standalone version of it. Until then, unfortunately, the source for the Willow website (including for all the specifications) will stay rather inaccessible. We welcome issues on even the most trivial typo fixes, and will happily take care of them.
5+
The specs are written using [Macromania](https://github.com/worm-blossom/macromania) ([basic tutorial here](https://github.com/worm-blossom/macromania/blob/main/test/tutorial.tsx)), see this [Macromania demo repository](https://github.com/worm-blossom/demo_macromania) to learn about most of the macros used for this site.
66

7-
For the brave who do want to venture into the source:
7+
For working on the generated site, run `deno task watch` to rebuild the site on (most) changes to the source; build output is placed at `./build`. Run `deno task serve` to start a webserver at `localhost:8000` for seeing the effects of your changes. The `deno task watch` command detects changes to input `.ts` and `.tsx` files only, but not to assets such as images or stylesheets. When changing those, simply interrupt the current `deno task watch` command and run it again (the command always starts with a full rebuild).
88

9-
- The webpages themselves live in the [https://github.com/earthstar-project/tsgen/tree/main/willowtest/specs](https://github.com/earthstar-project/tsgen/tree/main/willowtest/specs) directory, with assets and css residing [one level higher](https://github.com/earthstar-project/tsgen/tree/main/willowtest).
10-
- The entrypoint to rendering the site is [`main.ts`](https://github.com/earthstar-project/tsgen/blob/main/willowtest/main.ts) (not to be confused with the *other* [`main.ts`](https://github.com/earthstar-project/tsgen/blob/main/main.ts) 🫠).
11-
- The macro expander is defined in [`tsgen.ts`](https://github.com/earthstar-project/tsgen/blob/main/tsgen.ts).
9+
## Source Organisation
1210

13-
Again, we are sorry, but it is what it is.
11+
The entrypoint for macromania and the macromania expression that gets evaluated to produce the site is in [`src/main.tsx`]. Toward the end of that expression, we list the directory hierarchy of the website. The actual site contents are imported from hierarchically organised files in [`src/pages`]. Note how pages that have "subpages" (e.g. `src/specs.tsx`, `src/more.tsx`) are not mappend in a `<Dir>` macro, but "leaf pages" (e.g. `src/specs/data_model.tsx`) are. When in doubt, simply copypaste `src/specs/data_model.tsx` to get started with a new page.
12+
13+
Assets are read from [`src/assets`]. Careful: [`src/assets/layout.css`] is actually autogenerated from [`src/layoutStyles.tsx`] at build time, and then copied from the assets directory into the build directory. It turned out to be less effort to do this way, even it breaks the reasonable assumption of assets being purely static. Oh well. If you need to modify the responsive layout of marginales, tables of contents, etc, do so in [`src/layoutStyles.tsx`]. Also, ideally, you shouldn't need to.
14+
15+
The most common macros we use are those from the [scientific writing demo repository](https://github.com/worm-blossom/demo_macromania). Consult [`src/specs/data_model.tsx`] for usage examples of most of them. That file also demonstrates the macro we use for rendering paths.
16+
17+
For example usage of the macro(s) for defining encodings, see [`src/specs/encodings.tsx`].
18+
19+
In general, willow-specific macros are defined in [`src/macros.tsx`]. Usually, that's where you'll want to add new macros as well.
20+
21+
The macro that serves as a general page template is defined in [`src/pageTemplate.tsx`].

build/testspec.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)