Skip to content

Releases: ipikuka/remark-flexible-containers

v1.2.1

13 Mar 20:44
Compare
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
Compare
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
Compare
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
Compare
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

v1.0.6

16 Jun 01:17
Compare
Choose a tag to compare

Relesae Notes:

  • removed the "unist-util-find-all-between" package (it causes "Error [ERR_REQUIRE_ESM]: require() of ES Module not supported" )
  • added the "unist-util-find-between-all" package instead
  • added src directory into files in package.json for source map support
  • added the list of the remark packages I have published into README.md

v1.0.5

31 Mar 18:22
Compare
Choose a tag to compare
  • dummy commit for the fix that the README.md does not show in npm site

v1.0.4

30 Mar 22:33
Compare
Choose a tag to compare

Changes made by @talatkuyuk

  • updated README.md
  • fixed an import issue in a test file
  • updated some dependencies

v1.0.3

26 Feb 19:13
Compare
Choose a tag to compare

Thanks to @remcohaszing for the advices; changes made by @talatkuyuk

  • updated eslint config file
  • made minor refinement for constructing title and container
  • corrected the config settings ensuring the package is for ESM only

v1.0.2

14 Feb 12:38
Compare
Choose a tag to compare
  • adopted the tsconfig for ESM only as well.

v1.0.1

14 Feb 12:04
Compare
Choose a tag to compare
  • removed the unist-util-find dependency which is not used in the project

Implemented the useful hints/tips given in the process of the package be included the remark-plugins list here (thanks to @remcohaszing)

  • use the prepack script over the prepare in package.json because the prepare runs every installation in local but prepack not
  • set the extension of the file .eslintrc.json because of without an extension is deprecated
  • change the script prettier for all files and add .prettierignore in order to provide a way the CLI and your editor use the same settings
  • change the script lint for all files like prettier; and add overrides into the eslint config to make ESLint understand extensions
  • make the package is for ESM only since the package has ESM-only dependencies which means it doesn’t work with CJS