Comments (22)
Categorization needs to have rules. For example, today I tagged a snippet that converts an array into a list of <li>
elements and appends them to a list. That could be both an array
snippet and a browser
snippet. But, seeing as browser
is more specific, I tagged as a browser
snippet. I think we should check existing snippets and retag based on some ruleset and specificity, then update the guidelines to make sure there's a consistent set of rules for tagging.
from 30-seconds-of-code.
JSON to date
should be added toDate
category since it's working with dates and returning a date in the format of a string.Random integer in range
andRandom number in range
could go toMath
category since they're both using Math built-in object and they also return a number.
from 30-seconds-of-code.
I think we should keep utility, but better categorize most of its snippets elsewhere. Utility should be anything that cannot be categorized anywhere else in my opinion.
from 30-seconds-of-code.
Maybe, create tags (instead of non-intersecting categories) so a function could be found by different keywords?
from 30-seconds-of-code.
I like the idea of categories and tags working at the same time. It's a very neat way to organize everything. I'll see if I can modify the tagger script or someone else could do it.
from 30-seconds-of-code.
Mostly, at least I think so, we categorized them by our inner feeling on where they should go. For me, that whole input/output thing is nonsense. For example we have: isDivisible
which takes an number but returns boolean. Category of this function is Math
, on the other hand, in the same category we have arraySum
which takes array but returns number ...
I would put that function in both 😆 (idea of multiple tags is amazing)
from 30-seconds-of-code.
The great multitagging update
As it currently stands, we need multitagging implemented as soon as possible. I'm assigning this to myself (feel free to pm me/comment here if you want to help or have a good idea). The outline is as follows:
functionX: string, utility, advanced
- Keep
tag_database
and add multiple values for each snippet, instead of having just one. - Retroactive update of tags so that all snippets have proper tagging applied.
- Update to the
tagger
,webber
,builder
scripts to handle these changes:- The
tagger
will keep multiple tags for each snippet, although categorize each snippet under its first tag (in the example abovefunctionX
would be listed understring
). - The
webber
will add a special attribute to all snippet links with their added tags, so that it is easier to browse them when searching (so thatfunctionX
could be found usingstring
orutility
oradvanced
). - The
builder
will keep categorization as-is, with the exception of theadvanced
tag, which will add an icon or a little badge next to the snippet name in the README. This will help developers identify snippets that might require more time to understand. - The
webber
will also add a simple textual tag next to the name of snippets that areadvanced
, similar to thebuilder
.
- The
- Add new secondary cetegories with more specific contexts inside top-level categories (e.g. we can have some specific subset in
math
forfibonacci
which we have a few snippets for (not the best example, but I hope you get the idea)).
I will start working on these changes, which should not be too hard to implement and push within the next few days. If anyone disagrees or has a proposal to improve this suggestion, now would be the time.
from 30-seconds-of-code.
Sounds simple enough. If you have any problems with the search implementation on the web let us know
from 30-seconds-of-code.
I am not very objective, as I did the categorization myself yesterday. Suggest away guys!
from 30-seconds-of-code.
I think there should also be a hybrid category like array and object where both are used. Same way for strings and arrays. Also there is utility category, but there are more snippets that also fall into that category and maybe whole repo is kind of utility. So can we break remove utility category and its category should be transferred into other respective category?
from 30-seconds-of-code.
@fejes713 Your suggestions make a lot more sense than what I have done with these snippets, I'm moving them right away.
from 30-seconds-of-code.
@Chalarangelo This sounds like a good idea, what do you think about it? Could be useful in future?
I think we should keep the categories and add tags. They could definitely bring a lot to project since we're having more and more snippets every day.
from 30-seconds-of-code.
... Wait categories weren't tags? Guess I misunderstood it earlier then. Lesson to be learned:
Don't glance, read
from 30-seconds-of-code.
@skatcat31 Well, what we have right now is a reasonably simplistic categorization system I set up in like an hour, but in theory it should allow for multiple tags with a little bit of modification.
from 30-seconds-of-code.
@Chalarangelo Yes though categorisation is there, but multiple tags idea is better to suggest particular snippets also belong to that respective area !!
from 30-seconds-of-code.
The question is then what are the rules for tagging? What it takes? What it gives? Does that mean
const spread = (f, a) => f(...a)
is under function, utility, or array?
from 30-seconds-of-code.
Was that snippet ever marked as mutating?
from 30-seconds-of-code.
The tagger has been updated to now mark all new snippets as uncategorized
, so you can help out by tagging existing snippets in the database that are listed as uncategorized
and sending a PR. Travis runs the tagger automatically during each build, so the database should always be up to date with the latest commit.
@skatcat31 no and it probably should be added as a note to make sure people know what they are dealing with.
from 30-seconds-of-code.
@Chalarangelo I will try doing that now!
from 30-seconds-of-code.
Right now multitagging is priority number 3 on our list, right after the restructure of #233 and adding tests as discussed in #78. Multitagging will most likely only work on the website, but we might be able to make it usable in the README as well.
from 30-seconds-of-code.
from 30-seconds-of-code.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.
from 30-seconds-of-code.
Related Issues (20)
- Merge two arrays and remove duplicate elements HOT 2
- CSVToArray will return an empty item for documents ending with \n HOT 2
- addDaysToDate fails with non-UTC timezone HOT 1
- A snippet folder dedicated to Angular
- Js
- Broken links HOT 4
- New snippet ideas HOT 1
- passive-scroll-listener-performance has obsolete/incorrect advice HOT 2
- Regarding the throttle function's question. HOT 7
- style: Centering the footer section ⏡ HOT 2
- Website Navigation Bar
- cookie parsing containing a `=` in value HOT 5
- [ BUG ] Missing space in footer section HOT 12
- Typo in the event-loop-explained.md snippet HOT 2
- fix: Unnecessary parameter in Queue class methods HOT 2
- Terminology issue in blog HOT 4
- :bug: Fix Footer settingsPath (GithHub,CC ,30-sec-of-code Link)
- Kindly add hacktoberfest label to your repo. HOT 1
- [Feature Request] : The border of search bar is not clearly visible .
- Typo on the website
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 30-seconds-of-code.