Markdown 语法快速入门

1、标题

一级标题 输入一个‘#’+空格就代表标题

二级标题

三级标题

四级标题

五级标题
六级标题

2、文字

加粗

高亮


id: Unique identifier (alphanumerical, MongoDB_id)
title: 'Challenge Title'
challengeType: Integer, defined in client/utils/challenge-types.js
videoUrl: 'url of video explanation'
forumTopicId: 12345

--description--

Challenge description text, in markdown

<div>example code</div>

--instructions--

Challenge instruction text, in markdown

--hints--

Tests to run against user code, in pairs of markdown text and code block test code.

Code for test one

If you want dynamic output based on the user's code, --fcc-expected-- and --fcc-actual-- will be replaced with the expected and actual values of the test's assertion. Take care if you have multiple assertions since the first failing assertion will determine the values of --fcc-expected-- and --fcc-actual--.

assert.equal(
  'this will replace --fcc-actual--',
  'this will replace --fcc-expected--'
);

--notes--

Extra information for a challenge, in markdown

--seed--

--before-user-code--

Code evaluated before the user’s code.

--after-user-code--

Code evaluated after the user’s code, and just before the tests

--seed-contents--

Boilerplate code to render to the editor. This section should only contain code inside backticks, like the following:

<body>
  <p class="main-text">Hello world!</p>
</body>
body {
  margin: 0;
  background-color: #3a3240;
}

.main-text {
  color: #aea8d3;
}
console.log('freeCodeCamp is awesome!');

--solutions--

Solutions are used for the CI tests to ensure that changes to the hints will still pass as intended

// first solution - the language(s) should match the seed.

// second solution - so if the seed is written in HTML...

// third solution etc. - Your solutions should be in HTML.

--assignments--

This will show a checkbox that campers have to check before completing a challenge


This will show another checkbox that campers have to check before completing a challenge

--question--

These fields are currently used for the multiple-choice Python challenges.

--text--

The question text goes here.

--answers--

Answer 1

--feedback--

This will be shown as feedback when campers guess this answer


Answer 2


More answers

--video-solution--

The number for the correct answer goes here.

--fillInTheBlank--

These are for the English curriculum challenges.

--sentence--

Sentence to be shown with with blanks that campers have to fill in. Example:

Hello, You _ the new graphic designer, _?

The two underscores will show up as blanks. The sentence must be surrounded in backticks.

--blanks--

The solution for the first blank in the sentence above. Example:

are

--feedback--

Feedback shown when campers input the wrong solution for this blank.


Solution for the second blank. Example:

right

If no feedback is here, a generic "wrong answer" message will be shown.

--scene--

// # --scene-- can only consist of a single json object
{
  // Setup the scene. Properties not marked optional are required.
  "setup": {
    // Background file to start the scene. A list of scene asset filenames can be found here: https://github.com/freeCodeCamp/cdn/pull/233/files
    "background": "company2-center.png",
    // Array of all characters that will appear in the scene
    "characters": [
      {
        // Name of character. See list of available characters in scene-assets.tsx
        "character": "Maria",
        // Where to start the character. Maria will start off screen to the left
        "position": { "x": -25, "y": 0, "z": 1 }
      },
      {
        "character": "Tom",
        // Tom will start 70% from the left of the screen and 1.5 times regular size
        "position": { "x": 70, "y": 0, "z": 1.5 },
        // Optional, defaults to 1. Tom will start invisible
        "opacity": 0
      }
    ],
    "audio": {
      // Audio filename
      "filename": "1.1-1.mp3",
      // Seconds after the scene starts before the audio starts playing
      "startTime": 1.3,
      // Optional. Timestamp of the audio file where it starts playing from.
      "startTimestamp": 0,
      // Optional. Timestamp of the audio file where is stops playing. If these two aren't used, the whole audio file will play.
      "finishTimestamp": 8.4
    },
    // Optional, defaults to false. Use this for the long dialogues. It stops the accessibility icon from showing which gives campers the option to show or hide the dialogue text
    "alwaysShowDialogue": true
  },
  // Array of commands that make up the scene
  "commands": [
    {
      // Character that will have an action for this command
      "character": "Maria",
      // Optional, defaults to previous value. Maria will move to 25% from the left of the screen. The movement takes 0.5 seconds
      "position": { "x": 25, "y": 0, "z": 1 },
      // When the command will start. Zero seconds after the camper presses play
      "startTime": 0
    },
    {
      "character": "Tom",
      // Optional, defaults to previous value. Tom will fade into view. The transition take 0.5 seconds. Movement and Opacity transitions take 0.5 seconds
      "opacity": 1,
      // Tom will fade into view 0.5 seconds into the scene (immediately after Maria finishes moving on screen)
      "startTime": 0.5
    },
    {
      "character": "Maria",
      // When the command starts: Maria will start saying this line 1.3 seconds into the scene. Note that this is the same time as the audio.startTime above. It doesn't have to match that (maybe there's a pause at the beginning of the audio or something)
      "startTime": 1.3,
      // The character will stop moving their mouth at the finishTime
      "finishTime": 4.95,
      "dialogue": {
        // Text that will appear if the dialogue is visible
        "text": "Hello! You're the new graphic designer, right? I'm Maria, the team lead.",
        // Where the dialogue text will be aligned. Can be 'left', 'center', or 'right'
        "align": "left"
      }
    },
    {
      // background will change to this at 5.4 seconds into the scene
      "background": "company2-breakroom.png",
      "character": "Tom",
      "startTime": 5.4,
      "finishTime": 9.4,
      "dialogue": {
        "text": "Hi, that's right!  I'm Tom McKenzie. It's a pleasure to meet you.",
        // Tom's text will be aligned to the right since he is on the right side of the screen
        "align": "right"
      }
    },
    {
      "character": "Tom",
      // Tom will fade to 0 opacity
      "opacity": 0,
      // I like to move characters off screen or fade them 0.5 second after the last talking command
      "startTime": 9.9
    },
    {
      "character": "Maria",
      // Maria will slide back off the screen to the left
      "position": { "x": -25, "y": 0, "z": 1 },
      // The animation will stop playing 0.5 seconds after the 'finishTime' of the last command - or 0.5 seconds after 'startTime' if 'finishTime' isn't there.
      "startTime": 10.4
    }
  ]
}
posted @ 2025-02-09 11:26  Luohanhui  阅读(20)  评论(0)    收藏  举报