Help:Editing

From SQLServerPedia

Jump to: navigation, search

See Also: How_To_Help

Contents

About Article Content

For tips on article content, check out these links:

How to Format Wiki Articles

Some articles were exported from Quest's KnowledgeXpert product and the text isn't easy to read or edit. If one of your articles has all of the content jammed into a single line with no line breaks, and you want to do edits on it, you can email Brent Ozar with the URL and he'll help clean it up for you.

For the rest of the articles, use standard Wiki syntax as follows.

Formatting T-SQL Code

To put code into your wiki article, frame it with "<pre>" tags like this (you'll need to add a class telling the highlighter which language you are using):

<pre class="brush:tsql">
SELECT r.cpu_time-t.cpu_time AS CPUDiff 
, r.logical_reads-t.logical_reads AS ReadDiff
, r.wait_type
, r.writes, r.row_count, s.[HOST_NAME]
FROM sys.dm_exec_sessions AS s INNER join sys.dm_exec_requests AS r 
ON s.session_id =r.session_id and s.last_request_start_time=r.start_time
LEFT join #temp AS t ON t.session_id=s.session_id
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) h
WHERE is_user_process = 1
ORDER BY 3 DESC
</pre>

It will show up on the page like this:

SELECT r.cpu_time-t.cpu_time AS CPUDiff 
, r.logical_reads-t.logical_reads AS ReadDiff
, r.wait_type
, r.writes, r.row_count, s.[HOST_NAME]
FROM sys.dm_exec_sessions AS s INNER join sys.dm_exec_requests AS r 
ON s.session_id =r.session_id and s.last_request_start_time=r.start_time
LEFT join #temp AS t ON t.session_id=s.session_id
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) h
WHERE is_user_process = 1
ORDER BY 3 DESC

The color-coding and fonts are done automatically - all you have to do is copy/paste in the T-SQL. You can also use more than just T-SQL as the source language - here is the list of supported languages for syntax highlighting.

Things That Work Anywhere

Description You type You get
Italic text ''italic'' italic
Bold text '''bold''' bold
Bold and italic '''''bold & italic''''' bold & italic
Strikethroughs <del>strikethrough</del> strikethrough
Escape wiki markup <nowiki>no "markup"</nowiki> no ''markup''
Fixed width text

<tt>Fixed width text</tt>

Fixed width text


Things That Only Work at the Beginning of a Line

Description You type You get
Indent text

:Single indent
::Double indent
:::::Multiple indent

Single indent
Double indent
Multiple indent
Headings of

different levels
(An article with four or more headings will automatically create a table of contents.)

==level 2==
===level 3===
====level 4====
=====level 5=====
======level 6======

Level 2

Level 3
Level 4
Level 5
Level 6

Horizontal rule

----


Bullet list

* one
* two
* three
** three and one-third
** three and two-thirds

  • one
  • two
  • three
    • three and one-third
    • three and two-thirds
Numbered list

# one
# two<br />spanning several lines<br />without breaking the numbering
# three
## three point one
## three point two

  1. one
  2. two
    spanning several lines
    without breaking the numbering
  3. three
    1. three point one
    2. three point two
Mixture of bulleted
and numbered lists

# one
# two
#* two point one
#* two point two

  1. one
  2. two
    • two point one
    • two point two
Definition list

;Definition
:item 1
:item 2

Definition
item 1
item 2
Preformatted text

  preformatted text is done with
  a space at the
  beginning of the line

preformatted text is done with
a space at the 
beginning of the line
Preformatted text with no indentation

 <pre> some preformatted text with no indentation </pre>

some preformatted
text with no indentation
Blockquotes

Body
text text text text text text text text text text text text text text text text text text text text text text text text

<blockquote> quote quote quote quote quote quote </blockquote>

text text text text text text text text text text text text

Body
text text text text text text text text text text text text text text text text text text text text text text text text

quote quote quote quote quote quote

text text text text text text text text text text text text

Comment

<!--This is comment-->

More Formatting Examples

For more detailed format tricks, check out these links. Not all of the MediaWiki commands will work at SQLServerPedia since we don't have customized templates set up, though.

Adding Images and Screen Shots

To add an image to a page, type this into the editor:

[[Image:MyImageName.jpg|My Helpful Image Description]]

You can use any file name you want for the image - the file will be uploaded in the next step, and the file name doesn't have to exactly match the file name on your hard drive. The extension does have to match, though.

Every image should include a description so that those with screen readers can hear it.

Click the Show Preview button at the bottom of the page. The preview of the page will have a red link for your image. Right-click on that link, and click Open in New Window. From there, you can upload the image.

After uploading the image, come back to your Wiki article and click Show Preview again. The page will be refreshed with your new image.

For picture formatting commands, see this Wikipedia article:

http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_Page_Help/Do-It-Yourself/Formatting_Text#Picture_formatting

Adding Videos

To display videos inline in the article like you see below, they need to be converted into Apple Quicktime format (MP4) with the streaming hints enabled. For help with setting that up, email us at ask@sqlserverpedia.com. Then, when that's done and the videos are hosted somewhere (we can host 'em for you too) you can show videos using the following syntax:

http://tutorials.sqlserverpedia.com/SQLServerPedia-20090129-Baselining.flv

That's right - just literally type in the location of the video. When the page is viewed, the video will show in a player like this:

http://tutorials.sqlserverpedia.com/SQLServerPedia-20090129-Baselining.flv

Getting Your Page Noticed in Search Engines

To get your articles the best possible placement in search engines, thereby helping more DBAs to find your tips, you can populate the meta keywords and descriptions for your page by inserting the below code into your page.

This is only for advanced users. If meta tags don't mean anything to you, don't worry about it - skip this.

<meta name="keywords" content="your keywords go here, separated by commas">
<meta name="description" content="A plain, easy-to-read one-line description of your article.">