From 538ff88fb78aa2e54bef930cea05e99ad63350fd Mon Sep 17 00:00:00 2001 From: tejas bhuwania Date: Mon, 17 Feb 2020 04:54:36 +0530 Subject: [PATCH 01/10] add _site to ignore list --- src/Site.js | 3 ++- src/constants.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Site.js b/src/Site.js index ba5c40f70b..5bc2f3b43c 100644 --- a/src/Site.js +++ b/src/Site.js @@ -52,6 +52,7 @@ const { SITE_ASSET_FOLDER_NAME, SITE_CONFIG_NAME, SITE_DATA_NAME, + SITE_FOLDER_NAME, TEMP_FOLDER_NAME, TEMPLATE_SITE_ASSET_FOLDER_NAME, USER_VARIABLES_PATH, @@ -427,7 +428,7 @@ class Site { globPages.concat(walkSync(this.rootPath, { directories: false, globs: [addressableGlob.glob], - ignore: [CONFIG_FOLDER_NAME], + ignore: [CONFIG_FOLDER_NAME, SITE_FOLDER_NAME], }).map(globPath => ({ src: globPath, searchable: addressableGlob.searchable, diff --git a/src/constants.js b/src/constants.js index 984667811b..276ec9fd29 100644 --- a/src/constants.js +++ b/src/constants.js @@ -39,6 +39,7 @@ module.exports = { CONFIG_FOLDER_NAME: '_markbind', HEADING_INDEXING_LEVEL_DEFAULT: 3, SITE_ASSET_FOLDER_NAME: 'asset', + SITE_FOLDER_NAME: '_site', TEMP_FOLDER_NAME: '.temp', TEMPLATE_SITE_ASSET_FOLDER_NAME: 'markbind', From 52e1afac3808880e8e4980e3ad886749907191ca Mon Sep 17 00:00:00 2001 From: tejas bhuwania Date: Mon, 17 Feb 2020 06:14:30 +0530 Subject: [PATCH 02/10] update highlighted text bg color --- docs/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/css/main.css b/docs/css/main.css index 8f21f99265..92caaa36ed 100644 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -1,5 +1,5 @@ mark { - background-color: rgba(255, 231, 2, 0.15); + background-color: #FFFF00; border-radius: 5px; padding-top: 0; padding-bottom: 0; From 8b81b5a9487d187058d5ecf43d9ae015cc533112 Mon Sep 17 00:00:00 2001 From: tejas bhuwania Date: Sat, 28 Mar 2020 06:10:18 +0800 Subject: [PATCH 03/10] add documentation --- docs/devGuide/devGuide.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index a21d4bb68a..c31f760830 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -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 @@ -175,12 +175,42 @@ On Windows: You should always check that the generated output is correct before committing any changes to the test sites. -##### New features +#### Adding site content 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. +1. Add a new test page, eg: newTestPage.md, containing a demonstration of the new feature. + +2. Open test\functional\test_site\site.json + +3. To include a new page, eg: newTestPage.md, add it to the pages array. + +``` {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] + }, + .... +``` + +4. Update the tests. + - When creating a new test site, the directory name of the new test site should be added to test/functional/test_sites. + When creating a new test site, the directory name of the new test site should be added to test/functional. ### Using ESLint From 0970ee1731e28a15ff6bb34955a028ea8b1c14f8 Mon Sep 17 00:00:00 2001 From: tejas bhuwania Date: Sat, 28 Mar 2020 06:19:36 +0800 Subject: [PATCH 04/10] Correct highlighting --- docs/devGuide/devGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index c31f760830..da1c34602b 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -179,11 +179,11 @@ On Windows: 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. -1. Add a new test page, eg: newTestPage.md, containing a demonstration of the new feature. +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 -3. To include a new page, eg: newTestPage.md, add it to the pages array. +3. To include a new page, e.g., `newTestPage.md`, add it to the pages array. ``` {heading="site.json" highlight-lines="16,17"} "pages": [ From eadc9ad9ff5b7d01be18fd97594c4ada7bb98e3e Mon Sep 17 00:00:00 2001 From: Tejas Bhuwania <35946746+Tejas2805@users.noreply.github.com> Date: Sat, 28 Mar 2020 17:41:33 +0800 Subject: [PATCH 05/10] Update docs/devGuide/devGuide.md Co-Authored-By: Yash Chowdhary --- docs/devGuide/devGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index da1c34602b..0556af8641 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -181,7 +181,7 @@ When adding new features, you should also add new site content into an existing 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 +2. Open `test/functional/test_site/site.json` 3. To include a new page, e.g., `newTestPage.md`, add it to the pages array. From 4d7bc65bfee0d311d9803842df13f2152171d3ec Mon Sep 17 00:00:00 2001 From: Tejas Bhuwania <35946746+Tejas2805@users.noreply.github.com> Date: Tue, 31 Mar 2020 20:43:05 +0800 Subject: [PATCH 06/10] Update docs/devGuide/devGuide.md Co-Authored-By: nbriannl --- docs/devGuide/devGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index 0556af8641..ff5b4b9330 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -183,7 +183,7 @@ When adding new features, you should also add new site content into an existing 2. Open `test/functional/test_site/site.json` -3. To include a new page, e.g., `newTestPage.md`, add it to the pages array. +3. To include the new page, i.e. `newTestPage.md`, add it to the `pages` array. ``` {heading="site.json" highlight-lines="16,17"} "pages": [ From b3fe7079122fe3fa4a8c38015fb950297b8fc991 Mon Sep 17 00:00:00 2001 From: Tejas Bhuwania <35946746+Tejas2805@users.noreply.github.com> Date: Tue, 31 Mar 2020 20:43:12 +0800 Subject: [PATCH 07/10] Update docs/devGuide/devGuide.md Co-Authored-By: nbriannl --- docs/devGuide/devGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index ff5b4b9330..dab2cb2f8a 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -175,7 +175,7 @@ On Windows: You should always check that the generated output is correct before committing any changes to the test sites. -#### Adding site content +#### Adding test site content 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. From 7a259268b75499a164e0674ab5ad1bfbdc395160 Mon Sep 17 00:00:00 2001 From: Tejas Bhuwania <35946746+Tejas2805@users.noreply.github.com> Date: Tue, 31 Mar 2020 20:43:26 +0800 Subject: [PATCH 08/10] Update docs/devGuide/devGuide.md Co-Authored-By: nbriannl --- docs/devGuide/devGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index dab2cb2f8a..2d983f7deb 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -181,7 +181,7 @@ When adding new features, you should also add new site content into an existing 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` +2. Open the `site.json` corresponding to the test site, i.e. `test/functional/test_site/site.json` 3. To include the new page, i.e. `newTestPage.md`, add it to the `pages` array. From 798122742c7cdb05bb5c2dc4736ce72aa627785e Mon Sep 17 00:00:00 2001 From: tejas bhuwania Date: Tue, 31 Mar 2020 20:47:34 +0800 Subject: [PATCH 09/10] update devGuide based on comments --- docs/devGuide/devGuide.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index 2d983f7deb..cc7995c818 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -179,6 +179,8 @@ On Windows: 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. +To add a page to an existing test site, for this example, to `test_site`: + 1. Add a new test page, e.g., `newTestPage.md`, containing a demonstration of the new feature. 2. Open the `site.json` corresponding to the test site, i.e. `test/functional/test_site/site.json` @@ -210,7 +212,7 @@ When adding new features, you should also add new site content into an existing 4. Update the tests. - When creating a new test site, the directory name of the new test site should be added to test/functional. + When creating a new test site, the directory name of the new test site should be added to test/functional/test_sites. ### Using ESLint From 87d0155b449173a9ba58c28d70a1087e943bd14f Mon Sep 17 00:00:00 2001 From: Tejas Bhuwania <35946746+Tejas2805@users.noreply.github.com> Date: Sat, 4 Apr 2020 23:08:47 +0800 Subject: [PATCH 10/10] Update devGuide.md --- docs/devGuide/devGuide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/devGuide/devGuide.md b/docs/devGuide/devGuide.md index cc7995c818..af7a8e8d50 100644 --- a/docs/devGuide/devGuide.md +++ b/docs/devGuide/devGuide.md @@ -206,13 +206,13 @@ To add a page to an existing test site, for this example, to `test_site`: "src": "newTestPage.md", "title": [some title you see fit] }, - .... + ... ``` -4. Update the tests. +4. Update the tests using `npm run updatetest`. - When creating a new test site, the directory name of the new test site should be added to test/functional/test_sites. + When creating a new test site, the directory name of the new test site should be added to `test/functional/test_sites` file. ### Using ESLint