This repository has been archived on 2022-06-22. You can view files and clone it, but cannot push or open issues or pull requests.
usaco-guide/Content Documentation.md
2020-06-22 13:58:36 -07:00

2.9 KiB

Content Formatting Documentation

All modules are written in Markdown. There are special additions to the markdown that we have added to this site. These special additions are still under development, so they may change frequently. If you are confused about something, or if there's a certain feature that you want to add, reach out to Nathan Wang.

You can use StackEdit to check that latex renders properly.

ordering.ts

Located at content/ordering.ts, this file stores the ordering of the modules. Hopefully the format is self-explanatory (it matches based on "slug"). Let Nathan Wang know if you have questions.

Frontmatter

Frontmatter is the stuff in the beginning of each module that's surrounded by three dashes. Frontmatter is written in YAML. It stores the "metadata" for each module.

YAML formatting is extremely strict. Be careful about spaces. Additionally, escape special characters by wrapping the string with double quotes.

  • ID: Required. The ID of the module. Ex: getting-started, or containers. This ID is used to identify the module, so make sure it is unique and all lowercase with dashes only. The URL will be generated based off this.
  • Title: Required. The title of the module. Ex: Getting Started
  • Author: Required. The author of the module. Ex: Unknown
  • Description: Required. A short description of the module, similar to what codecademy has in their syllabus. Markdown/Latex does not work in the description field.
  • Prerequisites: Optional. Any prerequisites for this module. (Coming soon: If you want to reference a module as a prerequisite, you can list the module ID.)
  • Problems: Optional. A list of problems in the article. As we haven't figured out what we're going to do with it's best to not include this yet. For USACO problems, enter each problem as division_filename. Ex: bronze_promote.

Spoilers

Spoilers are collapsible elements that only show themselves when the user clicks on it. It's useful when writing solutions to problems.

<spoiler title="Show Solution">

- Insert OP benq solution here

</spoiler>

Info Block

<info-block title="Insert Title Here">

**Markdown is Supported!!**

</info-block>

Optional Block

<optional-content title="Insert Title Here">

Fun fact: the title attribute is optional.

</optional-content>

Example Module

---
id: getting-started
title: Getting Started
description: Welcome to the guide! We'll introduce what programming competitions are and how this guide is organized.
author: Nathan Wang
order: 1
prerequisites:
 - Dummy prerequisite
 - running-cpp
problems:
 - bronze_promote
 - bronze_word
 - bronze_paint
 - bronze_square
---

# Hello World!