Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Install Nix
uses: cachix/install-nix-action@v31
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-25.11

- name: Build project
run: |
nix develop --command uv build

- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
dist/stepcode-*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ __pycache__/
.pytest_cache/
.ruff_cache/
.mypy_cache/
stepcode.egg-info/

# ---
dist/
Expand Down
21 changes: 20 additions & 1 deletion docs/contribute/build.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
---
title: 'How to build'
title: 'How to build stepcode and the documentation'
---

# {{title}}

## Building stepcode

To build **stepcode** into source and binary distributions compatible with, for example, PyPI, you can use the following command:

```sh
uv build
```

## Building our documentation

To build the documentation, you can use:

```sh
uv run src/main.py docs
```

## Using nix
If you are a [nix](https://nixos.org/) user, you can use the `devShell` provided by the `flake.nix` to easily set up a development environment with all the necessary dependencies. To enter the development shell, run:

```sh
nix develop .
```
73 changes: 71 additions & 2 deletions docs/usage/book.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,77 @@ title: 'Create your own book'

# {{title}}

## How to create your own book
Creating a static book with **stepcode** is as simple as writing standard Markdown.

## How to deploy
## Cloning the Repository

As **stepcode** is made in Python, you must clone the repository and install the dependencies to use it. You can do this with the following commands:

```sh
git clone
cd stepcode
```

To easily manage dependencies and virtual environments, we recommend using [uv](https://docs.astral.sh/uv/). To install the dependencies and run the project, use:

```sh
uv sync
uv run src/main.py
```

## Creating Your Book

To create your book, create a folder. There you must have a `stepcode.toml`:

```toml
[book]
name = "My book"
author = "Me of course"

chapters = [
# here you must list all the chapters of your book, in order.
"blog/first-post.md",
"blog/second-post.md",

"cooking/first-recipe.md",
]
```

and a index.md in the root of the folder:

```markdown
---
title: 'My book'
---

# {{title}}

Hi
```

### If you are a [nix](https://nixos.org/download/) user, the repo flake exposes a `devShell` to download all the dependencies and have a ready to use environment. You can enter it with:

```sh
nix develop .
```

Furthermore, a template book is available using:

```sh
nix flake new --template github:daniqss/stepcode#book my-book
```

## Building the Book

Instructions on how to build and host your book can be found in the [README.md](https://github.com/daniqss/stepcode?tab=readme-ov-file#usage) of the repository.

After using

```sh
uv run src/main.py <YOUR_FOLDER>
```

### In Github Pages

If you want to host your book on Github Pages, you can copy our [workflow](https://github.com/daniqss/stepcode/blob/main/.github/workflows/release.yaml)
If you're using the template, it already contains a workflow that will automatically build and deploy your book to Github Pages on every push to the `main` branch. You can customize it as you wish, but make sure to update the path to the book in the workflow.
10 changes: 0 additions & 10 deletions docs/usage/stepcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ title: 'How to use stepcode'

# {{title}}

Creating a static book with **stepcode** is as simple as writing standard Markdown.

## Creating Chapters

To add a new chapter, simply create a `.md` file in the `content/chapters/` directory. The tool will automatically detect it and generate the corresponding HTML.

## Writing Pseudocode

To enable step-by-step execution for your pseudocode, wrap your code blocks with the `stepcode` language identifier:
Expand All @@ -23,7 +17,3 @@ result := x + y
````

The interpreter will parse these blocks and provide the interactive stepping functionality in the generated static site.

## Building the Book

Instructions on how to build and host your book can be found in the [README.md](https://github.com/daniqss/stepcode) of the repository.