question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose slugger function

See original GitHub issue

Thanks for this project. In a project of mine, I need the slug function, but the iteration gets in the way. I want to expose the slugger function as a “static” method of the GithubSLugger object. This change would let us use the slugger directly, in this way:

import GithubSlugger from 'GitHub-slugger'

GithubSlugger.slugger('my text to slug')

What do you think?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bobylitocommented, Feb 18, 2020

Fair point!

I don’t have the data about the typology of users here. I’m gonna make a hypothesis here: I think the users of this library are pretty low-level, and they expect the flexibility trade-off that leans towards a more complex API. I’m thinking tools creators that integrate this library in other library or plugins.

However, if you don’t think it’s the case, then it could be a hidden API that is there but not documented in the readme.

1reaction
wooormcommented, Feb 18, 2020

Alright, I’m up for this, PR would be welcome! slugger as a name?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add documentation for Slugger · Issue #1484 · markedjs/marked
An alternative would be to expose the slug function via the marked module.
Read more >
github-slugger - UNPKG
* Expose static slug function for folks who do not want/need the stateful bits (Thanks [@bobbylito](https://github.com/bobylito)!).
Read more >
Slugger JM101
Keep all safety features functioning and working properly. 5. Never wear loose clothing, gloves or jewelry when working near cutting area or rotating...
Read more >
Did Marcos Maidana Expose an Aging Floyd Mayweather?
Trainer Robert Garcia has transformed Maidana from a simple slugger to an awkward-but-skilled attacker. Maidana has a sharp jab, and he doesn't ...
Read more >
PHP function to make slug (URL string) - Stack Overflow
I want to have a function to create slugs from Unicode strings, e.g. gen_slug('Andrés Cortez') should return andres-cortez . How should I do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found