├── nimbledeps └── .gitkeep ├── .gitignore ├── nimble.version ├── uv.lock ├── nim.version ├── pyproject.toml ├── main.py ├── pyscript_python_dovunque_perchiunque.nimble ├── main.js ├── nim.cfg ├── my.nim ├── README.md ├── questa.html ├── agenda.nim ├── LICENSE ├── chistaccà.html ├── cosa.nim ├── nimble.lock ├── agenda.html ├── index.nim ├── cosa.html ├── notes.md └── index.html /nimbledeps/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | nimbledeps/* 2 | !nimbledeps/.gitkeep -------------------------------------------------------------------------------- /nimble.version: -------------------------------------------------------------------------------- 1 | # nimble --version >> nimble.version 2 | nimble v0.14.2 compiled at 2024-07-21 16:13:07 3 | git hash: be2f1309b35a6189ff5eb34a007793e6d3f94157 4 | -------------------------------------------------------------------------------- /uv.lock: -------------------------------------------------------------------------------- 1 | version = 1 2 | requires-python = ">=3.12" 3 | 4 | [[package]] 5 | name = "pyscript-python-dovunque-perchiunque" 6 | version = "0.1.0" 7 | source = { editable = "." } 8 | -------------------------------------------------------------------------------- /nim.version: -------------------------------------------------------------------------------- 1 | # nim --version >> nim.version 2 | Nim Compiler Version 2.0.8 [MacOSX: arm64] 3 | Compiled at 2024-07-21 4 | Copyright (c) 2006-2023 by Andreas Rumpf 5 | 6 | git hash: 5935c3bfa9fec6505394867b23510eb5cbab3dbf 7 | active boot switches: -d:release 8 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "pyscript-python-dovunque-perchiunque" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.12" 7 | dependencies = [] 8 | 9 | [build-system] 10 | requires = ["hatchling"] 11 | build-backend = "hatchling.build" 12 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from pyscript import document 2 | 3 | def cambia(event): 4 | bottone = document.querySelector("#bottone") 5 | testo = bottone.innerText 6 | bottone.innerText = cicla(testo) 7 | 8 | def cicla(testo: str) -> str: 9 | if testo == "questa": 10 | return "this" 11 | elif testo == "this": 12 | return "chistaccà" 13 | else: 14 | return "questa" 15 | -------------------------------------------------------------------------------- /pyscript_python_dovunque_perchiunque.nimble: -------------------------------------------------------------------------------- 1 | # using nimble file only to generate the lock file 2 | # not a package, not a binary, just a presentation done with nimib and nimislides 3 | 4 | # Package 5 | 6 | version = "0.1.0" 7 | author = "Pietro Peterlongo" 8 | description = "a presentation with nimislides and nimib" 9 | license = "MIT" 10 | 11 | 12 | # Dependencies 13 | 14 | requires "nim >= 2.0.8" 15 | requires "nimib >= 0.3.12" -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | // cicla su questi testi 2 | const texts = ["questa", "this"]; 3 | let currentIndex = 0; 4 | 5 | // prendi il bottone 6 | const button = document.getElementById("cliccami"); 7 | 8 | // aggiungi event listener per evento click 9 | button.addEventListener("click", () => { 10 | // aggiorna indice 11 | currentIndex = (currentIndex + 1) % texts.length; 12 | // aggiorna testo bottone 13 | button.textContent = texts[currentIndex]; 14 | }); 15 | -------------------------------------------------------------------------------- /nim.cfg: -------------------------------------------------------------------------------- 1 | --path="nimbledeps/pkgs2/nimib-0.3.12-f905e5b5233411fc4608f27187da5726976f28ab/" 2 | --path="nimbledeps/pkgs2/mustache-0.4.3-9c7e49440ae9bb6494bd202eea6ef7405811c6bb" 3 | --path="nimbledeps/pkgs2/markdown-0.8.8-a59d1205efe2e0bbc3657481e188ce7e7de3d943" 4 | --path="nimbledeps/pkgs2/parsetoml-0.7.1-586fe63467a674008c4445ed1b8ac882177d7103" 5 | --path="nimbledeps/pkgs2/jsony-1.1.5-6aeb83e7481ca8686396a568096054bc668294df" 6 | --path="nimbledeps/pkgs2/fusion-1.2-408bde8679bce63dfb6f424e107eb37c5eb31510" 7 | --path="nimbledeps/pkgs2/nimiSlides-0.2.6-61de4f10c06a123d4256f9ea0aadc0afe9ddacaa" -------------------------------------------------------------------------------- /my.nim: -------------------------------------------------------------------------------- 1 | import std / strutils 2 | export strutils 3 | import nimib, nimislides 4 | 5 | const 6 | colorAgile* = "#02A4BD" 7 | 8 | template addNbTextSmall* = 9 | nb.partials["nbTextSmall"] = "" & nb.partials["nbText"] & "" 10 | nb.renderPlans["nbTextSmall"] = nb.renderPlans["nbText"] 11 | 12 | template nbTextSmall*(text: string) = 13 | nbText: text 14 | nb.blk.command = "nbTextSmall" 15 | 16 | template reference*(text: string) = 17 | nbTextSmall: text 18 | 19 | template myInit*(sourceFileRel = "my.nim") = 20 | nbInit(thisFileRel=sourceFileRel, theme=revealTheme) 21 | setSlidesTheme(Simple) 22 | addNbTextSmall 23 | nbRawHtml """ 24 | 31 | """ % [colorAgile] 32 | # $1 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pyscript-python-dovunque-perchiunque 2 | 3 | presentazione su pyscript 4 | 5 | per il meetup [Python Catania del 30 Agosto 2024](https://www.meetup.com/it-IT/python-catania/events/302671524/) 6 | 7 | ## slides 8 | 9 | slides fatte in [nim] con [nimib] e [nimislides] 10 | 11 | ### shortcut per me 12 | 13 | per vedere le slide in locale (fatti un favore e usa [uv]) 14 | 15 | uv run python -m http.server 16 | 17 | poi: 18 | 19 | http://localhost:8000/index.html 20 | 21 | o cose tipo: 22 | 23 | http://localhost:8000/chistacc%C3%A0.html 24 | 25 | ## chistaccà 26 | 27 | "chistaccà" è questa (qua) in Siciliano (credo). 28 | 29 | 30 | [uv]: https://docs.astral.sh/uv/ 31 | [nim]: https://nim-lang.org/ 32 | [nimib]: https://github.com/pietroppeter/nimib 33 | [nimislides]: https://github.com/pietroppeter/nimib 34 | -------------------------------------------------------------------------------- /questa.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |