Coder Social home page Coder Social logo

Comments (13)

ogregoire avatar ogregoire commented on July 2, 2024 2

I just hope that doesn't break anything for anyone.

That will definitely break something for someone. But keeping changing the ids because we remove or add stuff will also definitely break something for someone.

The change will break everything for everyone, but after that nothing will break for no one.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

This is coming off of a short discussion here: #119

from 5e-database.

ogregoire avatar ogregoire commented on July 2, 2024

For id, I'd just use the name and normalize it with regexes, like this:

  1. Use the language's "to lowercase" function.
  2. Delete unwanted characters such as initial and final whitespaces, as well as apostrophes inside words: (?:(?<=\bo)'|'(?=s\b)|^\W+|\W+$)
  3. Replace sequences of non letters with a single dash: \W+ to -.

This has the advantage to be deterministic and usually unique because, in the SRD, names are unique.

I think regexes are a good fit because they can be used in any language so no matter the scripting language, it will just work. Also, those regex can be simplified or aggregated, but I haven't found a single regex to do all that at once.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

I think that's a reasonable ID pattern.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

So that would convert Arcanist's Magic Aura into arcanists-magic-aura. Yeah. I definitely like that.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

I just hope that doesn't break anything for anyone.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

If we're going to do this, we may as well drop the domain from the URL as well.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

Actually, that would be a pretty good use for a repository tag. Since essentially that would be a major version change.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

@ogregoire If you want to pull the trigger on this, feel free to. I think I'm about to have my hands full.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

I added a PR to address #113 which drops the domain from the URLs.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

I also started throwing together a script to do the ID conversion.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

Well. That might do it but I probably messed something up.

from 5e-database.

bagelbits avatar bagelbits commented on July 2, 2024

Okay. I think this PR is in a good state for adding string ids.

from 5e-database.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.