[CWB] Skins for cqpweb
Hardie, Andrew
a.hardie at lancaster.ac.uk
Fri Apr 29 04:43:41 CEST 2022
Hi Graham, and everybody,
The CorCenCC interface isn't based on CQPweb or CWB at all; instead it uses a relational database system which encompasses their data collection records as well as accessing the corpus. See section 3.5 to 3.7, esp. fig 4, of the paper
Knight, D., Loizides, F., Neale, S., Anthony, L. and Spasić, I. (2020). Developing computational infrastructure for the CorCenCC corpus - the National Corpus of Contemporary Welsh. Language Resources and Evaluation (LREV).
available here:
https://www.researchgate.net/publication/343299269_Developing_computational_infrastructure_for_the_CorCenCC_corpus_The_National_Corpus_of_Contemporary_Welsh
As they say there:
"The main reasons for creating a bespoke interface rather than re-using an existing solution such as CQPweb (Hardie 2012) were the requirements to tailor its functionality to the specific metadata of the CorCenCC corpus and its prospective users, and so it could be integrated with a bespoke pedagogic toolkit."
My aim, via my push on plugins and the API over the last few years, is that, in future, people will be able to achieve this level of customisation without starting from scratch. Part of the point of CQPweb as a whole to help others avoid having to create the same basic web concordancer etc. over and over, but the evidence (not just from CorCenCC but from many other projects) is that this hasn't worked - people (quite rightly) have very particular requirements and if a system fails to meet just one of them, they'll start from scratch rather than adopt that existing system as a solution. Thus, the importance of customisability and extensibility. Things have improved. But overall it's not where it needs to be yet.
But on the actual topic of skins/colours...
Originally, the idea was that a skin = a CSS file. One css file contained all the formatting, so you rewrite that file as you liked to modify the appearance.
However, as the system evolved, things changed, because the basic CSS became more and more complex.
So what I did instead is parameterise the colours, and separate them from the main formatting. You can see this in the HTML at the start of any page:
<style>
:root {
--colour-layout-fg : #ecff6f;
--colour-layout-strong : #b9ff6f;
--colour-layout-contrast : #00ffff;
--colour-text-normal : black;
--colour-text-strong : black;
--colour-text-bright : purple;
--colour-text-faint : gray;
--colour-layout-bg : #d5d5d5;
--colour-layout-data2 : #f0f0f0;
--colour-layout-outline : white;
--colour-tooltip-frame : #003399;
--colour-tooltip-bg : #e6ecff;
--colour-tooltip-text : #000066;
}
</style>
(that's 3.3, it looks a bit different in 3.2)
So now, colour schemes are defined by the colour variables inserted here. This has allowed me to add a bundle of new built-in colour schemes (not chosen by me; I'm rubbish at that) quickly just by adding them to the code. See:
https://sourceforge.net/p/cwb/code/HEAD/tree/gui/cqpweb/trunk/lib/html-lib.php#l2628
Adding new colour schemes can be done by hacking that file OR using a CSS file that contains just a ":root" control like the above to specify colours, though the latter can't be set up by the interface (yet), only by directly putting the filename into the database in corpus_info.colour_scheme (or using them for the three main pages via the config file variables).
I want to add a system to dynamically control the colours in place of the use of CSS files, but as with so many other things, it's a matter of time ...
I also want to use more CSS variables so that colour-schemes can alter more behaviours (at the moment it's JUST colour).
For instance, the things that Thilo Wiertz's CSS skins for 3.2 do (which I really like by the way, they are better than most of my own efforts) wouldn't be possible in 3.3. But I'd like to make it so they are.
There are other people who've made the system look visually much better by hacking the code. See, for instance, https://corpling.uis.georgetown.edu/cqp/ (as I understand, the front page is the most-changed). The drawback is that doing that breaks upgrade paths. The aforementioned Georgetown server is at 3.2.11, for instance. Reapplying all their changes to 3.3 would be ... quite a task. I'm trying to amend the code structure to make that kind of modification easier.
Finally: If you want to change the interface completely, that is (where "is" = "will be Real Soon Now") possible too: by using the CQPwebClient as your backend, and then writing whatever frontend you want. Alas the CQPwebClient modules for different languages are nowhere near completion, and are dependent on the degree of completion of the API, of course.
best
Andrew.
-----Original Message-----
From: cwb-bounces at sslmit.unibo.it <cwb-bounces at sslmit.unibo.it> On Behalf Of Graham Ranger
Sent: 28 April 2022 14:45
To: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it>
Subject: [CWB] Skins for cqpweb
Hello to all,
I was wondering whether there are any alternative skins or themes for cqpweb?
I think this is a recurrent question, and I believe Thilo Wiertz has developed some css which change the colour schemes
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwiertz%2Fcqpweb_css&data=05%7C01%7Chardiea%40live.lancs.ac.uk%7Cd25ec0186f7b4176875d08da291e9e99%7C9c9bcd11977a4e9ca9a0bc734090164a%7C0%7C0%7C637867509923068013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2AiNy4PAziPSQCDm5YQVdCogozkvkr55ZQKY%2FtzNUZA%3D&reserved=0 but I was wondering if there was anything new... (I had understood, perhaps mistakenly, that the contemporary Welsh corpus was built around a cqpweb base, but with a very different interface https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcorpus.corcencc.org%2Fhome&data=05%7C01%7Chardiea%40live.lancs.ac.uk%7Cd25ec0186f7b4176875d08da291e9e99%7C9c9bcd11977a4e9ca9a0bc734090164a%7C0%7C0%7C637867509923068013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=c6vRK76DIhuKSXQ2AzLkDX87oR9cR8fKThX%2Fl2BUmJ8%3D&reserved=0.)
Best,
Graham.
_______________________________________________
CWB mailing list
CWB at sslmit.unibo.it
https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fliste.sslmit.unibo.it%2Fmailman%2Flistinfo%2Fcwb&data=05%7C01%7Chardiea%40live.lancs.ac.uk%7Cd25ec0186f7b4176875d08da291e9e99%7C9c9bcd11977a4e9ca9a0bc734090164a%7C0%7C0%7C637867509923068013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jwlzxrSC6BUvqjuOj4AP1UWjSv78NIXYe9r3PitTy%2BM%3D&reserved=0
More information about the CWB
mailing list