github iamgio/quarkdown v1.11.0

13 hours ago

Main features and changes

Persistent headings

Used in combination with page margin content, the new .lastheading function allows for persistent headings, such as chapter titles or section names, to be displayed in the page margins of paged and slides documents.

.pagemargin {topcenter}
    *.lastheading depth:{1}*

# Chapter 1

.repeat {10}
    .loremipsum
Persistent headings

 

Mirror positions in page margins

The .pagemargin function now accepts new positions:
topoutsidecorner, topoutside, topinsidecorner, topinside, bottomoutsidecorner, bottomoutside, bottominsidecorner, bottominside.

Contrary to fixed positions such as topright or bottomleft, these mirror positions adapt based on whether the page is left or right, great for printing.

.pagemargin {topoutside}
    **This** is a margin content.
Mirror positions

The function also no longer has topcenter as the default position.

 

Custom CSS class names

Specific elements can be assigned custom CSS class names by means of the classname parameter, available in .container (for blocks) and .text (for inlines).

.container classname:{my-custom-class}
    This is a block with a custom class.

---

This is an .text {inline text} classname:{my-custom-class} with a custom class.

.css
    .my-custom-class {
      padding: 8px;
      background: linear-gradient(to right, pink 0%, lightblue 100%);
    }
Custom classes

Tip

You can return custom elements from user-defined functions for enhanced reusability and readability!

 

Multiple font configurations

.font calls can now be stacked to create multiple font configurations, which are applied in order. Each configuration acts as a fallback for the next one, in case the current font does not contain glyphs for certain characters.

This is particularly useful for multi-language documents. For example, you may set a primary font for Latin characters and a fallback font for CJK characters:

.font {GoogleFonts:Ma Shan Zheng}
.font {GoogleFonts:Corinthia}
Multi-language fonts

 

Emojis from shortcodes

Emojis can now be inserted using shortcodes via the .emoji function.

Type Result Code
Simple shortcode 😉 .emoji {wink}
One skin tone 👋🏾 .emoji {waving-hand~medium-dark}
Two skin tones 🧑🏼‍🤝‍🧑🏾 .emoji {people-holding-hands~medium-light,medium-dark}

For a complete list of supported shortcodes, refer to the Emoji Cheat Sheet.

Fun fact: the cheat sheet was generated with Quarkdown + Hugo!

 

Table generation by rows

The new .tablebyrows function allows for dynamic table generation by rows.

.var {headers}
   - Name
   - Age
   - City

.tablebyrows {.headers}
  - - John
    - 25
    - NY
  - - Lisa
    - 32
    - LA
  - - Mike
    - 19
    - CHI
Name Age City
John 25 NY
Lisa 32 LA
Mike 19 CHI

 

.codespan

.codespan {text} can now be used to create inline code spans, similar to backticks (`text`).

Just like .code as an alternative to triple-backtick code blocks, the difference is that .codespan supports function calls, allowing
for dynamic content, whereas backticks do not.

 

Faster frontend and PDF generation

The web frontend underwent a complete rewrite, with performance and maintainability in mind.
The number of synchronous tasks has been reduced, making initial page load faster, with impact on PDF generation time as well.

What's Changed

  • [dev] refactor: improve robustness of module management by @iamgio in #214
  • refactor/feat: TypeScript frontend migration + persistent headings implementation by @iamgio in #220
  • feat: emojis and table generation by rows by @iamgio in #224
  • build(deps-dev): bump happy-dom from 20.0.0 to 20.0.2 in /quarkdown-html by @dependabot[bot] in #225
  • feat: allow stacking font configurations by @iamgio in #226
  • feat: add classname parameter to .container by @iamgio in #227
  • feat: add classname parameter to .text by @iamgio in #228
  • feat: page margins mirror positions by @iamgio in #230
  • [dev] refactor(ts): add page abstraction, simplify page numbers and page margins handlers by @iamgio in #231

Full Changelog: v1.10.0...v1.11.0

Sponsors

Shout out to our new sponsor: @RayOffiah 🎉

Falconer

Don't miss a new quarkdown release

NewReleases is sending notifications on new releases.