Releases: pietroppeter/nimib
v0.3.2
from changelog
- Add hlHtml and hlHtml 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
and below is the automatically generated one.
What's Changed
- add hlHtml to nimiBoost by @HugoGranstrom in #131
- Fix stdout windows issue by @pietroppeter in #132
- reduced vertical spacing in default theme by @pietroppeter in #133
- gensym captured variables that haven't already been gensymed by @HugoGranstrom in #136
- release 0.3.2 by @pietroppeter in #139
Full Changelog: v0.3.1...v0.3.2
v0.3.1
What's Changed
- rerun nimble readme by @pietroppeter in #113
- fix readme hello code by @pietroppeter in #114
- fix not loading of normalize css (remove trailing forward slash), fix #119 by @pietroppeter in #120
- fix "Did not parse stylesheet at 'https://unpkg.com/normalize.css/' in strict mode" #120
- nbJs Maintainance by @HugoGranstrom in #125
- deprecate nbRawOutput for nbRawHtml and bump to 0.3.1 by @pietroppeter in #130
- rename rawOutput (deprecated) to rawHtml
Full Changelog: v0.3.0...v0.3.1
v0.3.0 - Block Maker
Release notes (from changelog)
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 ofrenderProc
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:
Following are the automatic release notes by Github
What's Changed
- Refactor nb blocks (fix #24) by @pietroppeter in #78
- A bit of everything related to v0.3 by @HugoGranstrom in #80
- replace nimble deps task with nimble install by @metagn in #84
- Release 0.3 by @pietroppeter in #81
- nbPython by @HugoGranstrom in #83
- Build docs in ci by @pietroppeter in #89
- Fix build docs in ci by @pietroppeter in #90
- Fix build docs in ci 2 by @pietroppeter in #91
- add netlify preview to CI by @pietroppeter in #92
- test and fix deploy pr preview by @pietroppeter in #93
- Compiling nim to javascript by @HugoGranstrom in #88
- make nimibPreviewCodeAsInSource the default and introduce flag nimibCodeFromAst for previous default, fix #94 by @pietroppeter in #96
- Fix codeAsInSource by @HugoGranstrom in #105
- fix codeblocks starting with a block by @HugoGranstrom in #106
- fix newline at beginning of code block by @HugoGranstrom in #108
- improving docs for v0.3 + fix markdown backend by @pietroppeter in #103
New Contributors
Full Changelog: v0.2.4...v0.3.0
v0.2.4 - nbCodeAsInSource
What's Changed
- Update penguins example, closes #69 by @Vindaar in #70
- code as in source for nbCode (-d:nimibPreviewCodeAsInSource) by @HugoGranstrom in #63
-d:nimibPreviewCodeAsInSource
Using -d:nimibPreviewCodeAsInSource
Nimib will read the source file directly and get the code from it instead of letting the Nim compiler render a cleaned-up version of the code. This means formatting and ordinary comments (#
) will be preserved (no more secrets!). There are some limitations though. It isn't 100% accurate yet so if you find that it doesn't show the code you expected, please open an issue. The known issues right now are:
- It doesn't work if the
nbCode
isn't first on the line. For example this doesn't work:
# This doesn't work!
block: nbCode:
echo "Hello World"
# This does work!
block:
nbCode:
echo "Hello World"
- If the last expression of the code block is a multiline expression, there might be edge-cases we haven't accounted for yet. But it should mostly work.
Full Changelog: v0.2.3...v0.2.4
v0.2.3 - fix version in nimble file
tagged version and version in nimble file where not aligned, this might be what causes the issue here: https://github.com/SciNim/getting-started/runs/4162963050?check_suite_focus=true
Full Changelog: v0.2.2...v0.2.3
v0.2.2 - nbFile
v0.2.1 - bug fix (path to root)
fixes path to root
v0.2 - Theme Maker
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, ...)
nimib / boost
Added nimib / boost
module with md
and fmd
helpers for markdown highlighting using nimiboost. Note that md
and fmd
are automatically available when importing nimib.
PR: #60
ref nimiboost issue: nimib-land/nimiBoost#1
nbCodeInBlock
new template that provides shortcut for:
block:
nbCode:
...
# now equivalent to:
nbCodeInBlock:
...
PR: #59
motivated by SciNim/getting-started, specifically this PR: SciNim/getting-started#22