-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
copy sanitized_anchor_name to blackfriday #350
Comments
Previous discussion is at #139. The reason it's in a separate repo is described in #139 (comment). But we can reconsider this issue. I'm going to think about it. |
@adg Can you elaborate on the motivation to do this? I can certainly guess, but it'd be helpful if you made it explicit. What problem are we trying to resolve, exactly? |
Sorry that I missed #139. Dependencies have costs. They introduce fragility and complexity. When adding a dependency on another repository, we must weigh up whether that cost is justified. I don't believe it is, in this case. (Ultimately the choice is subjective, though.) Take a look at the https://github.com/upspin/upspin repository, for example. I just completed a bunch of work to move our cloud-related dependencies out of the core repo. The remaining external dependencies are:
Looking at each repo, you can see why the dependency is justified. Each of I suggest that |
I support copying the function. I think that one of blackfriday's virtues has been that it is very boring, and having zero dependencies outside the standard library helps to keep it boring. It gives users one less thing to worry about. |
@adg Thanks, that's helpful.
So, if we can avoid having the
I agree. If we can find a good way to make it no longer be a separate repository, that would be improvement (although it has a cost of making the change, but likely worth it).
I'd really like to avoid making a copy of the function, because that would go against its purpose. The point of However, we can move the package into the By moving the package, I mean we'd create a copy inside Users of
|
Here's my counterproposal:
Rationale:
|
One tweak to the above: for users like |
I was just thinking that the reason for all this difficulty in finding a solution without compromises is that there's no specification, and as a result, the implementation is the only specification itself. If there was a specification for this, then it's as you say, the current
Somewhat related to this, when GitHub announced they're releasing a formal specification for GitHub Flavored Markdown, I was really hoping that would include a specification for escaping heading anchor names that GFM uses. That would help resolve issues such as avelino/awesome-go#1224 (comment), and we could just use that same spec instead of creating our own. But, I didn't find it, and I tried asking without luck.
Can you clarify what you mean by that? Export what function, and where? |
Independent of the future plans for |
I'll just say this, I don't like that option because it creates the burden of maintaining and keeping However, I think I'm okay with it, because it probably benefits more people than it inconveniences. Also, there are two things make the burden quite small. First, the algorithm hasn't changed in the last 3 years, and I don't expect it'll change too often in the future. Second, I'm helping maintain this repository (although less actively lately; @rtfb is doing most of the work these days, especially on the v2 front) and I expect it'll be relatively easy for me to be made aware of any changes that I'd need to update /cc @rtfb Do you have thoughts on this issue? |
The goal of this change is to reduce number of non-standard library packages (repositories) that blackfriday imports from 1 to 0, and in turn, reduce the cost of importing blackfriday into other projects. Do so by documenting the algorithm of SanitizedAnchorName, and include a copy of the small function inside blackfriday itself. The same functionality continues to be available in the original location, github.com/shurcooL/sanitized_anchor_name.Create. It can be used by existing users and those that look for a small package, and don't need all of blackfriday functionality. Existing users of blackfriday can use the new SanitizedAnchorName function directly and avoid an extra package import. Resolves #350.
I took a stab at resolving this issue in PR #352. It's just a first draft, I welcome feedback and suggestions. @adg, can you take a look and see what you think? One part I was hesitating about was whether to make |
The goal of this change is to reduce number of non-standard library packages (repositories) that blackfriday imports from 1 to 0, and in turn, reduce the cost of importing blackfriday into other projects. Do so by documenting the algorithm of SanitizedAnchorName, and include a copy of the small function inside blackfriday itself. The same functionality continues to be available in the original location, github.com/shurcooL/sanitized_anchor_name.Create. It can be used by existing users and those that look for a small package, and don't need all of blackfriday functionality. Existing users of blackfriday can use the new SanitizedAnchorName function directly and avoid an extra package import. Resolves #350.
The goal of this change is to reduce number of non-standard library packages (repositories) that blackfriday imports (not counting imports used only for tests) from 1 to 0, and in turn, reduce the cost of importing blackfriday into other projects. Do so by documenting the algorithm of SanitizedAnchorName, and include a copy of the small function inside blackfriday itself. The same functionality continues to be available in the original location, github.com/shurcooL/sanitized_anchor_name.Create. It can be used by existing users and those that look for a small package, and don't need all of blackfriday functionality. Existing users of blackfriday can use the new SanitizedAnchorName function directly and avoid an extra package import. This change is a port of PR #352 from v1 into v2. Updates #348. Updates #350.
The goal of this change is to reduce number of non-standard library packages (repositories) that blackfriday imports (not counting imports used only for tests) from 1 to 0, and in turn, reduce the cost of importing blackfriday into other projects. Do so by documenting the algorithm of SanitizedAnchorName, and include a copy of the small function inside blackfriday itself. The same functionality continues to be available in the original location, github.com/shurcooL/sanitized_anchor_name.Create. It can be used by existing users and those that look for a small package, and don't need all of blackfriday functionality. Existing users of blackfriday can use the new SanitizedAnchorName function directly and avoid an extra package import. This change is a port of PR #352 from v1 into v2. Updates #348. Updates #350.
…s#352) The goal of this change is to reduce number of non-standard library packages (repositories) that blackfriday imports from 1 to 0, and in turn, reduce the cost of importing blackfriday into other projects. Do so by documenting the algorithm of SanitizedAnchorName, and include a copy of the small function inside blackfriday itself. The same functionality continues to be available in the original location, github.com/shurcooL/sanitized_anchor_name.Create. It can be used by existing users and those that look for a small package, and don't need all of blackfriday functionality. Existing users of blackfriday can use the new SanitizedAnchorName function directly and avoid an extra package import. Resolves russross#350.
The
blackfriday
package only has one external dependency:github.com/shurcooL/sanitized_anchor_name
That repo provides a single ~20-line function. Can we copy it into this repository to remove the external dependency?
cc @shurcooL
The text was updated successfully, but these errors were encountered: