Skip to content

Releases: ipikuka/remark-flexible-containers

v1.5.2

30 Oct 17:14

Choose a tag to compare

The changes made by @talatkuyuk:

  • Update devDependencies
  • Update vite config (vitest@4)
  • Fix test coverage 100%
  • Add sponsorship section in README.md
  • Fix a broken link in README.md
  • Add a consideration for MDX format into README.md

v1.5.1

22 Sep 06:06

Choose a tag to compare

The changes made by @talatkuyuk:

  • Update devDependencies
  • Update README.md (some corrections in typing and syntax)

v1.5.0

03 Sep 14:18

Choose a tag to compare

The changes made by @talatkuyuk:

  • Add <details> <summary> feature. See here
  • Add attributes into specific identifiers in addition to tag name, classname and id. See here
  • Add information about details summary element and attributes as specific identifiers into README.md

v1.4.1

02 Sep 11:23

Choose a tag to compare

The changes made by @talatkuyuk:

  • Add a test for no type, no title, with non-ASCII content
  • Make refinements in the code
  • Fix type coverage rate (100%)
  • Fix multiple classNames in specific identifiers
  • Add parseFenceTypeTitle helper to simplify paragraph node analyzers

v1.4.0

30 Aug 21:46

Choose a tag to compare

The changes made by @talatkuyuk:

  • Add FUNDING.yml (supporting me is welcome, thanks)
  • Update devDependencies
  • Add support for working with more colons (>=3) (a huge thanks to @hybridherbst)
  • Add support for nested containers (a huge thanks to @hybridherbst)
  • Add tests for nested containers (a huge thanks to @hybridherbst)
  • Update README.md for adding info about supporting nested containers

v1.3.0

05 Jun 12:02

Choose a tag to compare

The changes made by @talatkuyuk:

  • Add unified into peerDependencies
  • Update dependencies and devDependencies
  • Migrate from jest to vitest v3.2
  • Migrate eslint v8 to v9 and apply flat config
  • Update .prettierrc
  • Add .editorconfig file
  • Update github actions
  • Add a test case
  • Fix eslint errors
  • Fix package-lock.json
  • Update the copyright date in the LICENSE
  • Update keywords in package.json
  • Update README.md
    • Update badges/links
    • Chore corrections
    • Remove keywords
    • Add plugins which I recently developed into list

v1.2.1

13 Mar 20:44

Choose a tag to compare

The changes made by @talatkuyuk

  • added a test util, and updated all the tests
  • fixed: specific identifiers for the title should break the option title: () => null, and the title should take place

v1.2.0

13 Mar 18:42

Choose a tag to compare

Release notes and changes made by @talatkuyuk

  • updated the dependencies
  • added package-lock.json on behalf of npm clean install in the github actions
  • the options titleProperties and containerProperties are not allowed to have className in the returned object
  • made refinements in the code
  • improved the typing system, @types/mdast is extended with new Container type
  • added test coverage 100% and codecov connection
  • added type coverage 100%
  • added a github action for commits and pull requests
  • added npm provenance
  • added a test file for creating details-summary HTML elements via plugin
  • updated README.md including badges, plugin list, options and support for specific identifiers sections

Added Support for Specific Identifiers

::: [type] [{tagname#id.classname}] [title] [{tagname#id.classname}]

Now, the remark-flexible-containers supports syntax for specific identifiers (tagname, id, classnames) for individual container and title node. For example:

::: info {section#foo.myclass} Title Of Information {span#baz.someclass}
<!-- content -->
:::
<section class="remark-container info myclass" id="foo">
  <span class="remark-container-title info someclass" id="baz">
    Title Of Information
  </span>
  <!-- content -->
</section>

The identifiers (tagname, id, classnames) must be inside curly braces.

Syntax is very simple.

  • tagname is to be compatible HTML tag name, and may present only once,
  • id is to start with hash #, and may present only once,
  • classnames are to start with dot ., and may present many.

There are two groups of identifiers. Each group is optional, may present or not.
The first group of identifiers (just after the type) is for container node.
The second group of identifiers (just after the title) is for title node.

Here are some example usages. For simplicity, I omitted the container contents and ending syntax, just put the beginning syntax in the examples. All are valid usage for specific identifiers.

These identifiers can be placed as all three, any two, or just any of them in the desired order, with or without a space between them. This is why the "flexibility" term comes from.

::: info {section#foo.myclass.second-class} Title {span#baz.someclass.other-class}
::: info {section#foo.myclass} Title {span#baz.someclass}
::: info {section #foo .myclass .second-class} Title {span #baz .someclass .other-class}
::: info {section #foo .myclass} Title {span #baz .someclass}
::: info {section.myclass#foo} Title {span.someclass#baz}
::: info {.myclass#foo} Title {.someclass#baz}
::: info {.myclass #foo} Title {.someclass #baz}
::: info {.myclass #foo section} Title {.someclass #baz span}
::: info {#foo section} Title {#baz span}
::: info {.myclass} Title {#baz}
::: info {#foo} Title {.someclass}
::: info {#foo} Title
::: info {#foo}
::: info {section#foo.myclass}
::: info Title {.someclass}
::: info Title {span#baz.someclass}

v1.1.0

10 Feb 21:41

Choose a tag to compare

Release notes and the changes made by @talatkuyuk

removed inconsistencies in the outputs whether there is an empty line or not

::: info
:::

and

::: info

:::

Now, both produces the output without <p> inside the container,

<div class="remark-container info"></div>

Fixed a bug

if a break node is the first child of a paragraph within the container, the break node is removed.

Fixed a bug for the block-level html elements in markdown files (not related with mdx files)

Block-level html elements was causing a bug if the ::: closing container sign is just after the that element closing tag.

::: info Title
<p>Hi</p>
:::

For the fix, I added another visit function for the html nodes in the AST that if a html node.value ends with "\n:::", remove and carry it into a new paragraph.

Now, we don't need to put an empty line after the block-level html elements like <p> tag in the container, before it was needed an empty line to work with "markdown" documents.

v1.0.7

26 Dec 14:24

Choose a tag to compare

Release notes and the changes made by @talatkuyuk

  • updated the dependencies and fixed the type issues
  • refactored the .npmrc file
  • refactored the package.json and the tsconfig.json
  • updated the README.md having at least node version 16+
  • fixed "Cannot find module" error in ts-jest test environment by adding moduleResolution
  • added a callback function for the title option (breaking change !!!)
    Before, the title option was null | undefined. If you wanted not to add a title node, the option was title: null.
    Now, the title option is a callback function(type?: string, title?: string) => string | null | undefined. If you want not to add a title node, the option is title: () => null. With that callback function, you are able to change the titles according to your logic.
  • added callback function option for the TagName and ClassName options in addition to string option
    It will also provides you to define dynamic tag names and class names.
  • added the test files covering the new options