Package: vod-barrins-codex
Barrin's CodexA website about MtG Duel Commander StrategySpecial ThanksI started working withlionel-panhaleuxon a project during first lockdown (around April 2020).
We worked on hisCodex of the Damned(repo) to support internationalisation.
The whole structure of this project is derived from his Codex, hence the name as a small tribute.ContributingContributions are welcome.Pull Requestswill be merged if they respect the general style.Issueswill be dealt with as quickly as possible.This site usesFlaskandBabelto generate pages dynamically and handle internationalisation.Instructions to contributorsHere are various general guidelines this website is enforcing:Do not talk about yourselfDo not talk to the readerDo not engage the reader in the talkUse spaces between the call and the variable for better clarity{{ some_variable }}Use mana symbols, they are emojis in the context (currently{{ W }},{{ U }},{{ B }},{{ R }},{{ G }})Use card names variables, they are in the context (example{{ jace_the_mind_sculptor }}forJace, the Mind Sculptor)If a card name doesn't compile, you are free to declare the name, it is mandatory for Adventure card and some otherInstallationTo install a working developpment version of the site, usepip:python3-mvenvvenvsourcevenv/bin/activate
pipinstall-e".[dev]"The first time the project is started, the page will take some time to compile a list of
cards and theirscryfallIdto gain access to the card image. This script is also used
to build a JSON version of a decklist.Run the CodexYou can run the development version of the site using thecodexentrypoint:$codex
*ServingFlaskapp"barrins_codex"(lazyloading)*Environment:productionWARNING:Thisisadevelopmentserver.Donotuseitinaproductiondeployment.UseaproductionWSGIserverinstead.
*Debugmode:off
*Runningonhttp://127.0.0.1:5000/(PressCTRL+Ctoquit)You can set theDEBUGenvironment variable to activate the debug mode:DEBUG=1codexUseful toolsThere are some utils provided in the codex:Decklist ConverterUsing an alphabetically sorted decklist, just putSB:before every card in Command Zone.cd./barrins_codex
python./build_deck.pyPATH_TO_FILEGoogle TranslateUse python and Google Translate to help with translation:importclipboardimportpprintimportredefpre():s="".join(s[1:-1]forsinclipboard.paste().split("\n"))s=re.sub(r"%\(([^\)]*)\)s",r"§KEEP\1§",s)clipboard.copy(s)defpost():s=clipboard.paste()s=pprint.pformat(re.sub(r"§KEEP([^§]*)§",r"%(\1)s",s),width=88)s=re.sub(r"(^')|('$)",'"',re.sub(r"^\s*","",s[1:-1],flags=re.MULTILINE),flags=re.MULTILINE).replace("\\n","")clipboard.copy(s)# usage:#  > copy paragraph to translate from the PO file# pre()# > copy translation# post()# > copy result to the PO fileVersioningThe version number take the form X.Y.Z where X, Y, and Z are non-negative integers, and do not
contain leading zeroes. X is the major version, Y is the minor version, and Z is the patch version.
Each element MUST increase numerically. For instance:1.9.0->1.10.0->1.11.0.Given a version number MAJOR.MINOR.PATCH, I increment the:MAJOR version when I make a backend evolution or a design evolution,MINOR version when I add content, andPATCH version when I make bug and typo fixes.Additional labels for pre-release and build metadata are available as extensions to the
MAJOR.MINOR.PATCH format.