Skip to content

Commit

Permalink
replace 11ty with pandoc
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-demin committed Nov 10, 2024
1 parent 3497770 commit 7c477e8
Show file tree
Hide file tree
Showing 43 changed files with 199 additions and 279 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/11ty.yml → .github/workflows/pandoc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy 11ty site to Pages
name: Deploy Pandoc site to Pages

on:
push:
Expand All @@ -21,17 +21,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install 11ty
run: npm install
- name: Install Pandoc
run: sudo apt install make pandoc
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with 11ty
run: npm run build -- --pathprefix ${{ steps.pages.outputs.base_path }}
- name: Build with Pandoc
run: make BASE=${{ steps.pages.outputs.base_path }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

Expand Down
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
BASE =
SITE = _site

PAGES = $(filter-out index, $(basename $(notdir $(wildcard md/*.md))))
CONTENT = $(addprefix $(SITE)/, etc css img index.html $(addsuffix /index.html, $(PAGES)))

PANDOC = pandoc --defaults defaults.yml --metadata base=$(abspath $(BASE))

MKDIR = mkdir -p
CP = cp -r
RM = rm -rf

all: $(SITE) $(CONTENT)

$(SITE):
@$(MKDIR) $@

$(SITE)/%: %
@echo ">> Copying $^"
@$(MKDIR) $(@D)
@$(CP) $^ $@

$(SITE)/%.html $(SITE)/%/index.html: md/%.md
@echo ">> Converting $^"
@$(MKDIR) $(@D)
@$(PANDOC) --metadata page=$* --output $@ $^

serve:
@python3 -m http.server --bind 127.0.0.1 --directory $(SITE)

clean:
@$(RM) $(SITE)
25 changes: 0 additions & 25 deletions _data/site.js

This file was deleted.

29 changes: 0 additions & 29 deletions _layouts/page.html

This file was deleted.

18 changes: 0 additions & 18 deletions _layouts/redirect.html

This file was deleted.

2 changes: 2 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ html {
Liberation Sans,
DejaVu Sans,
sans-serif;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
text-size-adjust: none;
}

Expand Down
11 changes: 11 additions & 0 deletions defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
standalone: true
template: page.html

reader: markdown-implicit_figures
writer: html

highlight-style: null
wrap: none

metadata-file: metadata.yml
filters: [filters.lua]
52 changes: 0 additions & 52 deletions eleventy.config.js

This file was deleted.

40 changes: 40 additions & 0 deletions filters.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

local meta = {}
local title = nil
local stringify = pandoc.utils.stringify

function get_title(h)
if h.level == 1 and not title then
title = h.content
return h
end
end

function change_meta(m)
meta = m
if m.page == "index" then
m.canonical = stringify(m.baseurl) .. "/"
else
m.canonical = stringify(m.baseurl) .. "/" .. m.page .. "/"
end
m.title = title or m.site_title
return m
end

function change_link_target(l)
if meta[l.target] then
l.target = stringify(meta[l.target])
elseif l.target:sub(1, 1) == "/" then
l.target = meta.base .. l.target
end
return l
end

function change_image_src(i)
if i.src:sub(1, 1) == "/" then
i.src = meta.base .. i.src
end
return i
end

return {{Header = get_title, Meta = change_meta}, {Link = change_link_target, Image = change_image_src}}
6 changes: 2 additions & 4 deletions md/alpine.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
title: Alpine with pre-built applications
---
# Alpine with pre-built applications

## Introduction

To simplify maintenance and distribution of the pre-built applications described in the Red Pitaya notes, I've put together a bootable SD card image based on the lightweight [Alpine Linux](https://alpinelinux.org) distribution.

## Getting started

- Download [SD card image zip file]({{ site.release_image }}).
- Download [SD card image zip file](release_image).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start one of the applications automatically at boot time, copy its `start.sh` file from `apps/<application>` to the topmost directory on the SD card.
- Install the micro SD card in the Red Pitaya board and connect the power.
Expand Down
4 changes: 1 addition & 3 deletions md/axi-hub.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: AXI4 hub
---
# AXI4 hub

## Requirements

Expand Down
4 changes: 1 addition & 3 deletions md/axi-interface-buffers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Buffers for AXI4, AXI4-Lite and AXI4-Stream interfaces
---
# Buffers for AXI4, AXI4-Lite and AXI4-Stream interfaces

## Interesting links

Expand Down
4 changes: 1 addition & 3 deletions md/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: List of components
---
# List of components

The following is a list of components that can be used with Red Pitaya.

Expand Down
4 changes: 1 addition & 3 deletions md/development-machine.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Development machine
---
# Development machine

The following are the instructions for installing a virtual machine with [Debian](https://www.debian.org/releases/bookworm) 12 (amd64) and [Vitis Core Development Kit](https://www.xilinx.com/products/design-tools/vitis.html) 2023.1.

Expand Down
4 changes: 1 addition & 3 deletions md/dma.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Direct memory access
---
# Direct memory access

## Introduction

Expand Down
4 changes: 0 additions & 4 deletions md/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
permalink: /
---

![My Red Pitaya](/img/my-red-pitaya.jpg)

1. [List of components](/components/)
Expand Down
4 changes: 1 addition & 3 deletions md/led-blinker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: LED blinker
---
# LED blinker

## Introduction

Expand Down
4 changes: 1 addition & 3 deletions md/links.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Links
---
# Links

- [Red Pitaya Documentation](https://redpitaya.readthedocs.io)

Expand Down
10 changes: 4 additions & 6 deletions md/mcpha.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Multichannel Pulse Height Analyzer
---
# Multichannel Pulse Height Analyzer

## Interesting links

Expand Down Expand Up @@ -54,11 +52,11 @@ The [projects/mcpha/client](https://github.com/pavel-demin/red-pitaya-notes/tree
## Getting started with MS Windows

- Connect a signal source to the IN1 or IN2 connector on the Red Pitaya board.
- Download [SD card image zip file]({{ site.release_image }}) (more details about the SD card image can be found at [this link](/alpine/)).
- Download [SD card image zip file](release_image) (more details about the SD card image can be found at [this link](/alpine/)).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start the application automatically at boot time, copy its `start.sh` file from `apps/mcpha` to the topmost directory on the SD card.
- Install the micro SD card in the Red Pitaya board and connect the power.
- Download and unpack the [release zip file]({{ site.release_file }}).
- Download and unpack the [release zip file](release_file).
- Run the `mcpha.exe` program in the `control` directory.
- Type in the IP address of the Red Pitaya board and press Connect button.
- Select Spectrum histogram 1 or Spectrum histogram 2 tab.
Expand All @@ -68,7 +66,7 @@ The [projects/mcpha/client](https://github.com/pavel-demin/red-pitaya-notes/tree
## Getting started with GNU/Linux

- Connect a signal source to the IN1 or IN2 connector on the Red Pitaya board.
- Download [SD card image zip file]({{ site.release_image }}) (more details about the SD card image can be found at [this link](/alpine/)).
- Download [SD card image zip file](release_image) (more details about the SD card image can be found at [this link](/alpine/)).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start the application automatically at boot time, copy its `start.sh` file from `apps/mcpha` to the topmost directory on the SD card.
- Install the micro SD card in the Red Pitaya board and connect the power.
Expand Down
4 changes: 0 additions & 4 deletions md/md.json

This file was deleted.

10 changes: 4 additions & 6 deletions md/playground.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Playground
---
# Playground

## Introduction

Expand All @@ -18,15 +16,15 @@ The basic blocks of the playground project are shown in the following diagram:

The [projects/playground](https://github.com/pavel-demin/red-pitaya-notes/tree/master/projects/playground) directory contains one Tcl file [block_design.tcl](https://github.com/pavel-demin/red-pitaya-notes/blob/master/projects/playground/block_design.tcl) that instantiates, configures and interconnects all the needed IP cores.

A pre-built Vivado project can be found in the `playground` directory in the [release zip file]({{ site.release_file }}).
A pre-built Vivado project can be found in the `playground` directory in the [release zip file](release_file).

## Getting started

- Download [SD card image zip file]({{ site.release_image }}) (more details about the SD card image can be found at [this link](/alpine/))
- Download [SD card image zip file](release_image) (more details about the SD card image can be found at [this link](/alpine/))
- Copy the contents of the SD card image zip file to a micro SD card
- Optionally, to start the application automatically at boot time, copy its `start.sh` file from `apps/playground` to the topmost directory on the SD card
- Install the micro SD card in the Red Pitaya board and connect the power
- Download and unpack the [release zip file]({{ site.release_file }})
- Download and unpack the [release zip file](release_file)

- Install Visual Studio Code following the platform-specific instructions below:

Expand Down
Loading

0 comments on commit 7c477e8

Please sign in to comment.