Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Web Analytics
Cookie Policy Terms and Conditions User talk:Omegatron/monobook.js - Wikipedia, the free encyclopedia

User talk:Omegatron/monobook.js

From Wikipedia, the free encyclopedia

Skillz
js-1 This user is a beginning JavaScript programmer.
re-2 This user is an intermediate regular expression programmer.
meat This user is mostly or entirely made of meat.

[edit] To do

  • use nbsp between number and unit?
  • en dash between digits with a unit or percent after?
    • 4-5dB → 4–5 dB
  • add a word boundary after unit in regexps so words like... um... "5radians" don't get converted into "5 radians"?
    • and before numbers
  • periods aren't counted towards em dashes
  • add hz --> Hz
  • Make it stop converting "1970s" to "1970 s" -- \d?\d?\d0s
    • nevermind, skip plain s
  • fix things like "6,3 mm" → "6.3 mm", "1 000 m" → "1,000 m" as per MoS
  • Add unicode number entities to replacement lists:
  • Write something to fix heading format, as if it had been added with the + tab
    • (={2,})( |\t)*(.*?)( |\t)*(={2,})(\n)+ → $1 $3 $5$6$6
  • Write something to change "+/-" into ±
    • (\s|\d)\+\/(-|−|-)(\s|\d) → $1±$3
  • Fix external links and see also sections
  • Press preview by default after clicking tab
  • everything should ignore the insides of math tags
  • extra newline remover should count lines with only whitespace too
  • Rewrite units thing without depending on clunky regexps
  • "12-mm" → "12 mm"
  • lowercase units when written out?
  • These aren't working correctly:
  • link the first occurrence of each unit
  • Audio links script should replace "help" with "Audio help", "info" with "File info" or "File details"
  • some buttons for saving with specific edit summaries? Like "Formatting" "Spelling" etc for people like me who don't put edit summaries?
  • write your own shortened diff for the automatic edit summaries?!1? It could be done, probably. Have javascript save the original textarea to a variable, and when you press submit, it does a comparison of the current textarea and the original and adds a summary of the diff. i wish i knew js better.

[edit] SI regular expressions

Prefixes: Y Z E P T G M k h da d c m μ µ µ n p f a z y

  • ['Y', 'Z', 'E', 'P', 'T', 'G', 'M', 'k', 'h', 'da', 'd', 'c', 'm', 'µ', 'n', 'p', 'f', 'a', 'z', 'y']

Base units: g s m A K mol cd

  • ['g', 's', 'm', 'A', 'K', 'mol', 'cd']

Derived units: rad sr Hz N J W Pa lm lx C V Ω ohm Ω F Wb T H S Bq Gy Sv kat °C °C M

Accepted units: L

Other units to treat the same way: B dB

  1. Convert all occurrences (in the presence of numbers and prefixes):
    • ° → °
      • ° → °
    • Ω or ohm or Ohm → Ω
      • (\d)\s?(Y|Z|E|P|T|G|M|k|K|h|da|d|c|m|µ|μ|µ|n|p|f|a|z|y)?(Ω|ohm|Ohm)s? → $1 $2Ω
    • μ or μ or µ → µ
      • (\d)\s?(μ|μ|µ)(g|s|m|A|K|mol|cd|rad|sr|Hz|N|J|W|Pa|lm|lx|C|V|Ω|F|Wb|T|H|S|Bq|Gy|Sv|kat|°C|M) → $1 µ$3
    • K → k before units (will conflict with compound units that should be K⋅something)
      • (\d)\s?K(g|s|m|A|K|mol|cd|rad|sr|Hz|N|J|W|Pa|lm|lx|C|V|Ω|F|Wb|T|H|S|Bq|Gy|Sv|kat|°C|M) → $1 k$3
  2. spaces between numbers and units
    • (\d)\s?(dB|B)\b → $1 $3
    • (\d)\s?(Y|Z|E|P|T|G|M|k|K|h|da|d|c|m|µ|n|p|f|a|z|y)?(g|s|m|A|K|mol|cd|rad|sr|Hz|N|J|W|Pa|lm|lx|C|V|Ω|F|Wb|T|H|S|Bq|Gy|Sv|kat|°C|M) → $1 $2$3

Digital units

  1. Decimal
    • kbits/s or kb/s or kbps or Kbps → kbit/s
      • [KkMmGgTtPpEeYyZz](bps|bits?\/s|b\/s) → $1bit/s
    • kbytes/s or kbyte/s (or KB/s?) or kBps or KBps → kB/s
      • [KkMmGgTtPpEeYyZz](Bps|bytes?\/s|B\/s) → $1B/s
  2. Binary
    • Kib or kib → Kibit
      • [KkMmGgTtPpEeYyZz]ib → $1ibit
    • kiB → KiB
      • [KkMmGgTtPpEeYyZz]iB → $1iB
    • Common error
      • mibi(bit|byte) /i → mebi$1

kbit/s kB/s Kibit/s KiB/s

can the entire set of units be defined as a variable and included in regexps?

maybe match for the entire thing and say "these pieces are units", and then run each unit through separate rules that correct each part?

these don't handle capitalization yet. can you match on several things but only use some?

[edit] False positive on dates

Make it stop converting "1970s" to "1970 s"

Convert: 1000 s 1954 s

Don't convert: 1970s 70s 1800s 00s

-- \d?\d?\d0s

You know what? We're never going to see "1000 s". Just skip it.

Static Wikipedia 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu