Releases: ipikuka/remark-flexible-containers
v1.5.2
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
The changes made by @talatkuyuk:
- Update devDependencies
- Update
README.md(some corrections in typing and syntax)
v1.5.0
The changes made by @talatkuyuk:
v1.4.1
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
parseFenceTypeTitlehelper to simplify paragraph node analyzers
v1.4.0
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.mdfor adding info about supporting nested containers
v1.3.0
The changes made by @talatkuyuk:
- Add
unifiedinto peerDependencies - Update dependencies and devDependencies
- Migrate from jest to
vitestv3.2 - Migrate
eslintv8 to v9 and apply flat config - Update
.prettierrc - Add
.editorconfigfile - 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
The changes made by @talatkuyuk
- added a test util, and updated all the tests
- fixed: specific identifiers for the
titleshould break the optiontitle: () => null, and the title should take place
v1.2.0
Release notes and changes made by @talatkuyuk
- updated the dependencies
- added
package-lock.jsonon behalf of npm clean install in the github actions - the options
titlePropertiesandcontainerPropertiesare not allowed to haveclassNamein the returned object - made refinements in the code
- improved the typing system,
@types/mdastis extended with newContainertype - 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.
tagnameis to be compatible HTML tag name, and may present only once,idis to start with hash#, and may present only once,classnamesare 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
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
Release notes and the changes made by @talatkuyuk
- updated the dependencies and fixed the type issues
- refactored the
.npmrcfile - refactored the
package.jsonand thetsconfig.json - updated the
README.mdhaving at least node version 16+ - fixed "Cannot find module" error in
ts-jesttest environment by addingmoduleResolution - added a
callback functionfor thetitleoption (breaking change !!!)
Before, thetitleoption wasnull | undefined. If you wanted not to add atitlenode, the option wastitle: null.
Now, thetitleoption is a callback function(type?: string, title?: string) => string | null | undefined. If you want not to add atitlenode, the option istitle: () => null. With that callback function, you are able to change the titles according to your logic. - added
callback functionoption for the TagName and ClassName options in addition tostringoption
It will also provides you to define dynamic tag names and class names. - added the test files covering the new options