The changelog includes a bit of the early history of nimib, pointers to relevant examples of usage of nimib and heartfelt thanks to some of the fine folks that made this development possible.
For contributors: make sure to have a relevant and clear message for your PR and when merging update the first PR message with relevant notes regarding the PR (these notes will be used by maintainers during release, see below).
Notes for maintainers:
- When a maintainer merges a PR, they should make sure that the squashed commit message is relevant and clear.
- When we tag a new release, we should auto generate the release notes. It does not hurt if we add more context to the release notes (e.g. taking notable elements from PR discussion). We might also want to add a release discussion post.
- finally, after a release, we update this changelog (and bump version) using the same wording from release notes: https://github.com/pietroppeter/nimib/releases
- Update changelog.md with 3.11 release notes and bump 3.12 by @pietroppeter in #239
- Make Nimib logging to stdout optional (
-d:nimibQuiet
) by @neroist in #242 - Add nbVideo & nbAudio (revive #153) by @neroist in #244
- Create homeDir if it doesn't exist alredy by @neroist in #246
Full Changelog: https://github.com/pietroppeter/nimib/compare/v0.3.11...v0.3.12
- Update changelog.md and bumping to 3.11 by @pietroppeter in #231
- paths.nim: Fix import for FreeBSD by @lbartoletti in #238
- @lbartoletti made their first contribution in #238
Full Changelog: https://github.com/pietroppeter/nimib/compare/v0.3.10...v0.3.11
- bump 0.3.10 and update changelog with 0.3.9 release notes by @pietroppeter in #199
- Enlarge figure and center figure captions by @dlesnoff in #201
- Refactor tests and remove hints to better visualize success/failure by @dlesnoff in #202
- Complete Allblocks by @dlesnoff in #203
- Automatically change file ext to
md
when usingnbInitMd
(and add athisFileRel
param) by @neroist in #206 - Allblocks: add nbShow, nbCodeWithText, nbCodeInBlock by @dlesnoff in #208
- update to numericalnim 0.8.8 by @HugoGranstrom in #214
- Fix std/random bug (#204) by @sent44 in #211
- Happyx support by @quimt in #212
- Add nbFile overload for file embedding by @PhilippMDoerner in #219
- fix issue#229: skip nimble INFO logs when dumping json by @lost22git in #230
- @sent44 made their first contribution in #211
- @quimt made their first contribution in #212
- @PhilippMDoerner made their first contribution in #219
- @lost22git made their first contribution in #230
Full Changelog: https://github.com/pietroppeter/nimib/compare/v0.3.9...v0.3.10
- Update water.css and fix code output by @dlesnoff in #185
- Add
nbCodeSkip
andallblocks.nim
by @neroist in #187 - fix typo in CONTRIBUTING.md by @neroist in #188
- Add
nbCapture
, closes #156 by @neroist in #189 - Add meta tag with generator, closes #170 by @neroist in #190
- Fix special chars escaped by the markdown renderer, close #159 by @neroist in #191
- Make "figure:" not show up when using nbImage with no caption by @neroist in #192
- Add seperate
alt
param tonbImage
, close #193 by @neroist in #195 - Fix
getNimibVersion()
by @neroist in #196
Full Changelog: https://github.com/pietroppeter/nimib/compare/v0.3.8...v0.3.9
- remove export escapeTag by @HugoGranstrom in #181
- nim-markdown released a new version which doesn't export
escapeTag
anymore, so we remove it. Not sure why we did it to begin with tbh.
- nim-markdown released a new version which doesn't export
- Implement nbShow and highlight.js support for code in markdown by @HugoGranstrom in #179
nbShow
can be used to pretty print any type which implements atoHtml
proc that returns a string of HTML to be rendered.- Code blocks in markdown are now highlighted dynamically using highlight.js.
- updated changelog with 0.3.6 release notes + change in changelog workflow by @pietroppeter in #176
- Change toml lib + fix macro bug on devel by @HugoGranstrom in #173
with this PR nimib is finally compatible with the upcoming 2.0. Two things needed fixing:
- a nim compiler orc macro bug (reported here: nim-lang/Nim#21326), fixed with a workaround
- there was an issue with toml serialization on orc (reported here: status-im/nim-toml-serialization#62) fixed by removing the dependency from toml_serialization and using parsetoml instead
- some custom code in order to support direct to object conversion was needed, see NimParsers/parsetoml#59
- we also added a dependency to jsony to support a loose direct to object conversion from toml
- Adding devel to CI, fix #161, fix #149 by @pietroppeter in #169
- added both stable (which will become 2.0) and devel (which is currently the 2.0 rc) to CI, also update the versions of actions we depend on
Full Changelog: https://github.com/pietroppeter/nimib/compare/v0.3.5...v0.3.6
release discussion: #175
- codeAsInSource has been reworked to work better with templates and uses of
nbCode
in different files. The cases that still don't work is when code from different places are combined in a singlenbCode
, like here:
template foo(body: untyped) =
nbCode:
body # This code is from line 7
echo "Hello world" # this code is from line 4
foo:
echo "Goodbye world"
- If you don't use any nbJs, now nimib won't build an empty nim file in those cases.
- The temporary js files generated by nbJs now has unique names to allow parallel builds.
- added
nbCodeDisplay
andnbCodeAnd
(#158). They provide an easy way to:- display code in
nbJsFromCode
and friends - run code both in js and c backend
They are also generic templates that can be used with other templates
and do not depend on any specificities of
nbJsFromCode
templates.
- display code in
- Refactored nbJs (#148)
- Breaking: All
nbJsFromCode
blocks are now inserted into the same file (Compared to previously when each block was compiled as its own file). So this will break any reusable components as you will getredefinition of variable
errors. The solution is to usenbJsFromCodeInBlock
which puts the code inside ablock
. Imports can't be done in there though so you must do them in a separatenbJsFromCode
ornbJsFromCodeGlobal
before. - See https://pietroppeter.github.io/nimib/interactivity.html for a more detailed guide on how to use the new API.
- Breaking: All
- Added
nimibCode
template. One problem with usingnbCode
is that you can't show nimib code using it because it nests blocks and wrecks havoc. SonimibCode
allows you to show nimib code but at the cost of not capturing output of the code.
- Add
hlHtml
andhlHtml
to nimiBoost - fix rarely occuring issue of terminal output not being captured (windows only, see example in #132)
- compress line height in nbCode output (using class
nb-output
), see #133 - Fixed a case when capturing a global in
nbJsFromCode
didn't gensym the symbols, causing the same variable names in the generated code. #136
- fix "Did not parse stylesheet at 'https://unpkg.com/normalize.css/' in strict mode" (#120)
- Split untyped and string versions of
nbCodeToJs
intonbJsFromCode
andnbJsFromString
. Same fornbCodeToJsInit
βnbJsFromCodeInit
,nbJsFromStringInit
(#125) - Add
postRender
template tonbKaraxCode
(#125) nbJsFromCode
now respectsexportc
pragma (#125)- rename
rawOutput
(deprecated) torawHtml
This release started with the aim of making the construction of custom blocks as easy as the construction of native blocks.
A wide refactoring of the codebase was required for this (#78)
and further adjustments were made along the way (#80, #81).
Some new blocks are introduced taking advantage of this (e.g. nbRawOutput
, nbPython
) (#80, #83).
Contributing to the codebase is made easier through introduction of proper testing (#80) docs are now built in CI (#89, #90, #91) and deploy previews have been added (#92, #93). Documentation has been updated to include all changes so far and contextually the changelog has been updated (#103).
A big milestone is reached (#88) by introducing templates to add interactivity to documents
taking advantage of nim js backend (nbCodeToJs
allows to incorporate javascript scripts in the document derived from nim code).
In particular templates to reduce boilerplate when developing karax based apps or
widgets are introduced (nbKaraxCode
, karaxHtml
).
Three new example documents are introduced for documenting this change (interactivity
, counters
, caesar
).
Another major change is setting as default the CodeAsInSource
introduced in 0.2.4
(a number of fixes are made: #105, #106, #108).
Most of these contributions are due to @HugoGranstrom (thanks for all the awesome work on this β€οΈ) which joins @pietroppeter as maintainer and co-creator of nimib! π₯³
List of detailed changes:
- refactoring of
NbBlock
type and rendering of blocks (#78, fixes #24):NbBlock
type is completely refactored. Instead of having akind
with a fixed number of values, a block behaviour is specified by acommand
string which is set to the name of the command template used to create a block (e.g.nbCode
,nbText
,nbImage
, ...) -newNbBlock
is now the main template to create a new block- Every block now has a
context
field and the rendering backend (either html or markdown) has a mechanism to retrieve apartial
for every command. - as an additional mechanism to be able to perform other computations when rendering,
a sequence of
renderProc
s can be assigned for every command (for a specific backend). nimib / renders
module completely refactored to take into account the above changes- some other accidental or not so welcome changes that happened during the refactoring:
sugar
is now exported (accidental)nb: NbDoc
is mutated when rendered (unwelcome, will be changed later)- cannot use both Html and Md backend at the same time (unwelcome, will be changed later)
- logging has been improved (see changes in
nimib.blocks.newNbBlock
) (#78) - new
main
partial introduced (#78) - fixed cheatsheet document (#78, fixes #52)
- tests are added and ptest document is removed (#78)
- aliases to minimize breaking changes that happened in 0.2 (
nbDoc
,nbBlock
,nbHomeDir
) are noew removed (#78) - added a new
readCode: bool
parameter tonewNbBlock
(with an overload that sets it as true) (#80) - new template
nbRawOutput
that renders raw html (#80) - new command
nbClearOutput
that removes output from last block processed (#80) - new templates for creating code blocks
newNbCodeBlock
andnewNbSlimBlock
for creating custom blocks and related changes (#81):newNbCodeBlock
: captures source code ofbody
newNbSlimBlock
: block without abody
(and in particular no capture of source)- all nimib "native" blocks now use one of the two mechanism above
- now
nbText
does NOT contain its source - new
nbTextWithCode
that does contain code source
- new example document
files.nim
, changed the rendering ofnbFile
(no more "writing file ..." only the name of file is added) (#81) - added
loadNimibCfg
proc that can be used for themes (used by nimibook) (#81) - added
nbInitPython
andnbPython
templates to support running python in nimib documents usingnimpy
(#83)md
andfmd
fromnimib / boost
now deprecated and replaced byhlMd
andhlMdF
- new
hlPy
andhlPyF
innimib / boost
- docs now are built in CI (#89, #90, #91)
- sources of docs are now in folder
docsrc
- outputs are in
docs
- sources of docs are now in folder
- add deploy preview through netlify (#92, #93)
- new templates to introduce interactivity in documents taking advantage of nim's javascript backend (#88)
nbCodeToJs
: a block of nim code is compiled to javascript and added as a script to html file (and allows capturing of variables)nbCodeToJsInit
,addCodeToJs
,addToDocAsJs
: templates to allow splitting in multiple blocks the code innbCodeToJs
nbCodeToJsShowSource
: template to show the nim source of anbCodeToJs
block.nbKaraxCode
(withkaraxHtml
): template to create a karax app/widget with minimal boilerplate (based onnbCodeToJs
)- new example document
interactivity.nim
: explains the basic ofnbCodeToJs
and related templates - new example document
counters.nim
: shows how to create counter widgets usingnbCodeToJs
- new example document
caesar.nim
: a caesar cipher app built usingnbKaraxCode
- new module
nimib / jsutils
to support the implementation of the above
newId
proc forNbDoc
that gives a new incremental integer every time it is called (#88)CodeAsInSource
is made default:- new
nimibCodeFromAst
flag to revert to old default - added a warning to
nimibPreviewCodeAsInSource
(now obsolete)
- new
- various fixes to
CodeAsInSource
(#105, #106, #108) - changelog updated and separated from documentation (#103)
- updated documentation to include most recent changes (#103)
- turned off warning for unused imports in
nimib.nim
(#103) - fix markdown backend, it was broken since html theme was overiding render backend (#103):
- new
nbInitMd
to use markdown backend - new
themes.noTheme
for empty theme (used bynbInitMd
)
- new
Thanks to @metagn for improving our CI/nimble file! Every contribution counts!
Relevant examples of usage:
- nimislides: a new nimib theme that allows to create slides using reveal.js html presentation framework
- some posts in nblog are relevant example of new blocks and customization of nimib:
- Update penguins example which now uses datamancer and shows Simpson's paradaox, by @Vindaar (#70)
- code as in source for nbCode (
-d:nimibPreviewCodeAsInSource
) by @HugoGranstrom (#63): with this option the code shown is not derived from Ast but it is read from source code. - ptest document is turned off from CI
- align version in nimble file and tagged version
- add
nbFile
by @Clonkk (#64)
- fix to
path_to_root
(renamed fromhome_path
, alsohere_path
renamed topath_to_here
) (#67)
this release aims to simplify creating Nimib themes such as nimibook.
It does this through the following changes:
- instead of creating and injecting multiple variables
(
nbDoc
,nbBlock
,nbHomeDir
, ...), nimib now only injects anb
variable that is aNbDoc
. Some aliases are provided to minimize breakage. - handling of paths (
srcDir
andhomeDir
) is changed and is based on the presence of a new config filenimib.toml
- command line options are now processed and can be used to skip/override the config process.
Run any nimib file with option
--nbHelp
to see available options. - note in particular new
--nbShow
option which will automatically open the file in your default browser. nbPostInit
andnbPreSave
customization mechanism based on includes are now removed- documentation has been updated to reflect the above changes and also to add other Nimib references (NimConf video, nimibook, getting-started, ...) most of the changes break the api
relevant external example:
- norm starts to use nimibook for its documentation
Special thanks again to to @Vindaar, @Clonkk and @HugoGranstrom for this release.
a growing ecosystem drives most of the development of the 0.1.x series:
- intro to binarylang by @ajusa (March 2021): first public use of nimib by someone other than @pietroppeter
- SciNim Getting Started decided to use nimib and for that purpose nimibook, a book theme (based of mdbook) developments was started
- nblog, a nimib blog, was started as a way to use nimib to explore nim ecosystem and experiment the various features of nimib
- nimiboost is a vs code extension to provide markdown highlighting and a preview mechanism.
changes:
- 0.1.1:
- add nbPostInit mechanism to customize document (#32)
- fix (breaking): code output is escaped by default
- fix (breaking): code output is not stripped anymore
- fix: nbDoc.write will create directories if not existing (#44)
- 0.1.2: release to align tag and nimble version
- 0.1.3: added compile-time switches to override nbHomeDir (#53)
- 0.1.4: fix for
nbImage
path (#56) - 0.1.5: new template
nbCodeInBlock
(#59) - 0.1.6: added
nimib / boost
module withmd
andfmd
helpers to support markdown highlight with nimiboost
Thanks for this release series to @Vindaar, @Clonkk and @HugoGranstrom who decided to adopt nimib in scinim/getting-started and motivated and directly contributed to nimib and nimibook development to support this use case.
At the end June 2021, nimib was presented at NimConf2021.
- initial version with essential templates
nbInit
,nbText
,nbCode
,nbImage
,nbSave
- capture of output in
nbCode
based on code by @Clonkk
- capture of output in
- html backend based on mustache and markdown by @soasme
- default theme using water.css
- header with home button, minimal title (filename by default), automatic detection of github repo
- footer with "made with nimib" and Show Source button
- static highlighting of nim code (by @yardanico)
- latex rendering through katex
- markdown backend
- essential documentation in
index.nim
- sections: intro, example usage, features, api, roadmap, thanks, Q&A
- also generates
README.md
and serves as an example of usage of markdown backend
- possibility to customize theme (dark mode, custom stylesheet, add other scripts, ...)
- example documents:
penguins
: data exploration, adding imagesnumerical
: latex usage, theme customizationcheatsheet
: toc creation, new text block which shows source, custom highlighting- also documents the markdown to html generator
mostaccio
: example of using dark mode- also documents the templating system mustache
ptest
: print testing for nimib
- deployed using github pages. html files committed in repo.
relevant external examples:
- adventofnim (2020) by @pietroppeter
- first appeareance of nimib in public (before 0.1 release), see commit on Dec 1st, 2020
Initial commit of nimib was on Nov, 25, 2020. On the same day the first milestone reached was the working hello world example.
For this release, thanks to:
- soasme for the excellent libraries nim-markdown and nim-mustache, which provide the backbone of nimib rendering and customization
- Clonkk for help in a critical piece of code early on (see this Stack Overflow answer)
- yardanico for being the first contributor and great sponsor of this library, even before an official release