Skip to content

Working with content

Vanessa Jones edited this page Mar 19, 2020 · 6 revisions

All content is stored in content directory. Each content file belongs to a class. The name of the class is the name of the sub-directory.

For example, the class ca-qc is the class of content that will be served to people who answered they are located in Quebec.

Content structure

The structure of this project is based on the following concepts:

The chatbot is composed of steps. Steps are chained. Each step specifies the next step. A step with a question (eg. "Do you have fever?" is followed by a step with a set of options (eg. Yes or No). The user selects an option and the system records a new fact (eg. Fever:Yes). All facts are used as input to the rules engine. The rules are used to classify the set of facts into classes. For example, if there is a rule that states that if the facts include Fever:Yes, then this set of facts must be classified as "high-risk". Each class represents a set of content files. Each class has its own subdirectory under src/content directory. A content file is a Markdown file that has a title, body and source. A filename of the content file must be in the form of filename.{language-code}.md.

Updating an existing content file

  1. Navigate to the content subdirectory
  2. Click on a file you want to edit
  3. Click on the edit button Edit button
  4. Click on "Preview changes" to make sure that the changes are formatted properly. Preview Changes
  5. Describe your change and make sure to select "Create a new branch" Submit a PR
  6. Click on "Commit changes" and take note of your branch name. In the image, the branch name is feat/wiki-tutorial.

If you want to update multiple files, go to the step updating multiple content files. If that is the only change that you wish to make, performs the steps under creating a pull request.

Updating multiple content files

  1. Navigate to the file that you want to edit
  2. Important: make sure that you are on the same branch as you created in the previous step. Switching branches
  3. Edit the file and save your changes. Make sure to select commit directly to the branch. Save to branch
  4. Repeat Steps 1-3 for all of the files that you wish to edit and when you are ready, perform the steps under creating a pull request.

Creating a pull request

Once you are happy with all of your changes, you will need to create a pull request (PR) to get your file changes from your branch merged into master. Once your PR will be created, the team will review it and if they approve of your changes, they will merge your PR into master. Then, your changes will become available on the website.

  1. Make sure that you check that your pull request shows master on the left and your branch on the top right.
  2. Additionally, to follow the convention, make sure that your PR starts with feat: for all content changes.
  3. Click on "submit pull request" and you're all set! Create a PR

Creating a new content file

The content served to uses is stored in text files in https://github.com/dialoguemd/covid-19/tree/master/src/content.

The files are placed in sub-sirectories. Each sub-directory corresponds to a "content class". A content class is a collection of content that will be served to all users that belong to a class. Which class a user belongs to is determined by the answers they provide.

  1. Decide on the class of your new file. Your content file needs to belong to an existing class.
  2. Navigate to the content subdirectory based on the class you have decided on
  3. Create a new file. All content files follow the Markdown format.
  4. Propose it via a Pull Request

Make sure to follow this format:

## Title

Your content goes here

[Source](https://link-to-the-source-of-the-content)

Don't forget

  • The content is bi-lingual so you will often make two changes. The naming scheme is filename.md is English and filename.fr.md is French
  • The text of the file needs to have a title (the first line) and the source of the information (the last line)
  • The last line of the file needs to be left blank