Skip to main content

Convert string to GitLab Flavored Markdown Header ID [1]

Quickstart

String to Markdown Id is available on PyPI and can be installed with pip.

$ pip install string_to_markdown_id

After installing String to Markdown Id you can use it like any other Python module.

Here is a simple example:

from string_to_markdown_id import convertToMarkdownId

testQueries = [
    r"""(This) --- --v - " "" ' ' has 2.5, 😀, 한글, :thumbsup:,       , \n, \r, \t, \f, \u, \a, \x, \\t""",
    "this-------v-------has-25--한글-thumbsup--n-r-t-f-u-a-x-t",
]
expected = [
    "this-v-has-25-한글-thumbsup-n-r-t-f-u-a-x-t",
    "this-v-has-25-한글-thumbsup-n-r-t-f-u-a-x-t-1",
]
expectedHyphenIgnore = [
    "this-------v-------has-25--한글-thumbsup--n-r-t-f-u-a-x-t",
    "this-------v-------has-25--한글-thumbsup--n-r-t-f-u-a-x-t-1",
]
print(f"\nGiven queries:\n{testQueries}\n")

gens = convertToMarkdownId(testQueries)
print(f"Generated IDs:\n{gens}\n")

print(f"Expected IDs:\n{expected}\n")

gens = convertToMarkdownId(testQueries, ignore_multi_hyphens=True)
print(f"Generated IDs (Hyphen Ignored):\n{gens}\n")

print(f"Expected IDs (Hyphen Ignored):\n{expectedHyphenIgnore}\n")

The API Reference provides API-level documentation.

Change Log

Version History

0.0.1
  • Project created.

Release files for string-to-markdown-id 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for string-to-markdown-id 0.0.1
File Interpreter ABI Platform
string_to_markdown_id-0.0.1-py3-none-any.whl Python 3 none any Details

Release files / string_to_markdown_id-0.0.1-py3-none-any.whl

Download URL string_to_markdown_id-0.0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a54fece1f57c123f6b5cb0bc83368e54f20c1bf5cf811f224d2703340a1b14f7
BLAKE2b-256 checksum
How to use checksums
a121bae3cc4f5ec8231cadbce4ff086bc18afd61ea8bd043db8f20819185fea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page