Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d1c63d8
some progress
HugoGranstrom May 16, 2025
b79ee1e
slide is ported!
HugoGranstrom May 16, 2025
6e8a635
fragments are working!!!
HugoGranstrom May 16, 2025
7bce18b
bigText works
HugoGranstrom May 16, 2025
17c2fae
implement Pietors brilliant idea of a NbDiv block for column blocks
HugoGranstrom May 18, 2025
c75a6c8
update deps to use nimib 0.4.0
HugoGranstrom May 29, 2026
1202ac1
remove Nim 1.6 from CI
HugoGranstrom May 29, 2026
21e730d
make all presntations run
HugoGranstrom May 31, 2026
84033e3
update ci to newer versions
HugoGranstrom May 31, 2026
4d45aec
install lapack
HugoGranstrom May 31, 2026
191b367
add autoAnimateSlidesCustom which accepts a custom slide template
HugoGranstrom Jun 1, 2026
fa9a73a
start working on nimconf2026 (if you see this, congrats on finding ou…
HugoGranstrom Jun 1, 2026
da9d79d
fix bug where the nb_Style wasn't set
HugoGranstrom Jun 1, 2026
13f89ee
make some adjustments to intro page
HugoGranstrom Jun 1, 2026
0665abd
Story time!
HugoGranstrom Jun 1, 2026
56f7c0b
usage bar example almost done
HugoGranstrom Jun 2, 2026
e94e508
animate usageBar code
HugoGranstrom Jun 4, 2026
a2d9ac2
complete container block example
HugoGranstrom Jun 4, 2026
e5ed341
make typewriter work again by not using karax
HugoGranstrom Jun 5, 2026
49df05a
add newline support for typewriter
HugoGranstrom Jun 5, 2026
dae685f
slides are finished!
HugoGranstrom Jun 5, 2026
d8092a8
fix some things I found during a repetition
HugoGranstrom Jun 6, 2026
a3b8466
update nimib and nimibook versions
HugoGranstrom Jun 18, 2026
da1c14b
make sure ci fails if anything fails
HugoGranstrom Jun 18, 2026
1bcee93
make typewriter work again when we have multiple in the same document
HugoGranstrom Jun 18, 2026
870cc50
try dev deps in new nimble versions
HugoGranstrom Jun 18, 2026
8de4cfb
make embedded slides work again by populating the partials needed
HugoGranstrom Jul 21, 2026
3002235
verbose nimble sync
HugoGranstrom Jul 21, 2026
9309c82
try installing fontim beforehand
HugoGranstrom Jul 21, 2026
4b1a514
another try
HugoGranstrom Jul 21, 2026
5e5fd63
update nimble
HugoGranstrom Jul 21, 2026
b7bfe1f
install globally
HugoGranstrom Jul 21, 2026
3186595
try url again
HugoGranstrom Jul 21, 2026
1ac799b
try removing caching
HugoGranstrom Jul 21, 2026
9f60767
add back caching
HugoGranstrom Jul 21, 2026
8ca725f
use nimble to build docs
HugoGranstrom Jul 21, 2026
995001f
add nimble setup
HugoGranstrom Jul 21, 2026
dd79068
update numericalnim
HugoGranstrom Jul 21, 2026
ca0da05
install cdt
HugoGranstrom Jul 21, 2026
0a29d0f
cdt head
HugoGranstrom Jul 21, 2026
97dc622
break apart
HugoGranstrom Jul 21, 2026
365cd4a
separate install and preinstall
HugoGranstrom Jul 21, 2026
700f1d6
remove version
HugoGranstrom Jul 21, 2026
a32beb5
use .git in url
HugoGranstrom Jul 21, 2026
1e90295
try specifying cdt version
HugoGranstrom Jul 21, 2026
4202c5f
manually update lock file
HugoGranstrom Jul 21, 2026
a8f4a76
fix docs workflow with the same stuff
HugoGranstrom Jul 21, 2026
7b2fef0
remove unused consts
HugoGranstrom Jul 21, 2026
74a51c8
update changelog
HugoGranstrom Jul 21, 2026
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
12 changes: 9 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: iffy/install-nim@v4
- name: apt install
run: sudo apt install -y libpcre3 libblas-dev liblapack-dev
- uses: iffy/install-nim@v5
- name: Generate
run: |
nimble install -y
nimble docsDeps
set -e
nimble install -g nimble
nimble install -y -g https://github.com/zetashift/fontim
nimble install -y -g https://github.com/HugoGranstrom/cdt@0.1.1
nimble sync -y
nimble setup
nimble docs
nimble buildDocs
nimble buildBook
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/valid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@ jobs:
strategy:
matrix:
nim:
- '1.6.x'
- 'stable'
- 'devel'
fail-fast: false
name: Nim ${{ matrix.nim }}
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
- uses: jiro4989/setup-nim-action@v2.2.2
with:
nim-version: ${{ matrix.nim }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: sudo apt install libpcre3 libpcre3-dev liblapack-dev
- run: nimble install nimble -g
- name: Pre-Install deps
run: |
set -e
nimble install -y https://github.com/zetashift/fontim -g
nimble install -y -g https://github.com/HugoGranstrom/cdt@0.1.1
- name: Install deps
run: |
nimble install -y
nimble docsDeps
set -e
nimble sync -y
nimble setup
- name: Build compiler-docs
run: nimble docs
- name: Build slideshows
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v0.4.0
- Adapted the code to work with Nimib v0.4.0.

## v0.2.2
- `columns` now create equally sized columns, no matter the content. (A empty column takes up as much width as one full of content).
- `adaptiveColumns` has the behavior of the old `columns` where columns only are as big as their content needs.
Expand Down
4 changes: 4 additions & 0 deletions config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# begin Nimble config (version 2)
when withDir(thisDir(), system.fileExists("nimble.paths")):
include "nimble.paths"
# end Nimble config
99 changes: 17 additions & 82 deletions docsrc/nimconf2022.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,6 @@ import nimiSlides
nbInit(theme = revealTheme)
nb.useLatex

template nbCodeDontRun*(body: untyped) =
newNbCodeBlock("nbCodeDontRun", body):
discard

template nimibCode*(body: untyped) =
#nbText: "Nimib code:"
newNbCodeBlock("nimibCode", body):
discard
fragmentFadeIn:
nbRawHtml: "<hr/>"
#nbText: "Output:"
body

template nimibCodeAnimate*(lines: varargs[seq[HSlice[int, int]]], body: untyped) =
## Shows code and its output just like nbCode, but highlights different lines of the code in the order specified in `lines`.
## lines: Specify which lines to highlight and in which order. (Must be specified as a seq[HSlice])
## Ex:
## ```nim
## animateCode(@[1..1], @[3..4, 6..6]): body
## ```
## This will first highlight line 1, then lines 3, 4 and 6.
newNbCodeBlock("nimibCodeAnimate", body):
var linesString: string
if lines.len > 0:
linesString &= "|"
for lineBundle in lines:
for line in lineBundle:
linesString &= $line.a & "-" & $line.b & ","
linesString &= "|"
if lines.len > 0:
linesString = linesString[0 .. ^3]
nb.blk.context["highlightLines"] = linesString
fragmentFadeIn:
nbRawHtml: "<hr/>"
body

template nimibCodeAnimate*(lines: varargs[HSlice[int, int], toHSlice], body: untyped) =
## Shows code and its output just like nbCode, but highlights different lines of the code in the order specified in `lines`.
## lines: Specify which lines to highlight and in which order. (Must be specified as a HSlice)
## Ex:
## ```nim
## animateCode(1..1, 2..3, 5..5, 4..4): body
## ```
## This will first highlight line 1, then lines 2 and 3, then line 5 and last line 4.
var s: seq[seq[HSlice[int, int]]]
for line in lines:
s.add @[line]
nimibCodeAnimate(s):
body

nb.partials["nimibCode"] = nb.partials["nbCode"]
nb.renderPlans["nimibCode"] = nb.renderPlans["nbCode"]
nb.partials["nimibCodeAnimate"] = nb.partials["animateCode"]
nb.renderPlans["nimibCodeAnimate"] = nb.renderPlans["animateCode"]

template nbCodeDontRunAnimateImpl(body: untyped) =
discard

newAnimateCodeBlock(nbCodeDontRunAnimate, nbCodeDontRunAnimateImpl)

nb.partials["nbCodeDontRun"] = nb.partials["nbCode"]
nb.renderPlans["nbCodeDontRun"] = nb.renderPlans["nbCode"]
nb.partials["nimibCode"] = nb.partials["nbCode"]
nb.renderPlans["nimibCode"] = nb.renderPlans["nbCode"]

template nimConfSlide(body: untyped) =
slide:
cornerImage("https://github.com/nim-lang/assets/raw/master/Art/logo-crown.png", UpperRight, size=100, animate=false)
Expand Down Expand Up @@ -252,12 +187,12 @@ Text can be *italic*, **bold** or ~~crossed over~~.
nimConfSlide:
nbText: """### Installation"""

nbCodeDontRun:
nbCodeSkip:
nimble install nimiSlides

nimConfSlide:
nbText: "### Setting up"
nbCodeDontRun:
nbCodeSkip:
import nimib, nimiSlides
nbInit(theme = revealTheme)

Expand All @@ -273,7 +208,7 @@ Text can be *italic*, **bold** or ~~crossed over~~.
columns:
column:
fragmentFadeIn:
nbCodeDontRunAnimate(1..4, 1..2, 3..4, 6..12, 6, 7..8, 9..10, 11..12):
animateCodeSkip(1..4, 1..2, 3..4, 6..12, 6, 7..8, 9..10, 11..12):
slide:
nbText: "1"
slide:
Expand Down Expand Up @@ -431,7 +366,7 @@ slide:
listItem: nbText: "Back again"

nimConfSlide:
nimibCodeAnimate(1, 2..3, 4, 5..6, 7, 9):
animateCode(1, 2..3, 4, 5..6, 7, 9):
unorderedList:
listItem:
nbText: "First item"
Expand Down Expand Up @@ -460,7 +395,7 @@ slide:

nimConfAutoSlide:
nbText: "## Columns"
nimibCodeAnimate(1, 2..3, 4..5, 6..7):
animateCode(1, 2..3, 4..5, 6..7):
columns:
column:
nbText: "Left"
Expand Down Expand Up @@ -509,7 +444,7 @@ slide:

slide(slideOptions(colorBackground = "darkviolet")):
nbText: "## Color Background"
nbCodeDontRun:
nbCodeSkip:
slide(slideOptions(colorBackground = "darkviolet")):
nbText: "## Color Background"

Expand All @@ -518,7 +453,7 @@ slide:

nimConfSlide:
nbText: "## Image Background"
nbCodeDontRun:
nbCodeSkip:
slide(slideOptions(imageBackground = "https://github.com/nim-lang/assets/raw/master/Art/logo-crown.png")):
discard

Expand All @@ -527,13 +462,13 @@ slide:

nimConfSlide:
nbText: "## Iframe Background"
nbCodeDontRun:
nbCodeSkip:
slide(slideOptions(iframeBackground = "https://nim-lang.org/")):
discard

nimConfSlide:
nbText: "## Video Background"
nbCodeDontRun:
nbCodeSkip:
slide(slideOptions(videoBackground = "link/to/videofile.mp4")):
discard
fragmentFadeIn:
Expand Down Expand Up @@ -575,7 +510,7 @@ slide:
"""

nimConfSlide:
nbCodeDontRunAnimate(1..4, 6..10, 12..17):
animateCodeSkip(1..4, 6..10, 12..17):
slide(slideOptions(autoAnimate=true)):
nbText: """
- First
Expand Down Expand Up @@ -639,7 +574,7 @@ slide:
nbText: "## Using Templates"
nimConfAutoSlide:
nbText: "## Using Templates"
nbCodeDontRunAnimate({1, 3, 6}):
animateCodeSkip({1, 3, 6}):
slide(slideOptions(autoAnimate=true)):
nbText: "## Animate header"
slide(slideOptions(autoAnimate=true)):
Expand All @@ -654,7 +589,7 @@ slide:

nimConfAutoSlide:
nbText: "## Using Templates"
nbCodeDontRunAnimate(1, 2..3, 3, 5..6):
animateCodeSkip(1, 2..3, 3, 5..6):
template slideAutoAnimate(body: untyped) =
slide(slideOptions(autoAnimate=true)):
body
Expand All @@ -667,7 +602,7 @@ slide:
stackElements:
fragment(fadeInThenOut):
nbText: "#### Without template"
nbCodeDontRun:
nbCodeSkip:
slide(slideOptions(autoAnimate=true)):
nbText: "## Animate header"
slide(slideOptions(autoAnimate=true)):
Expand All @@ -679,7 +614,7 @@ slide:
nbText: "And this"
fragmentFadeIn:
nbText: "#### With template"
nbCodeDontRun:
nbCodeSkip:
slideAutoAnimate:
nbText: "## Animate header"
slideAutoAnimate:
Expand All @@ -698,10 +633,10 @@ slide:
nbText: "Example: Histogram of Gaussian for different N"
nimConfAutoSlide:
nbText: "## Loops ♻️ + Generate images 🖼️"
nbCodeDontRunAnimate(1, 2, 3, 4..7, 9, 10, 11):
animateCodeSkip(1, 2, 3, 4..7, 9, 10, 11):
for n in [50, 100, 1000, 10000]:
let filename = &"images/gauss-{n}.png"
let samples = newSeqWith[float](n, gauss(0.0, 1.0))
let samples = newSeqWith(n, gauss(0.0, 1.0))
let df = toDf(samples)
ggplot(df, aes("samples")) +
geom_histogram(fillColor="green") +
Expand All @@ -714,7 +649,7 @@ slide:
slide:
for n in [50, 100, 1000, 10000]:
let filename = &"images/gauss-{n}.png"
let samples = newSeqWith[float](n, gauss(0.0, 1.0))
let samples = newSeqWith(n, gauss(0.0, 1.0))
let df = toDf(samples)
ggplot(df, aes("samples")) +
geom_histogram(fillColor="green") +
Expand Down
Loading
Loading