Editing This Wiki - UMKCgeg/Wiki GitHub Wiki
This page holds a bunch of tips and tricks for how to edit the wiki.
Important Note
Everything on the wiki is public to everyone. It can only be edited by members of the GEG, but everyone can see it. Don't put things like data products, proprietary codes, or anything else that is sensitive on here. Put those in something password protected like the N drive. That said, feel free to share code that you don't mind being public. A lot of what we write, especially when it comes to plotting or simple data analysis, is perfectly fine to share with the world.
What to Add
This wiki is a repository of all knowledge that would be useful for doing astronomy. This can range from guides on how to use specific tools, ways to improve coding, or even simple tips and tricks for using tools everyone already knows how to use. If you've found something useful when doing your work, add it somewhere here, no matter how small.
Where to add it
If there is an existing page that already has a lot of info about the topic that you're interested in contributing to, consider adding your information there. If there isn't one, but your topic fits into one of the main categories that already exist (ie ones that have links on the homepage and sidebar), make a new page and link to it from within that section. For example, if you make a page on IDL programming, link to it from the Coding page. If your idea for a new page is not contained within one of those categories, go ahead and make a new one that covers the info you want to add. Make sure to link to it from the home page and sidebar once you're done. It would be ideal if your new topic was broad enough that multiple pages could be written about it, so we don't end up with a ton of pages in the sidebar, but if not that's not a big deal.
Editing Existing Pages
This all assumes you have a GitHub account and are a collaborator for the wiki. When you are logged into Github and on a page of the wiki, there will be an edit button on the top right of the page. Click that, and you will be brought to the edit page.
From here, you will see the raw Markdown that was used to create the page. There is a header with quick links to a few useful item in creating pages. Above that are two tabs with Write
and Preview
. Clicking the preview tab shows you what the page will look like once you save it. At the bottom of the page there is an option to add a message explaining the change. Please fill this out, as it will help the revision history look nicer, and help others understand what you've done. Then hit the green Save Page
to save your edits.
Markdown
Github uses Markdown to format it's wiki pages, so you'll need to know a little bit of that to make good pages. This cheat sheet is a good reference. I'll put some of the important things below, but if there's anything you want to do, take a look at that or Google. There are plenty of references available. You can also hit the ?
in the toolbar above the edit page, which has a bunch of info too.
One minor thing to be aware of when editing is that you need a blank line between paragraphs to make it become a new paragraph. Just going to the next line will keep it in the same paragraph, which is probably not what you want. Be aware of that when editing pages.
Linking to other pages
This is a big one. The general syntax for links is [link text](link URL)
. It will show up like this: link text.
Linking to other pages of the wiki is easy. You can simply use the name of the page as the URL. So for example, [test](Home)
turns into test. You can also just wrap the name of the wiki page in double []
to just use the name of the page as the link title. For example, [Coding](/UMKCgeg/Wiki/wiki/Coding)
turns into Coding. Note that this syntax only works for wiki pages.
Linking to specific parts of a document
Each header creates a new section that you can link to. Within the same document, just link to #name-of-header
. Nothing is capitalized, and spaces are replaced with hyphens. For example, #linking-to-specific-parts-of-a-document
goes to this section. This can be used to create a table of contents.
Code snippets
You can distinguish code snippets inline by wrapping them in backticks (upper left of a Mac keyboard). So `print("Hello World")` becomes print("Hello World")
. This is useful for distinguishing variable names or parameters of code you are describing or explaining how to use. You can also do longer code blocks by either indenting four spaces or wrapping in triple backticks ````
```python
for i in range(10):
print(i**2)
```
becomes
for i in range(10):
print(i**2)
The backticks are recommended for block code because they support syntax highlighting, as you can see.
Also note that if you want to display any character that is used in the Markdown syntax, you can escape the Markdown with a backslash \
.
Adding images
Images are kind of a pain in the butt, unfortunately. It only will work with images that already exist online. If your image is already online, then great, but if not, you'll have to upload the image somewhere first. There is a folder in the code section of this repository named wiki_images
that is a good place to put them. To do this, the easiest way is to just navigate to the wiki_images folder. There will be a button in the top right labeled Upload Files
. Upload the file, add a message describing the image you are adding, then commit your changes. After you upload the image, find it again in the wiki_images
directory, right click on it's name in the list, then copy the link address. As a side note, please name the image something useful before uploading so everyone can tell what it is for.
Then the syntax is ![](image link)
. That exclamation mark tells it it's an image, so don't forget it. You can fill the[]
with text if you want hover-text.
Headers
Adding #
s before a line of text turns it into a header. One #
makes it a level one header, which is the largest. The more you add, the smaller the header. For example, ###### Smallest header
turns into:
Smallest Header
There are six levels of header, so the most #
you can have is 6.
Lists
- Lists are possible
- by adding
*
or-
or+
in front
- of the line, or...
Numbered lists...
- are done
- by just adding
- the number, as you would expect.
Tables
Tables can be created like so:
| Left aligned | Centered | Right Aligned |
| :------------ |:-------------:| --------------:|
| M31 | galaxy | Spiral |
| M87 | galaxy | Elliptical |
M1 | not a galaxy | Supernova Remnant
turns into...
Left aligned | Centered | Right Aligned |
---|---|---|
M31 | galaxy | Spiral |
M87 | galaxy | Elliptical |
M1 | not a galaxy | Supernova Remnant |
Notice how the outer pipes are not needed, and they don't need to be all lined up for it to format properly. Those things just make it easier to look at when editing. Also notice how the locations of the colons in the second row determines how the columns are aligned.
Horizontal Lines
Putting three or more hypens -
, underscores _
, or asterisks *
will put a line, like this.
Creating New Pages
On any page of the wiki, there will be a big green button in the upper right labeled New Page
. Hit this to make a new page, obviously. It will take you to a blank edit screen, where you can make your new page.
After you're done, make sure to add links to your new page on the other relevant pages. And if you made a page that you think should go on the sidebar, add it there too.
Deleting a Page
To delete a page, go into the edit mode for a page, and there will be a large red Delete Page
button.
Adding Code
The easiest way to add small code snippets to the wiki is the way described above. The code will show up on the page where it's easy for the reader to see it in context. If you want to upload larger code files, you can. The easiest way to so this is to navigate to the code
section of the repository, which can also be found in the bar near the top of the page. There will be a button that gives you the opportunity to upload files
. You can upload files directly with that.
If you want to modify existing code, you can click on the file to view it. There will be a pencil icon in the top right that will let you modify code. You can also clone the whole repository to your machine, and make changes that way. See the Using Github page for more info.
Sidebar/Footer
The sidebar is structured just like any other page. Hit the pencil on the sidebar to edit it. The footer works the same way.