Skip to content

Commit

Permalink
reworked docs example section and content updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dsoskey committed Jan 7, 2025
1 parent bbb8cf2 commit ada7d15
Show file tree
Hide file tree
Showing 21 changed files with 272 additions and 201 deletions.
119 changes: 119 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
### Generic planeswalker reanimation

The base query uses a regular expression (aka regex) to find several kinds of reanimation
effects with a single oracle text search. `.*`, regex-speak for finding any number of any kind of character,
matches any type or quantity of reanimation target. The subqueries filter out
most reanimation spells whose text doesn't mention planeswalkers or
permanents. This query is easier to assemble than one that accounts for
all reanimation variants in the regex, and it still filters out ~80% of
the cards of the base query (385 --> 47 pre-ONE)

```scryfall-extended-multi
o:/return .* from (your|a) graveyard to the battlefield/
o:planeswalker
o:permanent
```

### Blending morph & blink

this query shows how comments work. as written, this ignores the morph
subquery. remove the `#` from the first query to include them at the front of the search.
the two blink queries are separated to rank immediate blinks from end of turn blinks.

```scryfall-extended-multi
ci:wurg
# o:morph or o:manifest
o:/exile .* creature .*, then return (it|that card) to the battlefield/
o:/exile .* creature. return (it|that card) to the battlefield/
o:/when ~ enters the battlefield/
```

### Savai sacrifice

```scryfall-extended-multi
-is:extra ci:savai o:/sacrifice an? *./
# good sacrifice payoffs
o:/draw .* cards?/
o:/deals? .* damage/
o:/loses? .* life/
o:/gains? .* life/
o:scry or kw:"surveil"
t:creature
-t:planeswalker -t:creature
# subquery 8 is a fallback query
*
# A fallback query is any query that overlaps with the base query.
# Use a fallback query to include the entire base domain in the search results.
# *, the identity filter that matches all cards, is the most concise way to do thi
```

### Ketria spellslinger

```scryfall-extended-multi
c<=urg o:/(?<!(only as an? ))(instant|sorcery)/ -o:flash
t:instant
t:creature
t:enchantment
t:artifact
t:sorcery
c>=ur
c>=rg
c>=gu
```

### Non-red poison-matters in an artifact-matters environment

This query uses a full oracle text search (`fo:`), which includes reminder
text. This ensures toxic, proliferate, and infect are included in the
base query.

```scryfall-extended-multi
fo:counter ci:bwug
o:toxic
o:proliferate
o:infect
t:artifact
*
```

### Skill checks

This search identifies card printings that may read poorly to new cube drafters due to text unexpected gameplay or text errata.

```scryfall-extended-multi
# Uncomment this to search sub-queries one at a time
#@dm:solo
# Replace soskgy with your cube id
cube=soskgy
kw:protection
o:/\bregenerate\b/
atag:textless
# ~~~ text updates in order of mattering ~~~
# planeswalker redirection rule
date<dom (o:"target opponent or planeswalker" or o:"target player or planeswalker." or o:"damage to any target")
# dies
o:/\bdies\b/ date<isd
# exile
fo:/\bexile\b/ date<m10
# etb
fo:/\benters\b/ date<blb
# surveil, has a few false positives
kw:surveil date<unf -set:mh2 -set:grn -is:reprint
# creating tokens
o:create o:token date<kld
# type changes
t:kindred date<mh3
t:planeswalker date<xln
t:wall date<9ed order:released
!tarmogoyf set:fut
# damage no longer uses the stack
((t:creature fo:"sacrifice ~:") or fo:/sacrifice .* creatures?:/) date<m10
# bury
date>=3ed date<tmp (o:/destroy .* be regenerated/ or (o:/sacrifices? / -o:/sacrifice.*:/ -o:"as an additional cost") or "Lake of the Dead")
o:/\bindestructible\b/ date<ths
o:"can't be blocked." date<ths
o:"If you don't, put it into its owner's graveyard."
```

4 changes: 2 additions & 2 deletions docs/gettingStarted/savedCards.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Saved and ignored cards

Cogwork Librarian stores one saved card list and one ignored card list.
Each project in Cogwork Librarian has one saved card list and one ignored card list.
View your saved cards in the search page by clicking "show saved cards".
When you're ready to use your brainstorming list for the next step of your design cycle,
click "copy to clipboard" to copy the saved cards.
Ignored cards are filtered out of all search results.
Ignored cards are filtered out of search results.
22 changes: 11 additions & 11 deletions docs/regex.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
### Regular expressions

