Skip to content

Releases: pietroppeter/nimib

v0.3.2

21 Oct 14:08
f0a03e1
Compare
Choose a tag to compare

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

Full Changelog: v0.3.1...v0.3.2

v0.3.1

12 Sep 02:49
2eed8c2
Compare
Choose a tag to compare

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
  • nbJs Maintainance by @HugoGranstrom in #125
    • Split untyped and string versions of nbCodeToJs into nbJsFromCode and nbJsFromString. Same for nbCodeToJsInit β†’ nbJsFromCodeInit, nbJsFromStringInit #125
    • Add postRender template to nbKaraxCode (#125)
    • nbJsFromCode now respects exportc pragma (#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

11 Jul 11:05
b37ec6d
Compare
Choose a tag to compare

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 a kind with a fixed
      number of values, a block behaviour is specified by a command 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 a partial for every command.
    • as an additional mechanism to be able to perform other computations when rendering,
      a sequence of renderProcs 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 to newNbBlock (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 and newNbSlimBlock
    for creating custom blocks and related changes (#81):
    • newNbCodeBlock: captures source code of body
    • newNbSlimBlock: block without a body (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 of nbFile
    (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 and nbPython templates to support running python in nimib documents using nimpy (#83)
    • md and fmd from nimib / boost now deprecated and replaced by hlMd and hlMdF
    • new hlPy and hlPyF in nimib / boost
  • docs now are built in CI (#89, #90, #91)
    • sources of docs are now in folder docsrc
    • outputs are in docs
  • 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 in nbCodeToJs
    • nbCodeToJsShowSource: template to show the nim source of a nbCodeToJs block.
    • nbKaraxCode (with karaxHtml): template to create a karax app/widget with minimal boilerplate (based on nbCodeToJs)
    • new example document interactivity.nim: explains the basic of nbCodeToJs and related templates
    • new example document counters.nim: shows how to create counter widgets using nbCodeToJs
    • new example document caesar.nim: a caesar cipher app built using nbKaraxCode
    • new module nimib / jsutils to support the implementation of the above
  • newId proc for NbDoc 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)
  • 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 by nbInitMd)

Thanks to @metagn for improving our CI/nimble file! Every contribution counts!

Relevant examples of usage:

Following are the automatic release notes by Github

What's Changed

New Contributors

Full Changelog: v0.2.4...v0.3.0

v0.2.4 - nbCodeAsInSource

27 Nov 19:35
20824e4
Compare
Choose a tag to compare

What's Changed

-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

10 Nov 09:11
6e9b7eb
Compare
Choose a tag to compare

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

09 Nov 21:13
a23514a
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.2.1...v0.2.2

v0.2.1 - bug fix (path to root)

07 Nov 18:39
59a7178
Compare
Choose a tag to compare

fixes path to root

v0.2 - Theme Maker

06 Nov 17:27
df345bc
Compare
Choose a tag to compare

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 a nb variable
    that is a NbDoc. Some aliases are provided to minimize breakage.
  • handling of paths (srcDir and homeDir) is changed and is based on the presence
    of a new config file nimib.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 and nbPreSave 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

24 Jun 05:47
166b354
Compare
Choose a tag to compare

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

22 Jun 08:42
4e9b8da
Compare
Choose a tag to compare

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