User:Martha Forsyth/Mom's Code-samples
From Wikipedia, the free encyclopedia
LINKS
Note: putting text ABOVE any headers keeps it at the top of the page, but it doesn't get in the TOC; current code puts it in TOC, but it doesn't have its own separate "edit" tab - think we can live with that (just "edit" the whole page)! Also note the {{TOCright}} command; its (vertical) placement affects where the TOC box shows up.
- {{cquote|whatever you want big quotation marks around}} gives:
“ | whatever you want big quotation marks around | ” |
- compare features in various wiki programs (as of 21:14, 14 March 2008 (UTC))
- Some wikitricks, at User:Peteforsyth --17:51, 22 June 2007 (UTC), updated 02:21, 12 March 2008 (UTC)
- (boy did I wrestle with THIS simple format!! Problem was where to put "center" in
- [[Image:Bulgaria stub.svg|100px|thumb|center|Bulgaria]]) --Martha 20:04, 19 October 2007 (UTC)
- Commons Atlas of Bulgaria
- User:TodorBozhinov/Bulgaria free image resources - wow, usable images!!
- REFERENCES:
- Citing sources
- Citation templates of ALL sorts
- Footnotes
- Note refs at Chelopech - by using code:
- <ref name=visitbg>[http://www.visittobulgaria.com/visit/Dir.asp?d=0-13-sofia-Chelopech Chelopech], from Visit to Bulgaria web site</ref>
- the next time the same ref comes up, all you have to put is: <ref name=visitbg/>
- Duh! Peter told me this several months ago! including warning me about the "trailing slash", see below in #References. (There's gotta be a way to make a reference to a section WITHIN the same page....another new frontier, some other day!) -- 01:59, 12 March 2008 (UTC)
- Ha! I got it! [[#References]] gives: #References! -- 02:16, 12 March 2008 (UTC)
- Userboxes! --Martha 18:22, 6 January 2007 (UTC)
- Note particularly "Userbox sampling templates"
- (external link) The Super-Simple Userbox Maker - External tool that outputs userboxes in wiki markup. With built-in color schemes.
- Wikipedia templates
- MAP stuff
- Template:Location map start - Map with locater mark (go to the template page for full code). Same for all.
- Template:Infobox Settlement
- Template:Infobox Lake
- Template:Location map
- Template:Geobox/type
- Experimenting with these templates, it seems it doesn't matter what order you put the fields, they'll come out in the predicted places in the box. (Why would the order change? If, e.g., you've deleted some, or they aren't there, and you want to add 'em back in, you don't have to worry about WHERE you add 'em, just formulate them correctly and they'll come out OK. I wrestled for a long time with the box on Chelopech, it can give me some reminders.
- See #Locating places on a map, though, for some important information!
- Wikipedia:WikiProject Maps has a lot of promising info/links.
- Satellite photos! NASA, so copyright-free (few exceptions)
- Ah, Images!
- e.g., - find 'em at, e.g., Wikimedia Commons (this one specifies "star" - dunno how to search for these yet! but note how to size them; leaving out |thumb| gets rid of the arrow AND the border seen above) - and oh wowza,
- Wikipedia:Image copyright tags will help figure out which one is appropriate!
- Get statistics on # of viewers of a page (However, you have to go to this link, and put the page-name and the year/month code (one of those listed) into the address bar, not into the search-box, that doesn't work.)
- Ah, Templates! (Also of interest: Categories)
- Some useful examples (enter them, e.g. {{Work in progress}}:
- Template:Work in progress yields
- Template:nutshell (used at head of this page!, entering {{Work in progress|A collection of cute and/or useful bits of formatting code}})
- Placed after something questionable: Template:dubious (enter "date=[month] [year])" yields [dubious ]
- Template:cleanup-rewrite (enter "date=[month] [year])" yields
To comply with Wikipedia's quality standards, this article may need to be rewritten. Please help improve this article. The discussion page may contain suggestions. |
-
- Template:fact (enter "date=[month] [year])" yields yields [citation needed]
- Template:Clarifyme (enter "date=[month] [year])" yields [clarify]
- Template:Vague (enter "date=[month] [year])" yields
[vague] (This template apparently includes a line-feed somewhere.)
-
- Template:clear - lets next section start BELOW a large object (image, box, whatever) rather than in the middle of it.
- Done Template:Done
- Template:ethnic group - Note what |image=[[Image:MrdvnImg1.jpg|300px|]]<div style="background-color:#fee8ab"><small><small> [[Avvakum]] • [[Patriarch Nikon]] • [[Mikhail Devyatayev]] • [[Vasily Klyuchevsky]]</small></small> }} does (multiple images). But - aha! - it's simpler than that: Image:MrdvnImg1.jpg is itself a multiple image (description "Collage of images representing the Mordvin people. From left to right: Avvakum, Patriarch Nikon, Mikhail Devyatayev, Vasily Klyuchevsky..":
Volgaic Finns |
---|
Total population |
Regions with significant populations |
[edit] "TO DO"
* Get a map onto the Dospat Dam page (the position in the map below is not accurate!)HA!! It's been DONE (but not by me - however this is a good example)! - 03:18, 12 March 2008 (UTC)
- Hmm, SHOULD the map be on the Dospat Dam page too??? Probably better the version under discussion here. (1-2 April 2008)
- Aha: WikiMapia:Dospat reservoir. [
How can this be used??Damn! it can't = copyrighted.] And what does the page title have to say about the point below (usage of Dam vs. Reservoir)??? 19:09, 2 April 2008 (UTC)
-
- Also, if you look up Dam you find that it actually IS the wall (except in some dialects, e.g., Australian) — so "should" the page's title be changed to Dospat Dam and Reservoir (as in Pasarel?) Guess I should post on the article's Talk page.
- Did, and got a helpful reply on Talk:Dospat_Dam from User:Master of Puppets. He says: "To change the name, you have to move it. However, in this case the name we're looking for is the one it is known as. If newspapers and such call it the Dospat Dam, then that's what the article name should be." So, I'd need to check THAT out first.
- Bistritsa, Sofia needs some work...
- Focusing too
[edit] Somewhat urgent
Copyright tags for my Rila Monastery photos, see User_talk:Martha_Forsyth#Rila
[edit] "Here for safekeeping"
- Copied from User:Cameltrader/Rila_monastery_inscription, related to my work on "Image:Detail of Rila Monastery wall painting.jpg", discussion found on Wikipedia_talk:WikiProject_Bulgaria#witch (just keeping it here for easy ref. (and because I like the way it looks!), copied it on 00:09, 6 April 2008 (UTC))
Магє́сницытє и҆ вражали́цытє са дѧ́волски слугѝ, за това̀ и҆ дѧ́волъ-о мно́госє ра́дува, ска́ча, и҆ и҆гра́є, прє̀дъ о҆ніѧ, що и́дат прѝ нѝ, и҆ това̀ що запоѧ́ват, и҆ що захра́нуват, о҆но̀ є̀ дѧ́волски гнусотіи коѝ о҆ста́вѧт б҃га, зако́нъ-а, и҆ цє́рквата, и҆ хо́дaт при вражали́цытє о҆нѝ нє са̀ б҃жїѝ, но дѧ́волски слугѝ..
New version (maybe I like the old one better?!):
Магє́сницытє и҆ вражали́цытє са дѧ́волски слугѝ, за това̀ и҆ дѧ́волъ-о мно́госє ра́дува, ска́ча, и҆ и҆гра́є, прє̀дъ о҆ніѧ, що и́дат прѝ нѝ, и҆ това̀ що запоѧ́ват, и҆ що захра́нуват, о҆но̀ є̀ дѧ́волски гнусотіи коѝ о҆ста́вѧт б҃га, зако́нъ-а, и҆ цє́рквата, и҆ хо́дaт при вражали́цытє о҆нѝ нє са̀ б҃жїѝ, но дѧ́волски слугѝ..
Wee.e.ell.lll - I like the old one better, but the new one's more legible!
[edit] Test area
How well does wikEd "wiki-ize" imported text?
This is Кирилица, italic, 'bold', underlined text.
I copied from WP to Open Office, then blocked and copied from there WITHOUT saving the document. This preserved the bold and Italic ALMOST....I tried to do italic, bold but it doesn't seem to have quite come out that way. In fact I had to hand-code even this. BUT - it did "underline". Next try: separate italic and bold:
separate italic, then bold, then italic bold.
Ah, that looks more likely! But it puts in extra <font></font> codes (which I have removed).
[edit] Locating places on a map
[[template:location map]]
This didn't work right! I put in the same coordinates as "Dospat" in the lower of the two maps, but it positions wrong in the upper map!
- Bless you, Obersachse, for helping me out with this! Such a simple thing, but hours of wrestling with it, over a period of weeks, just didn't get me to the answer. Thanks again, and again. Here are the gory details Obersachse gave me:
-
- |lon_deg = longitude degrees
- |lon_min = longitude minutes
- |lon_deg = longitude degrees
-
- is not the same as
-
- |long = longitude (decimal format).
[edit] Infobox Settlement
Dospat | |
Dospat | |
Coordinates: | |
---|---|
Country | Bulgaria |
Provinces | Smolyan |
Government | |
- Mayor | Krasimir Dolev |
Elevation | 1,358 m (4,455 ft) |
Population (13.09.2005) | |
- Total | 2,706 |
Time zone | EET (UTC+2) |
- Summer (DST) | EEST (UTC+3) |
Postal Code | 4830 |
Area code(s) | 03045 |
- HA!! Dospat has been done!
But why do the same coordinates come out in two different places, depending on which of two templates I'm using??? - 03:18, 12 March 2008 (UTC), modified 02:02, 26 March 2008 (UTC)
- See Chech_(region) for another map, other ideas.
[edit] My map work
See advice, Wikipedia talk:WikiProject Maps#Advice on this map.3F 18:16, 2 April 2008 (UTC)
Current version: 16:59, 13 May 2008 (UTC)
[edit] Table format
simple table |
table without borders |
[edit] Sample: sortable table
Click on the little triangle-box to sort on that column. [Click on another box to change the sort. Only one level of sort - but what if you do first one then the second one, does it then sort within the sort?]
meas. num. |
passed | YES votes |
NO votes |
% YES |
Const. Amd.? |
description |
---|---|---|---|---|---|---|
77 | NO | 336,253 | 432,541 | YES | Makes Certain Local Taxing Districts' Temporary Property Tax Authority Permanent | |
78 | YES | 528,129 | 327,440 | YES | Lengthens Period For Verifying Signatures On Initiative And Referendum Petitions | |
79 | NO | 356,912 | 505,081 | YES | Increases Signatures Required To Place Initiative Amending Constitution On Ballot | |
80 | NO | 310,640 | 559,941 | YES | Authorizes Using Fuel Tax, Vehicle Fees For Increasing Highway Policing | |
81 | NO | 219,009 | 650,348 | YES | Allows Legislature To Limit Recovery Of Damages In Civil Actions | |
82 | NO | 109,741 | 767,329 | NO | Repeals Truck Weight--Mile Tax; Establishes And Increases Fuel Taxes |
-- Martha 21:29, 27 February 2007 (UTC)
[edit] Б
(section moved to User:Martha Forsyth/Glossary work
[edit] Message in colored box?
-- Martha 22:29, 27 February 2007 (UTC)
- The angle brackets indicate that it's a "template." so go to Template:Wikibreak, and look at the code - that code gets "sucked into" your page when you include the brackets. -Pete 21:49, 12 May 2007 (UTC)
- Note: I added | cats= | so my page doesn't get added to "inactive Wikipedians", per the Template page. (And, b'gosh, it WORKED, instantly!) -- Martha 05:08, 17 May 2007 (UTC)
-
- Another trick to seeing how templates work: use the word "subst" in the code, like this: {{subst:Wikibreak|message=blah}}. This will actually move the template's code into the page, instead of just "calling for it" every time somebody brings up the page. So after you save, you can click "edit" again and tinker around with the code. --- Pete (talk) 19:17, 16 November 2007 (UTC)
[edit] Colored background/box, OR Colored page background
Peter contributed this:
I added the closing tag, to get just a colored box (I hope!) -- Yup. Now, the next trick is to....play with Background Colors! Not tonight... == Martha 03:30, 28 February 2007 (UTC)
- I experimented with this tonight, and learned the following:
- You can change the background color (see tags at Web-safe colors#X11 color names).
- Adding a </div> tag at the end will give you a box with the background color specified (you can specify text color too. E.g., color:white (or other color).
- The closing /div tag actually determines where the background and text color will end, so you can do things like this:
[edit] experiment
[edit] end of experiment
— Martha (talk) 05:23, 26 March 2008 (UTC)
[edit] IMAGES
A picture, including alternate text:
You can also put the image in a frame with a caption:
NOW....what determines the horizontal alignment? Looks like:
- If it's in a line by itself, it's Left
- If it's at the end of a sentence/link, it's Right
BUT....it interrupts the following lines, headings, everything. Hmmm. This will need more study.
- OK, template {{clear}} used below does the trick!
Help:Images 18:44, 12 May 2007 (UTC)
[edit] Show/Hide Box
Subproject members |
---|
Please sign in here if you would like to contribute! |
(Copied verbatim from another page, content not important here, just format.) -Martha 18:20, 15 June 2007 (UTC)
Another example (I'm copying everything now because I don't understand all the details; I changed the background color "just to prove I can"):
Click "show" to reveal this collapsed section. |
---|
|
Pete copied this from Template:Hidden archive top for use with Wikiproject Oregon. Work in progress! (Use it with |} to end a collapsing section.)
The "heading" for the collapsed text can be changed with the reason=
parameter which defaults to "This discussion has been archived. Please do not modify it."
Using Wikipedia:WikiProject Oregon/People to test out this approach; if it works well, I'd like to incorporate it into other sub-projects, and ultimately WP:ORE. -Pete 21:33, 13 June 2007 (UTC)
[PETER: I don't understand the "Use it with {{hab}}..." part - does that indicate that this has restricted use of some sort?] -Martha
- Good work finding the source code. I'll take a quick crack at trying to explain this, it actually involves a few "techy" things. First, there are two similar things called "magic words," and things called "templates." I'm unclear on the distinction, but essentially, when something is surrounded with two sets of curly braces, that means that it's feeding in a chunk of code from somewhere else. In this case, {{hab}} is originally meant to go with the {{hat}} template; I presume the "t" is short for "top," and the "b" is short for "bottom." All it does is put in a | followed by a } . Which is the code for the end of a table. So, you don't necessarily have to use <noiwiki>{{hat</nowiki>, you just have to be sure you "end" the table. Which you can do manually with |}. Now, if you look at the source code for this comment, you'll see that I used a "trick" to make the curly braces show up, instead of doing what they're intended to do.
- Any of that make sense?
- Lemme give you a much simpler example of how a template might be used. Below this comment are the results of the {{uw-delete2}} template; it's used to quickly issue a warning to somebody who deletes a section out of an article for no apparent reason.
Please do not delete content or templates from pages on Wikipedia without explaining the valid reason for the removal in the edit summary. Your content removal does not appear constructive, and has been reverted. Please make use of the sandbox if you'd like to experiment with test edits. Thank you.
- Let me know if any of this helps, or just confuses matters more! -Pete 06:34, 14 November 2007 (UTC)
[edit] URLs in external links
A link in external link style can be of the forms:
- target: http://meta.wikimedia.org/ is rendered as http://meta.wikimedia.org/
- [ target label ], with a blank space in between: [http://meta.wikimedia.org/ wikimedia] gives wikimedia (see also Help:Piped link)
- [ target ] - these are automatically labelled with serial numbers 1, 2, 3, ...: [http://meta.wikimedia.org/] gives [1]
The target is a URL which can start with "http://" or "ftp://"
[edit] cool image!
[edit] Those big quotation marks; and citing a reference
“ | A flight of steps unequalled in magnificence, leads down the decivity to the shore and harbour[1] | ” |
[edit] References
- ^ Herlihy, p. 140, Quoting Koch, Charles (1855). The Crimea and Odessa: Journal of a tour. p. 260.
This is still fuzzy to me! For example, where does <ref name - "pat7"> come from? Maybe answers can be found at: Citing sources.
- The name attribute is not required. You use it when you want to[1] use the same citation[1] multiple times.[1] Note that the quotation marks, though frequently used, are not required. The trailing slash on the subsequent reverences are very important -- VERY strange things happen if you leave it out! -Pete (talk) 02:07, 28 November 2007 (UTC)