Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jingting1412 committed Apr 8, 2024
2 parents e3438a9 + 8ad1b0c commit f3ded34
Show file tree
Hide file tree
Showing 133 changed files with 1,242 additions and 530 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ packages/core/src/Site/*.js
packages/core/src/utils/*.js
packages/core/src/variables/*.js
packages/core/test/unit/**/*.js
packages/core/index.js

# Rules for pure JS files
packages/core/src/lib/markdown-it/patches/*
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ packages/cli/test/functional/test_site/expected/diagrams/sequence.png
packages/cli/test/functional/test_site/expected/diagrams/state.png
packages/cli/test/functional/test_site/expected/diagrams/usecase.png
packages/cli/test/functional/test_site/expected/sub_site/inline-output/inline-puml-image.png
packages/cli/test/functional/test_site_templates/test_project/expected/diagrams/example.png

# vscode configuration
.vscode/
Expand Down Expand Up @@ -89,5 +90,6 @@ packages/core/src/Site/*.js
packages/core/src/utils/*.js
packages/core/src/variables/*.js
packages/core/test/unit/**/*.js
packages/core/index.js

# --- packages/core end ---
2 changes: 1 addition & 1 deletion docs/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
2 changes: 1 addition & 1 deletion docs/devGuide/development/settingUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This page explains how to set up your development environment to start contribut

<box type="tip" seamless>

We recommend the **WebStorm IDE** for working with MarkBind code.
We recommend the **WebStorm IDE** or **VS Code** for working with MarkBind code.
</box>

## Setting up the dev environment
Expand Down
2 changes: 1 addition & 1 deletion docs/devGuide/projectManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,4 @@ Note that:
* Result: 'tlylt' will be updated to have both icons(code and doc)

{% from "njk/common.njk" import previous_next %}
{{ previous_next('githubActions/markbindReusableWorkflows', 'styleGuides') }}
{{ previous_next('githubActions/markbindReusableWorkflows', 'styleGuides') }}
27 changes: 27 additions & 0 deletions docs/userGuide/syntax/lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ Markdown can also be used in texts.
You may need to add escape characters when using special characters for Markdown in text.
</box>

**You can add an icon or text that only applies to a specific item by using the `once` attribute.**

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code">
* Item 1 { icon="glyphicon-education" }
* Item 2 { icon="fas-code-branch" once=true }
* Item 2.1
* Item 2.2
* Item 3
</variable>
</include>

Subsequent items at the same level will not inherit icons or texts with the `once` attribute and will instead inherit the icons or texts before it.

The `once` attribute also applies to all other attributes such as `i-size` and `t-size` as seen below.

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code">
* Item 1 { icon="glyphicon-education" i-size="40px" i-class="text-primary" }
* Item 2 { i-size="25px" once=true }
* Sub-item 2.1
* Item 3
</variable>
</include>

**You can adjust the icon and text's size by using the `i-size` and `t-size` attribute respectively.**

<include src="codeAndOutput.md" boilerplate >
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmd/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');

const { Site } = require('@markbind/core').Site;
const { Site } = require('@markbind/core');

const cliUtil = require('../util/cliUtil');
const logger = require('../util/logger');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmd/deploy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');

const { Site } = require('@markbind/core').Site;
const { Site } = require('@markbind/core');

const cliUtil = require('../util/cliUtil');
const logger = require('../util/logger');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmd/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const chokidar = require('chokidar');
const path = require('path');
const readline = require('readline');

const { Site } = require('@markbind/core').Site;
const { Site } = require('@markbind/core');
const { pageVueServerRenderer } = require('@markbind/core/src/Page/PageVueServerRenderer');

const fsUtil = require('@markbind/core/src/utils/fsUtil');
Expand Down
27 changes: 17 additions & 10 deletions packages/cli/test/functional/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const {
testSites,
testConvertSites,
testTemplateSites,
plantumlGeneratedFiles,
plantumlGeneratedFilesForTestSites,
plantumlGeneratedFilesForConvertSites,
plantumlGeneratedFilesForTemplateSites,
} = require('./testSites');

/* eslint-disable no-console */
Expand All @@ -31,38 +33,43 @@ testSites.forEach((siteName) => {
console.log(`Running ${siteName} tests`);
try {
execSync(`node ../../index.js build ${siteName}`, execOptions);
compare(siteName, 'expected', '_site', siteName === 'test_site' ? plantumlGeneratedFiles : []);
const siteIgnoredFiles = plantumlGeneratedFilesForTestSites[siteName];
compare(siteName, 'expected', '_site', siteIgnoredFiles);
} catch (err) {
printFailedMessage(err, siteName);
process.exit(1);
}
});

