Rimu Markup CHANGELOG
See the Git commit log for more detailed information.
Version 7.2.0 (2016-04-06)
- Added
safeMode
bit-mask 8 (add 8 tosafeMode
) to unconditionally enable Macro Definitions. Allowing Macro Definitions is not intrinsically unsafe because their safety or otherwise is solely determined by the safety of their constituent elements. safeMode
5 generalized by incorporating it into a bit-mask (4).- Bug fixes.
Version 7.1.0 (2016-04-02)
Added
"css-properties"
syntax to Block Attributes element (a shortcut for the commonly used Block Attributes[style="..."]
idiom).Added CSS text alignment classes
align-left
,align-center
,align-right
to the rimuc--styled
option.Added
page-break
andno-page-break
CSS classes to the rimuc--styled
option to allow printer page breaks to be specified.A new, stricter, Safe Mode 5 which skips Block Attributes elements altogether which:
- Disables direct CSS control (via CSS classes or CSS properties).
- Disables HTML element ID creation (so you cannot override existing IDs).
rimuc command outputs error messages to
stderr
(notstdout
).rimuc command outputs rendered HTML even if there are errors (previously if an error occurred no HTML would be outputted which was surprising).
rimuc
--safeMode
and--htmlReplacement
options have been deprecated and are superceded by standard lower case hyphenated option names--safe-mode
and--html-replacement
.
Version 7.0.3 (2016-03-27)
- Documentation updates.
Version 7.0.2 (2016-01-10)
- Documentation updates.
Version 7.0.1 (2016-01-08)
- npm publication glitch – did not pick up README. The “glitch” was subsequently found to be bogus.
Version 7.0.0 (2016-01-08)
BREAKING CHANGE: A single UMD formatted Rimu library file
rimu.js
(along with the minified versionrimu.min.js
) are now distributed instead of previous separate CommonJS and browser versions (rimu-commonjs2.js
,rimu-var.js
,rimu-var.min.js
) so you will need to rename the latter in code that imports the Rimu library.Ported
rimuc
to TypeScript and added a test suite forrimuc
.The Rimu
rimu.d.ts
ships with the npm package and is specified inpackage.json
using the TypeScript 1.6 typings for npm packages feature. The upshot being that Rimu’s TypeScript declarations are loaded automatically from the rimu npm package when you import the Rimu library from a TypeScript source file:// Automatically loads node_modules/rimu/bin/rimu.d.ts import Rimu = require('rimu')
Use Webpack to minify the Rimu library – this reduced the minified
rimu.min.js
to 18.7KB (previously was 28.2KB).Upgrade all build tools to latest versions.
Version 6.1.0 (2015-08-19)
- Allow macro invocations in API Option element values.
- Allow Quote elements in URL and and email address captions.
- Add
callback
API torimu.d.ts
type definitions file. - Replaced nodeunit with Tape for unit tests.
Version 6.0.0 (2015-07-12)
Misspelled macro invocations are insidious and easily overlooked. The problem has finally been resolved with the introduction of an API callback option that emits diagnostic messages.
The rule for macro expansion is now very simple: If a macro is not
defined its invocation is rendered verbatim. The rimuc
command
--lint
option will emit an error if a macro is undefined (to
suppress these warnings escape the macro invocation with a backslash).
Many of the examples in the Rimu documentation are now live – you can edit them by clicking the Edit icon. Live edit is a good example of using Rimu macros to refactor repetitive chunks of code.
Added
callback
API option. Thecallback
function handles diagnostic events emitted by therender()
API as it parses the Rimu source. Diagnostic events include:- Undefined macro invocation.
- Unterminated Delimited Block.
- Illegal and invalid block options.
- Illegal Delimited Block name.
- Illegal API Option name.
- Deprecated existential macro invocation.
Added
--lint
option to therimuc
command which checks the Rimu source for inconsistencies and errors.Added Existential macro definition syntax:
\{macro-name?} = 'macro-value'
Existential macro definitions are only processed if the macro has not been defined and are useful for establishing default values.rimuc
passes the contents of files with an.html
extension directly to the output. This allowsrimuc
to process HTML from other sources.The highlighting of broken fragments by
rimuc --styled
outputs has been removed – it’s in the wrong place, errors should be caught at compile-time and this feature will probably be added to a future version of therimuc
compiler.
Breaking changes:
The
macroMode
option is no longer supported. It was introduced in version 5.0.0 and was a poorly thought-out attempt to tighten up on undefined macros – the default macroMode did make undefined macro invocations visible in the output but didn’t really solve the problem. Worst of all, different modes had different rendering semantics. There is now a single semantic for undefined macro invocations (they are rendered verbatim) and are flagged as errors via therender()
APIcallback
option.Existential macro invocations (
\{name?default}
) no longer supported. This is because invoking an undefined macro is now considered an error. You can specify default macro values using the new Existential Macro Definition syntax. Legacy Existential invocations are rendered verbatim and therimuc
--lint
option will emit a deprecation error.The previously undefined
\{--}
reserved macro is now set to an empty string when therimuc
--styled
option is used so it still behaves the same with Inclusion and Exclusion macro invocations – if you use it in other contexts you should explicitly set it:\{--} = ''
.
Version 5.4.0 (2015-06-28)
- Moved Rimu reference documentation from the Rimu Playground into a separate updated Reference manual.
- Restyled and simplified the Playground.
- Features added to the
rimuc
command--styled
option (details in the new Reference manual):- Now generates unique slug ids for top level
h1
,h2
andh3
headers irrespective of the--toc
option (previously it was possible to generate non-unique slug ids). - It Highlights broken fragment URLs.
- Now generates unique slug ids for top level
Version 5.3.0 (2015-06-22)
Added --title TITLE
, --highlightjs
, --mathjax
, --toc
, --section-numbers
styling macro shortcut options to rimuc
. The preceding example can now be
shortened to:
rimuc --styled --toc README.md
Version 5.2.0 (2015-06-20)
The rimuc
command can now generate a table of contents: If the --toc
macro is defined
and is not blank then the rimuc
command --styled
option generates a table of contents.
For example:
rimuc --styled --prepend "{--toc}='yes'" README.md
Top-level h1
, h2
and h3
HTML tags contribute to the table of contents.
Version 5.1.0 (2015-06-13)
New features:
You can append CSS class names to Delimited Block opening delimiter lines and they will be injected into the block’s opening HTML tag (this is an alternative to using a Block Attributes element and was added primarily for compatibility with Github Flavored Markdown’s code block highlighting). For example:
``` javascript if (message) { console.error('Error: ' + message); } ```
Underscores within words rendered verbatim and are not treated as underscore emphasis quotes (Github Flavored Markdown behaviour).
Add
+
bulleted list ID (Markdown syntax).Lists can be terminated by two or more blank lines.
Typographical nicities added to the example .rimurc file.
Version 5.0.0 (2015-06-07)
This version adds new API options, an API Options element and more Markdown compatibility. It also includes some breaking changes.
- Added
macroMode
API option to specify which macro invocations are processed. - Added
reset
API option to reset the API to its default state. - Added Markdown compatible double back-tick
code quotes
and double underline__strong quotes__
. - Added API Option element to allow API options to be set in Rimu source.
- Bug fixes.
- Add
--macroMode
and--htmlReplacement
options torimuc
command. The--safe-mode
is renamed to--safeMode
(--safe-mode
still works but is deprecated).
Breaking changes:
Changed default behavior of single-asterisk quote from strong to emphasis to align with Markdown. To reinstate old behavior use this quote definition:
* = '<strong>|</strong>'
.By default only defined and reserved macro invocations are expanded. Previously all macros were expanded which to often generated surprising results e.g. if the
text
macro was not explicitly defined then$\{text}
would silently render$
. To revert to the previous behaviour set themacroMode
API option to1
.Replacements are processed before quotes (previously they were processed after quotes). This is ensures quotes are not expanded inside URLs (notably underscores) and aligns with Markdown behaviour. If there are escaped quotes in URLs they will no longer be unescaped and you will need to remove them.
The
render()
API only changesoptions
that are explicitly specified. Previously, unspecifiedoptions
were set to their default values which was surprising and potentially dangerous because it reset thesafeMode
to the default unsafe value of zero unlesssafeMode
was explicitly specified otherwise.A backslash immediately preceding a closing code quote is now rendered verbatim and does not escape the quote.
Version 4.0.1 (2015-05-06)
Documentation updates (no functional changes).
- Use Markdown links and headers syntax in documentation. Most users will already know and use Markdown so this makes Rimu example source more familar and easier to assimilate.
Version 4.0.0 (2015-05-05)
Switched codebase from Internal to External (ES6 compatible) module syntax.
Modules are bundled into deployable JavaScript libraries using Webpack.
The single
rimu.js
compiled library file has been replaced by two separate library files:rimu-var.js
for use in HTML script tags.rimu-commonjs2.js
for use with CommonJS (Node.js) applications.
Version 3.3 (2015-01-12)
More Markdown compatible syntaxes added to Rimu core (these syntaxes were previously added using custom definitions):
- Links:
[caption](url)
. - Images:
![alt](url)
. - Bold text:
**bold**
. - Strikethrough text:
~~strikethrough~~
(GitHub Flavored Markdown).
Version 3.2 (2015-01-07)
Auto-encode (most) raw HTTP URLs as links.
Added Markdown compatible Quote Paragraphs (paragraphs starting with
>
rendered inside a<blockquote>
HTML element).Added backtick delimiter for code blocks - - backtick is now the normative code block delimiter (the older dash delimiter is deprecated but will never be dropped). backtick rationale:
- Consistency: aligned with use of backtick to quote inline code.
- Familarity: looks like a Github Flavored Markdown fenced code block.
Version 3.0 (2013-10-28)
Added Delimited Block definitions.
Enhanced and refined Macros.
Many other enhancements, additions and documentation updates.
Indented Paragraphs and Code Blocks no longer expand macro invocations by default. To reinstate old behavior use these delimited block definitions:
|code| = '+macros' |indented| = '+macros'
Indented Paragraph emits same code as Code Block. To reinstate old behavior use this delimited block definition:
|indented| = '<pre>|</pre>'
Dropped the deprecated + line-break, use the newer backslash line-break. To reinstate the old + line-break use this replacement definition:
/[\\ ]\+(\n|$)/g = '<br>$1'
Version 2 (2013-07-26)
- Added Quote and Replacements definitions.
- A number of other enhancements, additions and documentation updates.