Most filters that operate on text can use a regular expression (aka RegEx) instead of a string.
Most filters that operate on text can use a regular expression (aka regex) instead of a string.
This enables you to match complex text patterns within card fields, like
Cogwork Librarian uses Javascript's flavor of RegEx and supports Scryfall's custom [extension symbols](https://scryfall.com/docs/regular-expressions#scryfall-extensions).
Cogwork Librarian uses Javascript's flavor of regex and supports Scryfall's custom [extension symbols](https://scryfall.com/docs/regular-expressions#scryfall-extensions).

| Symbol | What it means |
|--------|-------------------------------------------------|
| \spt | matches X/X power/toughness |
| \spp | matches +X/+X power/toughness |
| \smm | matches -X/-X power/toughness |
| \smr | matches repeated mana symbols |
| \smh | matches any hybrid mana symbol |
| \smp | matches any phyrexian mana symbol |
| \sm | matches any mana symbol |
| \sc | matches any colored mana symbol |
| \ss | matches any card symbol (mana, tap, untap, etc) |
| `\spt` | matches X/X power/toughness |
| `\spp` | matches +X/+X power/toughness |
| `\smm` | matches -X/-X power/toughness |
| `\smr` | matches repeated mana symbols |
| `\smh` | matches any hybrid mana symbol |
| `\smp` | matches any phyrexian mana symbol |
| `\sm` | matches any mana symbol |
| `\sc` | matches any colored mana symbol |
| `\ss` | matches any card symbol (mana, tap, untap, etc) |

For the ultimate source of truth, see the symbol expansions [here]()
2 changes: 1 addition & 1 deletion docs/syntaxExtensions/alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Define aliases in their own paragraph in the format `@alias:NAME(QUERY)`
Press ▶️ next to the alias definition to run it as its own query

```scryfall-extended-multi
@alias:innistrad(s:vow or s:mid or s:ema or s:soi or s:avr or s:dka or s:isd unique:cards)
@alias:innistrad(s:vow,mid,ema,soi,avr,dka,isd unique:cards)
@alias:importantTypes(t:zombie or t:spirit or t:human or t:vampire or t:werewolf)
Expand Down
2 changes: 1 addition & 1 deletion docs/syntaxReference/is/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See the tables below for the full list of supported and documented `is` filters.
| back | cards with non-default back |||
| battleland | bfz typed dual lands. see `tangoland` |||
| bear | cards that are 2 mana 2/2s |||
| belzenlok | not implemented |||
| belzenlok | story characters Demonlord Belzenlok claimed to be |||
| bicycleland | akh cycling dual lands. see `bikeland` |||
| bikeland | akh cycling dual lands. see `cycleland` |||
| bondland | multiplayer untapped dual lands from battlebond |||
Expand Down
36 changes: 36 additions & 0 deletions docs/syntaxReference/sort/random-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
### Generating random cubes

Cogwork Librarian makes it simple to generate random cubes from a single query set.
Combine [order:random]() and [limit]() to generate the amount of each searchable effect.
Include `order:random` in your base query along with the card pool you want to pick from.
Each subquery represents the different kinds of cards you want in the cube; use `limit:N`
to set how many cards to randomly pick for a given subquery. To ensure you generate exactly the total number of
cards you want in the cube, no subquery should overlap with any other subquery. In this example, the last subquery
includes `-t:land` to not overlap with the first subquery.

```scryfall-extended-multi
# include the standard library of aliases
@include:stdlib
# define your card pool
@alias:cardPool(f:pioneer fo<=25 @u:bar)
# exclude any mechanics you don't want in the environment
@alias:banlist(-keyword:hexproof -is:extra -border:silver)
# why tweak 5 knobs when you could tweak one?
@alias:monoColorLimit(limit:50)
# run this query to generate your cube
order:random @use:cardPool @use:banlist
# each subquery uses a limit filter to select that many cards
type:land produces=2 -produces:c limit:60
# each mono-color section uses the same limit as defined in monoColorLimit
color=w @u:monoColorLimit
c=u @u:monoColorLimit
c=b @u:monoColorLimit
c=r @u:monoColorLimit
c=g @u:monoColorLimit
c=2 lim:30
c:c -t:land lim:20
```
27 changes: 27 additions & 0 deletions docs/syntaxReference/sort/text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### order & direction

Control the order of your results using `order:ORDER_VALUE` and `dir:DIRECTION`. `ascending` (`asc` for short) and `descending` (`desc`) are valid direction values.
By default, cogwork librarian sorts by mana value (`order:cmc`) and uses its default direction, ascending.
If your query contains multiple order or direction clauses, only the first will be applied. This is opposite behavior of Scryfall, which uses the last clause.

#### order values

| Sort value | Default direction | Description | Coglib support | Scryfall support |
|------------------------|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|------------------|
| `artist` | Ascending (0-9a-z) | artist's full name in lexigraphical order, case insensitive |||
| `cmc`, `mv` | Ascending | mana value |||
| `color` | Ascending | color in wubrgmc order. see [source code](https://github.com/dsoskey/mtgql-js/blob/main/src/filters/sort.ts#L30) for canonical multicolored ordering. |||
| `edhrec` | Descending | edhrec rating |||
| `usd`, `eur`, `tix` | Descending | price in specified currency |||
| `name` | Ascending (0-9a-z) | card name |||
| `penny` | Ascending | [Penny Dreadful](http://pdmtgo.com/) ranking |||
| `power` , `toughness` | Ascending | Combat stats. Cards without combat stats go before cards with 0 power/toughness |||
| `rarity` | Ascending | Order: common, uncommon, rare, special, mythic, bonus |||
| `released` | Ascending | Release date |||
| `review` | Ascending | By color, then by cmc |||
| `set` | Ascending | sorts by set code, then collector number |||
| `spoiled` | Ascending | spoiled date |||
| `wc` | Ascending | word count without reminder text |||
| `fwc` | Ascending | full word count (including reminder text) |||
| `random` | N/A | result is sorted in a random order. This is useful for [generating random cubes](/user-guide/advanced-techniques#generating-random-cubes) |||

Loading

0 comments on commit ada7d15

Please sign in to comment.