Skip to content

Commit

Permalink
Fix tailwind not working with modd + update README
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswhybrow committed Apr 10, 2024
1 parent daad75c commit 8c4041a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,54 @@
the public works of Ray Peat.

[![Deploy to GitHub Pages](https://github.com/marcuswhybrow/ray-peat-rodeo/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/marcuswhybrow/ray-peat-rodeo/actions/workflows/gh-pages.yml)
[![Built with Nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)

![banner](https://raw.githubusercontent.com/marcuswhybrow/ray-peat-rodeo/back-to-go/internal/assets/docs/ray-peat-rodeo-banner.png)

# Developing
# Getting Started

Requirements: [Nix Package Manager](https://nixos.org/download.html#download-nix)
Get [Nix Package Manager](https://nixos.org/download.html#download-nix), then
clone this repository and start the auto-reloading dev server:

```bash
git clone git@github.com:marcuswhybrow/ray-peat-rodeo.git
cd ray-peat-rodeo

nix develop -c modd # Starts auto-reloading dev server
```

In a second terminal...

```bash
nix develop -c tailwind-watch # Allows tailwind to rebuild CSS classes
nix develop -c modd
```

In a third terminal edit a transcription file...
- `./assets` contains a markdown file for each article or transcription.
- `./assets/todo` contains a markdown file for assets without transcriptions.
- `./github/workflows/gh-pages` auto deploys this repo to https://raypeat.rode
- `./cmd/ray-peat-rodeo` is the code that builds the website from the markdown
assets.
- `./cmd/whisper-json2md` is a custom tool to massage AI transcripts to
markdown.
- `./internal` contains this projects unique features, especially
`./internal/markdown` and `./internal/cache/` which provide custom markdown
plugins and automatic caching of remote data (e.g. GitHub issue titles).

Those are the main things, and editing any of them trigger the dev server to
auto reload, and your browser should hot-load the changes and auto refresh,
making a near instant dev cycle.

- `./flake.nix` & `./flake.lock` tell the `nix` command how to do everything
for us, for example the dev server (lauched by `nix develop -c modd`), tells
nix to examine `./flake.nix` enter a the custom shell environment defined
there, and run the command `modd` which is our dev server of choice.
- `./gomod2nix.toml` in conjunction with `./flake.nix` helps the `nix` command
build this project. It's autogenerated by running `nix develop -c gomod2nix`.
- `./modd.conf` tells `modd` how to behave, such as running Tailwind CCS
process automatically.
- `./tailwind.config.js` tells tailwind how to do it's thing.

And finally, you may want to use `direnv` & `nix-direnv` to automatically load
all project dependencies and tools into your shell environment whilst you are
inside the project directory (auto unloads when you leave it). In the root of
the project directory:

```bash
vim ./assets/YYYY-MM-DD-title-of-new-transcription.md
cat "use flake" > .envrc
direnv allow
```

# AI Transcription
Expand Down
5 changes: 3 additions & 2 deletions modd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ build/**/* {
}

tailwind.config.js {
# Should work but doesn't (exits instead of watching)
# daemon: tailwind --watch --output @out/assets/tailwind.css
# `sleep infinity` is a hack to force stdin to exist, which tailwind needs.
# See https://github.com/cortesi/modd/issues/129
daemon: sleep infinity | tailwind --watch --output @out/assets/tailwind.css
}

0 comments on commit 8c4041a

Please sign in to comment.