Skip to content

Commit

Permalink
add contributing guide (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDizzy authored Jun 15, 2024
1 parent 85bae6b commit ae6f77a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How To Contribute

There are a number of ways to contribute to the Wiki to make it accessible to many skill levels.

## Content only

All wiki content is written in markdown (.md) files, which individual page files load and embed to create the page you see. Markdown syntax is used for Discord post formatting, but a reference can be found at [https://www.markdownguide.org/](https://www.markdownguide.org/). The easiest way to contribute is to edit or create a markdown file and either [create a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) to the wiki or to give it to DeltaDizzy or R-T-B to add to the wiki. A pull request is preferred because it is simpler to review and easier to integrate.

Markdown files should be placed in wwwroot/content, inside a folder that corresponds with what the page is describing (for example, if you are adding a PQSMod it should probably go in wwwroot/content/Syntax/PQSMods).

## Content and Backend

If you also want to create the page file (assuming you are making a new page), copy [the example razor file](/ExamplePage.razor) and modify it. You will need to make the following changes:

1. Change the url after `@page` to the one you want the page to be at. `https://kopernicuswiki.org` will be put before the url you list.
2. In the `@code` block, change the value of `pageTitle` to the title you want displayed to page visitors.
3. In the `MarkdownPageRenderer` tag, change the value of `srcFile` to the file path of your markdown content file.

The path is relative to the wwwroot folder so "content/Syntax/Body.md" searches for wwwroot/content/Syntax/Body.md. A link to your new page should be added somewhere depending on how you want users to find it. Do not link to the file path, but use the url you defned at the top of the razor file. See wwwroot/content/index.md for examples.

RouteList.cs in the repository root will also need to be modified, but if you don't want to do it we can. Find the correct section (or create one if it is a new section), and insert a line like `"pageName" => "pageUrl",`, where `pageName` is the title of your page as listed in the razor code block and `pageUrl` is the defined url of the page.

If you need help or have any questions, feel free to ping @DeltaDizzy on the Kopernicus discord, in DMs, or on GitHub.
9 changes: 9 additions & 0 deletions ExamplePage.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@page "/Sample/Url"

<h1>@pageTitle</h1>

<MarkdownPageRenderer srcFile="content/folder/example-page.md" pageName=@pageTitle/>

Check warning on line 5 in ExamplePage.razor

View workflow job for this annotation

GitHub Actions / 🎉 Publish

Found markup element with unexpected name 'MarkdownPageRenderer'. If this is intended to be a component, add a @using directive for its namespace.

@code {
string pageTitle = "Example Page";
}

0 comments on commit ae6f77a

Please sign in to comment.