CatMice Query Dialect
-
Query Dialect QuickInfo
$
DOLLAR - is chain reaction (all files within `chain.name`).%
PERCENT - is for pot (all or few within `pot.name`)`
BACKTICK - is for trademarks~
TILDA - is file/request delimiter|
BAR - will become directory separator found within..
DOT - is for files in $dirlevel1 (catmice) - when default - no punctuation found at beginning, it means files in $dirlevel2 (catmice/script
orcatmice/style
). - when~~
DOUBLE TILDA found at beginning, it means Template Call. - one never puts extension at the end.
-
Query Dialect Verbose
Before reading this section further, it is advisable to at least take a look at the test/run section, so that things below could make some sense. -- - You may want to open
element inspector
of Your choice and take a look at generated source code within<head>
tag on the inspector tab for this very page. - Look for<link>
tags with id attribute and<script>
tags with async|defer attribute. Those have their href/src expressed inCatmice Query Dialect
fashion. After?cat=
.. or?mice=
.. there's usually one special punctuation character before the rest of the query string .. and if no punctuation character is found, but simple extensionless basename of the file, (eg:/mc/?mice=highlight
) file lookup is performed directly withinscript
orstyle
directory, meaning/cm/script/highlight.js
.'$' for "chain reaction"
¯¯¯$
is replacement forchain.
something within/cm/script
(or style), and it is calledchain
because it is meant to collect ALL files found within, via single request and it is literally - ALL - or none. It does not matter how many files are sitting inside the directory. What matters is that You have proper extension for each file and that You have clearly distinguished which one will be sorted first by prefixing Your files with (most logical) numbers, followed by the descriptive name. Example: query >/cm/?cat=$myTheme
.. and/cm/style/chain.myTheme
contents something like this ... .. 0-0-fonts.css 0-1-theme.css 1-0-navigation.css 200-0-effects.css 1000-0-print.css ...
... and all files will be packed into one fat string. 100 files ? 100 files will be collected and concatenated one after another. Those that should go first, should have lower numbers. This function > natsort < is responsible for the ordered picking.'%' for "pile, stash or pot"
¯¯¯ It is a replacement forpot.
something within/cm/script
(or style).%
or percent has almost the same purpose aschain
does, with the exception of picking just one instead of collecting all files found within. Meaning, You can get entire collection of files in one shot, or simply just pick one (or two, using~
) from thepot
. Example picking one file: query >/cm/?mice=%jsthing.fly
will pick >/cm/script/pot.jsthing/fly.js
Example picking one file in apot
subdirectory namedsub
: query >/cm/?mice=%jsthing.sub|fly
will pick >/cm/script/pot.jsthing/sub/fly.js
And if we need ALL files from particularjsthings
pot
, pretty much like with$chain
.. .. the following query >/cm/?mice=%jsthings
< will do that.'`' for "trademark"
¯¯¯ Backtick character is a replacement fortrademark
directory within sciprt or style directories. Its purpose is to clearly distinguish other well known free or paid libraries from Your own. Here is an example of pullingace.js
fromtrademark
sub-directory: .. this >/cm/?mice=`ace|ace
.. will pick this >/cm/script/™/ace/ace.js
'~' as "request concatenator"
¯¯¯Tilda
orTilde
character purpose is to concatenate several folders (with a lots of files in each of them) into a single request or collection. Let's imagine that we have/style/chain.myTheme
folder with 10.css
files inside, and one more/style/chain.someOtherGroup
with 10 or more.css
files inside. So instead of writing 20+<link>
tags in Your document head, this will do:/cm/?cat=$myTheme~$someOtherGroup
Logically, one would want to employ_GET['sq']
.. even_GET['ex']
alongsidesq
perhaps ? .. so that outcome becomes ONE BIG FAT and exceptionally ugly pile of working css rules .. cached, offcourse. Something like this:/cm/?cat=$myTheme~$someOtherGroup&sq=1&ex=1&hrs=654321
That one single request will pull, lets say 20+ css files and concat them and before that will remove all block comments, will turn all continuous white-space characters into a single white-space character, willbase64_encode
all image and font paths found withinurl(..)
and will cache that request for 654321 hours.'|' as "directory separator"
¯¯¯ Horizontal bar found withincat
ormice
request will be transformed into/
character. Let's imagine that there is sub-sub-sub directory insidescript
directory and some important.js
file inside. This is how it would look like:/cm/?mice=my|dir|within|dir|jsfile
Or withintrademark
:/cm/?mice=`brokoli|pepper|tuna|shphagetti|jsfile
Note that You can use original separator/
instead of horizontal bar|
. The thing is .. request looks prettier with|
within query value. :)'.' for "root files"
¯¯¯ In many use case scenarios, one might need particular.css
or.js
file right from within catmice root directory. As mentioend already here and there the
directory it self, right beside main/cm
CatMice
(index.php) file. So, in order to fetch some, lets say.js
file from the root catmice directory, this should do:/cm/?mice=.highslide
-> /cm/highslide.js .. as for few of them:/cm/?mice=.jquery~.highslide
;