Repository navigation
v1.0.0
Ten years ago today, we find 280de0d:
commit 280de0d358d6f0b26bab4954f52b5cc73261ee79
Author: Yuki Izumi <kivikakk@github.com>
Date: Thu Nov 17 14:05:13 2016 +1100
initial
I'd recently been put onto the CommonMark migration at work, and there was this neat new systems language called Rust that I really wanted to try out in earnest. What a good opportunity! I had no idea it'd become my longest-lived project, and lead to so many interesting connections and collaborations. My life has changed a lot because of this project (and, uh, perhaps my tenacity in keeping on with it during the years when there wasn't much in the way of intrinsic or extrinsic motivation to do so), and I'm really happy for that.
Happy 10th birthday, Comrak!
For users coming from 0.x (0.59.0), please read the release candidate changes too. Between rc.2 and here, I've marked ~just about everything non-exhaustive that can be, replaced some argument lists with structs; whatever we needed to make sure we can add to Comrak in future without necessitating a major version bump. You'll find some new constructors and builders that'll need to be used in place of creating the struct yourself.
What does 1.0 mean beyond API semver?
Here's what we commit to:
- Patch releases
- Output changes: incorrect output (bugs, like a missing symbol or something), incorrect sourcepos, anything that results in a crash, a hang, or a security issue (e.g.
dangerous_urltightening). If there was any way we weren't compatible with the current CommonMark target (and it'd have to be a textual interpretation issue, as we're always passing the executable spec), that'd be a bug and also come in here. - MSRV bumps: never.
#[doc(hidden)]items: may change.- Option defaults: never.
- Cargo features: never.
- CLI bits and pieces (arguments, exit codes, config file format, stdin/stdout): never.
- Output changes: incorrect output (bugs, like a missing symbol or something), incorrect sourcepos, anything that results in a crash, a hang, or a security issue (e.g.
- Minor releases
- Output changes: new output from a new option or extension; upgrading to a new CommonMark version. Since we're writing our own specs, we don't intend to try to be compatible with any changes a future GFM spec may bring --- not that we anticipate any. We remain executably compatible with it as it stands at 0.29-gfm.
- Comrak spec changes where new examples are added may fall in patch or minor releases, depending on their nature.
- Any option or extension currently without a complete write-up per #924 is liable to change output in the minor version it gets its spec! It'll probably be in very edge-case-y ways you might never have run into, but be warned.
- MSRV bumps: can happen, always at least 6 months old.
#[doc(hidden)]items: may change.- Option defaults: never.
- Cargo features: adding a feature, or adding to an existing one.
- CLI bits and pieces: flags might get added, additional selections might get added to existing flags (e.g.
--extension,--list-style); nothing else.
- Output changes: new output from a new option or extension; upgrading to a new CommonMark version. Since we're writing our own specs, we don't intend to try to be compatible with any changes a future GFM spec may bring --- not that we anticipate any. We remain executably compatible with it as it stands at 0.29-gfm.
- Major releases
- Output changes: literally anything else.
- This includes Comrak spec changes where an existing example is changed.
- MSRV bumps: can happen.
#[doc(hidden)]items: may change.- Option defaults: may change.
- Cargo features: may change.
- CLI bits and pieces: may change.
- It's like Web 2.0 but for Comrak.
- Output changes: literally anything else.
API deprecations will be flagged in a minor release, to be removed in the next major.
Note that each output format also has its own nuances:
- Comrak's AST is kind of the ur-output format, and the above applies to it. For a given set of options, you expect to see the same kinds of node types and where they nest. It won't change in patch releases (unless clearly a bug), and may change in minor releases with new options/extensions, CommonMark upgrades, or added Comrak spec examples.
- HTML has the CommonMark spec and Comrak's fixture-based docs. If there's edge cases the docs don't cover, then I think they're bugs if they don't make sense in light of the documented intent, and fixing them (and documenting them!) isn't a breaking change. Changing things like class names and
data-attributes is breaking. - CommonMark is promised to re-parse to the same AST, but not necessarily beyond that. A
Strongnode may be output as__strong__today and**strong**tomorrow under default options and I wouldn't call that breaking. Your code block may come out with a different length fence, so long as it means the same thing. - XML will always have the same element and attribute names, but who knows, maybe I'll start interior-spacing all the tags
< like / > < this / >. I won't, but I might be lying.
Okay, gimme the changes
Changed APIs:
- Future-proof the public API to permit future expansion without breaking you. (by @kivikakk in #933)
Options,Extension,Parse,Render,PluginsandRenderPluginsare#[non_exhaustive]; start fromDefaultand modify, or use the builders, including the newOptions::builder().Renderis no longerCopy. We loseCopyin case we want to add a non-Copyelement in the future (likeStringorVec).
NodeValueand its payload structs are#[non_exhaustive]; payloads get constructors, likeNodeList::bullet,NodeList::ordered,NodeCodeBlock::fenced, andNodeLink::new.NodeList,NodeDescriptionItem,NodeHeading,NodeTaskItem,NodeMultilineBlockQuote,GridTableColumn, andNodeGridTableCellare no longerCopy.NodeValue::ThematicBreak,Emph,Strong, andStrikethroughget (intentionally blank) payload structs, andTableRow(bool)is nowTableRow(NodeTableRow).AlertType,AlertStyleType,Attributes,ChildRendering,HeexNode, andValidationErrorare#[non_exhaustive].CodefenceRendererAdapter::writetakes aCodefenceMeta, and allSyntaxHighlighterAdaptermethods take aSyntaxHighlightMeta, which has a now-non-optionallang(we always passed it), plusmeta.HeadingAdapter::entergets its sourcepos fromHeadingMeta;HeadingAdapter::exitgets it too now.ResolvedReferenceandBrokenLinkReferenceare#[non_exhaustive]; useResolvedReference::new.options::WikiLinksModeis no longer public (its only ctor wasn't).- Optional dependencies no longer create implicit features: so
clap,shell-words,xdg,fmt2io, andemojisare gone. They weren't helpful, as we didn't do feature detection on them anyway; usecliandshortcodes.
New APIs:
- Support block-level display math, with the
math_dollars_blockextension andNodeValue::MathBlock. (added by @szdytom in #931) SourceposimplementsDefault. (by @kivikakk in #933)
Documentation:
- Document OFM comments with care. (by @szdytom in #930)
- Document grid tables with care. (by @kivikakk in #932)
Build changes:
- CI checks the public API against a cargo-public-api snapshot. (by @kivikakk in #933)
- CI runs
cargo semver-checksagainst the latest release. (by @kivikakk in #933)
Behind the scenes:
Diff: v1.0.0-rc.2...v1.0.0