testConvertSites.forEach((siteName) => {
console.log(`Running ${siteName} tests`);
const nonMarkBindSitePath = path.join(siteName, 'non_markbind_site');
testConvertSites.forEach((sitePath) => {
console.log(`Running ${sitePath} tests`);
const nonMarkBindSitePath = path.join(sitePath, 'non_markbind_site');
const siteName = sitePath.split('/')[1];
try {
execSync(`node ../../index.js init ${nonMarkBindSitePath} -c`, execOptions);
execSync(`node ../../index.js build ${nonMarkBindSitePath}`, execOptions);
compare(siteName, 'expected', 'non_markbind_site/_site');
const siteIgnoredFiles = plantumlGeneratedFilesForConvertSites[siteName];
compare(sitePath, 'expected', 'non_markbind_site/_site', siteIgnoredFiles);
} catch (err) {
printFailedMessage(err, siteName);
cleanupConvert(path.resolve(__dirname, siteName));
printFailedMessage(err, sitePath);
cleanupConvert(path.resolve(__dirname, sitePath));
process.exit(1);
}
cleanupConvert(path.resolve(__dirname, siteName));
cleanupConvert(path.resolve(__dirname, sitePath));
});

testTemplateSites.forEach((templateAndSitePath) => {
const flag = templateAndSitePath.split(',')[0];
const sitePath = templateAndSitePath.split(',')[1];
const siteCreationTempPath = path.join(sitePath, 'tmp');
const siteName = sitePath.split('/')[1];

console.log(`Running ${sitePath} tests`);
try {
execSync(`node ../../index.js init ${siteCreationTempPath} --template ${flag}`, execOptions);
execSync(`node ../../index.js build ${siteCreationTempPath}`, execOptions);
compare(sitePath, 'expected', 'tmp/_site');
const siteIgnoredFiles = plantumlGeneratedFilesForTemplateSites[siteName];
compare(sitePath, 'expected', 'tmp/_site', siteIgnoredFiles);
} catch (err) {
printFailedMessage(err, sitePath);
fs.removeSync(path.resolve(__dirname, siteCreationTempPath));
Expand Down
36 changes: 23 additions & 13 deletions packages/cli/test/functional/testSites.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,32 @@ const testTemplateSites = [
// these files create git diffs every time they are generated,
// we decided to not commit them to the repository.
// However, we still want to verify that they are present.
const plantumlGeneratedFiles = [
'9c9e77fc0a983cb6b592e65733787bec.png',
'inline-output.png',
'diagrams/activity.png',
'diagrams/class.png',
'diagrams/component.png',
'diagrams/object.png',
'diagrams/sequence.png',
'diagrams/state.png',
'diagrams/usecase.png',
'sub_site/inline-output/inline-puml-image.png',
];
const plantumlGeneratedFilesForTestSites = {
test_site: [
'9c9e77fc0a983cb6b592e65733787bec.png',
'inline-output.png',
'diagrams/activity.png',
'diagrams/class.png',
'diagrams/component.png',
'diagrams/object.png',
'diagrams/sequence.png',
'diagrams/state.png',
'diagrams/usecase.png',
'sub_site/inline-output/inline-puml-image.png',
],
};

const plantumlGeneratedFilesForConvertSites = {};

const plantumlGeneratedFilesForTemplateSites = {
test_project: ['diagrams/example.png'],
};

module.exports = {
testSites,
testConvertSites,
testTemplateSites,
plantumlGeneratedFiles,
plantumlGeneratedFilesForTestSites,
plantumlGeneratedFilesForConvertSites,
plantumlGeneratedFilesForTemplateSites,
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="index.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="index.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/test/functional/test_site/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="index.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="index.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="index.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="index.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="index.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="index.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testNunjucksPathResolving.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testNunjucksPathResolving.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testNunjucksPathResolving.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testNunjucksPathResolving.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testAltFrontMatterInvalidKeyValue.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testAltFrontMatterInvalidKeyValue.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testAltFrontMatterParsing.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testAltFrontMatterParsing.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testAnchorGeneration.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testAnchorGeneration.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testAnnotate.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testAnnotate.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<link rel="stylesheet" href="/test_site/markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/codeblock-dark.min.css">
<link rel="stylesheet" href="/test_site/markbind/css/markbind.min.css">
<script src="/test_site/markbind/js/polyfill.min.js"></script>
<script src="/test_site/markbind/js/vue.min.js"></script>
<script src="/test_site/markbind/js/markbind.min.js"></script>
<script src="testAntiFOUCStyles.page-vue-render.js"></script>
<script src="/test_site/markbind/js/polyfill.min.js" defer></script>
<script src="/test_site/markbind/js/vue.min.js" defer></script>
<script src="/test_site/markbind/js/markbind.min.js" defer></script>
<script src="testAntiFOUCStyles.page-vue-render.js" defer></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/web3Form/web-3-form.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
Expand Down
Loading

0 comments on commit f3ded34

Please sign in to comment.