Skip to main content

Convert string to GitLab Flavored Markdown Header ID

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

string_to_markdown_id-0.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file string_to_markdown_id-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for string_to_markdown_id-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a54fece1f57c123f6b5cb0bc83368e54f20c1bf5cf811f224d2703340a1b14f7
MD5 0ebc47470580d55d3374a12e93c2d6c5
BLAKE2b-256 a121bae3cc4f5ec8231cadbce4ff086bc18afd61ea8bd043db8f20819185fea6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page