Comments (13)
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.
This is coming off of a short discussion here: #119
from 5e-database.
For id, I'd just use the name and normalize it with regexes, like this:
- Use the language's "to lowercase" function.
- Delete unwanted characters such as initial and final whitespaces, as well as apostrophes inside words:
(?:(?<=\bo)'|'(?=s\b)|^\W+|\W+$)
- 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.
I think that's a reasonable ID pattern.
from 5e-database.
So that would convert Arcanist's Magic Aura
into arcanists-magic-aura
. Yeah. I definitely like that.
from 5e-database.
I just hope that doesn't break anything for anyone.
from 5e-database.
If we're going to do this, we may as well drop the domain from the URL as well.
from 5e-database.
Actually, that would be a pretty good use for a repository tag. Since essentially that would be a major version change.
from 5e-database.
@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.
I added a PR to address #113 which drops the domain from the URLs.
from 5e-database.
I also started throwing together a script to do the ID conversion.
from 5e-database.
Well. That might do it but I probably messed something up.
from 5e-database.
Okay. I think this PR is in a good state for adding string ids.
from 5e-database.
Related Issues (20)
- Restructuring Rules.json HOT 13
- Inconsistent Shapechanger handling HOT 4
- Innate spellcasting missing required components HOT 1
- Monster variants in data that are not SRD content HOT 1
- GitHub deploy action trying to run in a fork HOT 6
- 1.2.6 tag missing in main branch HOT 2
- Missing monster flavor text HOT 1
- Frontend Webpage down on Heroku
- Docker build gives Illegal Instruction (Core Dump) with Latest and v2.1.1 tag HOT 3
- Issues with "range" on melee weapons HOT 20
- Additional Response Headers HOT 3
- Giant Centipede XP value is incorrect
- Bone Devil monster has wrong challenge rating? HOT 1
- Acolyte has no starting gold
- Add number of spells cast field HOT 2
- Proficiency Bonus is missing in the Monster api HOT 1
- Minor errors found in spell data HOT 1
- Spells with multiple damage types aren't represented HOT 1
- MongoDB 5 Requires AVX Instruction Set to Boot HOT 1
- Magic missile spell: Damage at slot level are incorrects
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 5e-database.