Comrade:CriticalResist/sandbox: Difference between revisions

No edit summary
Tag: Visual edit
No edit summary
 
(128 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Some useful regex functions ==
test
You can use search and replace with regex in the visual editor, just tap ''Ctrl+f'' on your keyboard, then click on the icon representing <code>(.*)</code> — that's the regex (regular expression) function, which will interpret your search string as regex.


Unfortunately you can't use regex in the replace function but anyway, here are some cool regex functions you can use to help you on pages. Just copy the "regex code" row into the search bar (yes it looks like nothing, that's normal)
== Stuff useful for library work ==
{| class="wikitable"
 
|+
stuff useful for library work has been [[Comrade:CriticalResist/sandbox/Library stuff|moved here]]
!Regex code
 
!What it does
= Donate to ProleWiki =
!Use for  
 
|-
'''<big>Thank you for supporting ProleWiki, comrade!</big>'''
|<code>\[(\d+)\]</code>
 
|Detects references like <sup>[12]</sup>
Donations such as yours is the only revenue ProleWiki makes. Everyone that works on ProleWiki is a volunteer who gives a lot of their free time to improve our pages and manage the encyclopedia, it is thanks to them that we now have more than 3000 pages on our encyclopedia!
|Transform plain text references into formatted MediaWiki references (ctrl+shift+k to add a reference). Will probably leave behind extra spaces so run the next function.
 
|-
We use donations to pay for the hosting costs (216 USD per year, with a reserve of 2 years), and any use of the excess is voted on democratically.
|<code>\s{2,}</code>
 
|Detect two spaces or more
Please find our various ways to donate by [[ProleWiki:Donate#Donation methods|clicking here]].
|Search for this code then press replace all and it will correct all possible extra spaces.
 
|-
Our financials are transparently logged [[ProleWiki:Donate#Income and expenses|here]].
|<code>\s(?=[.,;:!?)%])</code>
 
|Remove space before punctuation
<div class="donate-logo-container">
|Removes a space '''before''' punctuation, like . or ? or ;
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=LiberaPay|link=https://en.prolewiki.org|subtitle=ProleWiki}}
be careful before replacing all, you should look through instances one by one.
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=Patreon|link=https://en.prolewiki.org|subtitle=ProleWiki}}
|-
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=Paypal|link=https://en.prolewiki.org|subtitle=prolewiki@yandex.com}}
|<code>\s-{1,2}</code>
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=Pix|link=https://en.prolewiki.org|subtitle=6d2deee5-4cc4-4d22-9fd5-ce5bbc9eccfc}}
|Detects a hyphen or two after a space
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=Monero|link=https://en.prolewiki.org|subtitle=44BsTH5AVfqKrTTQjLsSwoTUv6iNYqaj8hEqUdmrKFbf23AqxYTRKsg1mphJXbMADS8oqdWnfrdi5USC2Sph7jb5VaiJYyt}}
|This can indicate incorrect use of an em dash  <code>—</code>
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=Bitcoin|link=https://en.prolewiki.org|subtitle=bc1q8k83tj80rfes007k7juxm3rzhyvyx3dnn90fx9}}
Will detect either - or --, which are sometimes incorrectly used. Replace all with em dash ('''with a space before''' but not after)
{{Donate platform|logo=PayPal Logo Icon 2014.svg|alt=Paypal logo|text=Redbubble store|link=https://en.prolewiki.org|subtitle=Coming soon!}}
|-
</div>
|<code>(?<!\s)\d+\s*[.\-\)]</code>
|Detects improperly formatted ordered lists (e.g. 1), 2), etc)
|We should use mediawiki lists instead of plain text. This detects such a case. Use only to find it, then apply the list format manually.
|}

Latest revision as of 00:00, 22 January 2024

test

Stuff useful for library work

stuff useful for library work has been moved here

Thank you for supporting ProleWiki, comrade!

Donations such as yours is the only revenue ProleWiki makes. Everyone that works on ProleWiki is a volunteer who gives a lot of their free time to improve our pages and manage the encyclopedia, it is thanks to them that we now have more than 3000 pages on our encyclopedia!

We use donations to pay for the hosting costs (216 USD per year, with a reserve of 2 years), and any use of the excess is voted on democratically.

Please find our various ways to donate by clicking here.

Our financials are transparently logged here.