Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document adding new site content in DG #1153

Merged
merged 17 commits into from
Apr 8, 2020
Merged
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions docs/devGuide/devGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ A: Please report this in a [new issue](https://github.com/MarkBind/markbind/issu
Our test script does the following:

1. Lints the code for any code and style errors using ESLint.
1. Builds the test sites whose directory names are listed in `test/functional/test_sites`.
1. Builds the test sites whose directory names are listed in `test/functional/test_site`.
1. For each test site, compares the HTML files generated with the HTML files in its `expected` directory.

#### Running tests
Expand Down Expand Up @@ -175,12 +175,42 @@ On Windows:
You should always check that the generated output is correct before committing any changes to the test sites.
</box>

##### New features
#### Adding site content
Tejas2805 marked this conversation as resolved.
Show resolved Hide resolved

When adding new features, you should also add new site content into an existing test site or create a new test site to demonstrate the new feature. This is to ensure that your feature can be tested by building that test site.

Tejas2805 marked this conversation as resolved.
Show resolved Hide resolved
1. Add a new test page, e.g., `newTestPage.md`, containing a demonstration of the new feature.

2. Open `test/functional/test_site/site.json`
Tejas2805 marked this conversation as resolved.
Show resolved Hide resolved

3. To include a new page, e.g., `newTestPage.md`, add it to the pages array.
Tejas2805 marked this conversation as resolved.
Show resolved Hide resolved

``` {heading="site.json" highlight-lines="16,17"}
"pages": [
{
"src": "index.md",
"title": "Hello World",
"frontmatter": {
"frontMatterOverrideProperty": "Overridden by front matter override",
"globalAndFrontMatterOverrideProperty": "Overridden by front matter override"
}
},
...
{
"src": "testLayouts.md",
"title": "Hello World"
},
{,
"src": "newTestPage.md",
"title": [some title you see fit]
},
....
Tejas2805 marked this conversation as resolved.
Show resolved Hide resolved
```

4. Update the tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the expected test files using npm run updatetest


<box type="info">
When creating a new test site, the directory name of the new test site should be added to <code>test/functional/test_sites</code>.
Tejas2805 marked this conversation as resolved.
Show resolved Hide resolved
When creating a new test site, the directory name of the new test site should be added to <code>test/functional</code>.
</box>

### Using ESLint
Expand Down