From 4eb63a8259afcdab3743376e4b4431f08ce86b95 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sun, 3 Apr 2022 00:30:04 +0800 Subject: [PATCH 01/35] Working Archive + deploy command --- docs/_markbind/layouts/userGuide.md | 1 + packages/cli/index.js | 31 ++++++++++++++++++++++++++++- packages/core/src/Site/index.js | 24 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/_markbind/layouts/userGuide.md b/docs/_markbind/layouts/userGuide.md index a3ec5aab02..63882d5dba 100644 --- a/docs/_markbind/layouts/userGuide.md +++ b/docs/_markbind/layouts/userGuide.md @@ -30,6 +30,7 @@ * [Making the Site Searchable]({{baseUrl}}/userGuide/makingTheSiteSearchable.html) * [Applying Themes]({{baseUrl}}/userGuide/themes.html) * [Deploying the Site]({{baseUrl}}/userGuide/deployingTheSite.html) + * [Versioning]({{baseUrl}}/userGuide/versioning.html) * [MarkBind in the Project Workflow]({{baseUrl}}/userGuide/markBindInTheProjectWorkflow.html) * **References** :expanded: * [CLI Commands]({{baseUrl}}/userGuide/cliCommands.html) diff --git a/packages/cli/index.js b/packages/cli/index.js index 7558af938f..f99047c2f1 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -318,16 +318,45 @@ program .catch(handleError); }); +program + .command('archive [versionName] [archivePath]') + .alias('ar') + .description('archive a version of the site, which can continue to be accessed') + // .option('--baseUrl [baseUrl]', + // 'optional flag which overrides baseUrl in site.json, leave argument empty for empty baseUrl') + // .option('-vt, --version-tag ', + // 'archive the version under the given version tag e.g. latest, current, dev') + .action((versionName, userSpecifiedArchivePath, options) => { + // const baseUrl = _.isBoolean(options.baseUrl) ? '' : options.baseUrl; + if (!versionName) { + throw new Error('Please specify a name for the versioned site'); + } + const archivePath = userSpecifiedArchivePath || 'version'; + const rootFolder = path.resolve(process.cwd()); + const outputFolder = path.join(rootFolder, archivePath, versionName); + new Site(rootFolder, outputFolder, undefined, undefined, options.siteConfig) + .generate('') + .then(() => { + logger.info('Build success!'); + }) + .catch(handleError); + }); + program .command('deploy') .alias('d') .description('deploy the site to the repo\'s Github pages') .option('-c, --ci [githubTokenName]', 'deploy the site in CI Environment [GITHUB_TOKEN]') .option('-s, --site-config ', 'specify the site config file (default: site.json)') + .option('-v, --versions ', 'specify the path where versions are stored') .action((options) => { const rootFolder = path.resolve(process.cwd()); const outputRoot = path.join(rootFolder, '_site'); - new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig).deploy(options.ci) + const site = new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig); + if (options.versions) { + site.addVersions(path.join(rootFolder, options.versions)); + } + site.deploy(options.ci) .then(depUrl => (depUrl !== null ? logger.info( `The website has been deployed at: ${depUrl}`) : logger.info('Deployed!'))) diff --git a/packages/core/src/Site/index.js b/packages/core/src/Site/index.js index ea4fa21f63..0d64ec304d 100644 --- a/packages/core/src/Site/index.js +++ b/packages/core/src/Site/index.js @@ -1440,6 +1440,30 @@ class Site { return fs.copy(themeSrcPath, themeDestPath); } + async addVersions(versionFolder) { + try { + await fs.copy(versionFolder, '_site'); + logger.info('Pages copied'); + } catch (error) { + await Site.rejectHandler(error, [this.tempPath, this.outputPath]); + } + } + + /** + * Copy over previously built versioned files to the site folder + */ + async copyVersionedFiles(versionFolder) { + this.beforeSiteGenerate(); + logger.info('Copying over previous versions...'); + + try { + await fs.copy(versionFolder, '_site'); + logger.info('Pages copied'); + } catch (error) { + await Site.rejectHandler(error, [this.tempPath, this.outputPath]); + } + } + /** * Writes the site data to siteData.json * @param {boolean} verbose Flag to emit logs of the operation From e180361ffb295128d0796011af95e0e9efd3875f Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sun, 3 Apr 2022 02:15:38 +0800 Subject: [PATCH 02/35] Fix archived site links + streamline functions --- packages/cli/index.js | 11 ++++++----- packages/core/src/Site/index.js | 16 +++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index f99047c2f1..1fd39a0e09 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -329,13 +329,14 @@ program .action((versionName, userSpecifiedArchivePath, options) => { // const baseUrl = _.isBoolean(options.baseUrl) ? '' : options.baseUrl; if (!versionName) { - throw new Error('Please specify a name for the versioned site'); + throw new Error('Please specify a name for the version to be archived.'); } const archivePath = userSpecifiedArchivePath || 'version'; const rootFolder = path.resolve(process.cwd()); const outputFolder = path.join(rootFolder, archivePath, versionName); + const archivedBaseUrl = `/${archivePath}/${versionName}`; new Site(rootFolder, outputFolder, undefined, undefined, options.siteConfig) - .generate('') + .generate(archivedBaseUrl) .then(() => { logger.info('Build success!'); }) @@ -353,9 +354,9 @@ program const rootFolder = path.resolve(process.cwd()); const outputRoot = path.join(rootFolder, '_site'); const site = new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig); - if (options.versions) { - site.addVersions(path.join(rootFolder, options.versions)); - } + // if (options.versions) { // may be redundant; currently copies over files during build + // site.addVersions(path.join(rootFolder, options.versions)); + // } site.deploy(options.ci) .then(depUrl => (depUrl !== null ? logger.info( `The website has been deployed at: ${depUrl}`) diff --git a/packages/core/src/Site/index.js b/packages/core/src/Site/index.js index 0d64ec304d..b42ea9efcd 100644 --- a/packages/core/src/Site/index.js +++ b/packages/core/src/Site/index.js @@ -1440,9 +1440,13 @@ class Site { return fs.copy(themeSrcPath, themeDestPath); } + /** + * Copies over all versioned files from a given folder to be deployed. + * @param {path} versionFolder is the directory the versions are within + */ async addVersions(versionFolder) { try { - await fs.copy(versionFolder, '_site'); + await this.copyVersionedFiles(versionFolder); logger.info('Pages copied'); } catch (error) { await Site.rejectHandler(error, [this.tempPath, this.outputPath]); @@ -1450,18 +1454,12 @@ class Site { } /** - * Copy over previously built versioned files to the site folder + * Helper function to copy over previously built versioned files to the site folder */ async copyVersionedFiles(versionFolder) { this.beforeSiteGenerate(); logger.info('Copying over previous versions...'); - - try { - await fs.copy(versionFolder, '_site'); - logger.info('Pages copied'); - } catch (error) { - await Site.rejectHandler(error, [this.tempPath, this.outputPath]); - } + await fs.copy(versionFolder, '_site'); } /** From c22916097f0c9d70b344f9401411dad21a939470 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Mon, 4 Apr 2022 17:11:51 +0800 Subject: [PATCH 03/35] Fix URL bug --- packages/cli/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index 1fd39a0e09..27279b4965 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -17,6 +17,7 @@ const fsUtil = require('@markbind/core/src/utils/fsUtil'); const { INDEX_MARKDOWN_FILE, LAZY_LOADING_SITE_FILE_NAME, + SITE_CONFIG_NAME, } = require('@markbind/core/src/Site/constants'); const liveServer = require('./src/lib/live-server'); @@ -334,7 +335,9 @@ program const archivePath = userSpecifiedArchivePath || 'version'; const rootFolder = path.resolve(process.cwd()); const outputFolder = path.join(rootFolder, archivePath, versionName); - const archivedBaseUrl = `/${archivePath}/${versionName}`; + // assumes it is site.json at project root + const siteConfigJson = fs.readJsonSync(path.join(rootFolder, SITE_CONFIG_NAME)); + const archivedBaseUrl = `/${siteConfigJson.baseUrl}/${archivePath}/${versionName}`; new Site(rootFolder, outputFolder, undefined, undefined, options.siteConfig) .generate(archivedBaseUrl) .then(() => { From e64f91cdc12d3ffb4e45ed086cfb27bbe01a2c95 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 9 Apr 2022 13:40:31 +0800 Subject: [PATCH 04/35] clean up comments in cli file --- packages/cli/index.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index 27279b4965..fbbb33a0aa 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -20,6 +20,7 @@ const { SITE_CONFIG_NAME, } = require('@markbind/core/src/Site/constants'); +const { getSystemErrorMap } = require('util'); const liveServer = require('./src/lib/live-server'); const cliUtil = require('./src/util/cliUtil'); const logger = require('./src/util/logger'); @@ -323,25 +324,24 @@ program .command('archive [versionName] [archivePath]') .alias('ar') .description('archive a version of the site, which can continue to be accessed') - // .option('--baseUrl [baseUrl]', - // 'optional flag which overrides baseUrl in site.json, leave argument empty for empty baseUrl') - // .option('-vt, --version-tag ', - // 'archive the version under the given version tag e.g. latest, current, dev') .action((versionName, userSpecifiedArchivePath, options) => { - // const baseUrl = _.isBoolean(options.baseUrl) ? '' : options.baseUrl; if (!versionName) { throw new Error('Please specify a name for the version to be archived.'); } const archivePath = userSpecifiedArchivePath || 'version'; const rootFolder = path.resolve(process.cwd()); const outputFolder = path.join(rootFolder, archivePath, versionName); - // assumes it is site.json at project root + // We assume the site config file is site.json at project root const siteConfigJson = fs.readJsonSync(path.join(rootFolder, SITE_CONFIG_NAME)); - const archivedBaseUrl = `/${siteConfigJson.baseUrl}/${archivePath}/${versionName}`; + const siteConfigBaseUrl = siteConfigJson.baseUrl; + // const siteConfigArchiveFolders = siteConfigJson.archiveFolder; + const archivedBaseUrl = siteConfigBaseUrl === '' + ? `/${archivePath}/${versionName}` + : `/${siteConfigBaseUrl}/${archivePath}/${versionName}`; new Site(rootFolder, outputFolder, undefined, undefined, options.siteConfig) .generate(archivedBaseUrl) .then(() => { - logger.info('Build success!'); + logger.info('Archive success!'); }) .catch(handleError); }); @@ -357,9 +357,6 @@ program const rootFolder = path.resolve(process.cwd()); const outputRoot = path.join(rootFolder, '_site'); const site = new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig); - // if (options.versions) { // may be redundant; currently copies over files during build - // site.addVersions(path.join(rootFolder, options.versions)); - // } site.deploy(options.ci) .then(depUrl => (depUrl !== null ? logger.info( `The website has been deployed at: ${depUrl}`) From 778f3cba23212fa61d35e4c201aee6eaa1abfe36 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 9 Apr 2022 20:27:51 +0800 Subject: [PATCH 05/35] Exclude archived site from being archived with markbind archive --- packages/cli/index.js | 14 +-- packages/core/src/Site/constants.js | 1 + packages/core/src/Site/index.js | 137 +++++++++++++++++++++------- 3 files changed, 108 insertions(+), 44 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index fbbb33a0aa..fedce86aae 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -17,10 +17,8 @@ const fsUtil = require('@markbind/core/src/utils/fsUtil'); const { INDEX_MARKDOWN_FILE, LAZY_LOADING_SITE_FILE_NAME, - SITE_CONFIG_NAME, } = require('@markbind/core/src/Site/constants'); -const { getSystemErrorMap } = require('util'); const liveServer = require('./src/lib/live-server'); const cliUtil = require('./src/util/cliUtil'); const logger = require('./src/util/logger'); @@ -323,6 +321,7 @@ program program .command('archive [versionName] [archivePath]') .alias('ar') + .option('-s, --site-config ', 'specify the site config file (default: site.json)') .description('archive a version of the site, which can continue to be accessed') .action((versionName, userSpecifiedArchivePath, options) => { if (!versionName) { @@ -331,17 +330,10 @@ program const archivePath = userSpecifiedArchivePath || 'version'; const rootFolder = path.resolve(process.cwd()); const outputFolder = path.join(rootFolder, archivePath, versionName); - // We assume the site config file is site.json at project root - const siteConfigJson = fs.readJsonSync(path.join(rootFolder, SITE_CONFIG_NAME)); - const siteConfigBaseUrl = siteConfigJson.baseUrl; - // const siteConfigArchiveFolders = siteConfigJson.archiveFolder; - const archivedBaseUrl = siteConfigBaseUrl === '' - ? `/${archivePath}/${versionName}` - : `/${siteConfigBaseUrl}/${archivePath}/${versionName}`; new Site(rootFolder, outputFolder, undefined, undefined, options.siteConfig) - .generate(archivedBaseUrl) + .archive(versionName, archivePath) .then(() => { - logger.info('Archive success!'); + logger.info(`Successfully archived ${versionName} at ${archivePath}/${versionName}`); }) .catch(handleError); }); diff --git a/packages/core/src/Site/constants.js b/packages/core/src/Site/constants.js index dae7f1b0a4..a596cd82bc 100644 --- a/packages/core/src/Site/constants.js +++ b/packages/core/src/Site/constants.js @@ -12,6 +12,7 @@ module.exports = { PAGE_TEMPLATE_NAME: 'page.njk', SITE_CONFIG_NAME: 'site.json', SITE_DATA_NAME: 'siteData.json', + VERSIONS_DATA_NAME: 'versions.json', LAYOUT_SITE_FOLDER_NAME: 'layouts', LAZY_LOADING_SITE_FILE_NAME: 'LazyLiveReloadLoadingSite.html', LAZY_LOADING_BUILD_TIME_RECOMMENDATION_LIMIT: 30000, diff --git a/packages/core/src/Site/index.js b/packages/core/src/Site/index.js index b42ea9efcd..a1ec7374c8 100644 --- a/packages/core/src/Site/index.js +++ b/packages/core/src/Site/index.js @@ -64,6 +64,7 @@ const { PAGE_TEMPLATE_NAME, SITE_CONFIG_NAME, SITE_DATA_NAME, + VERSIONS_DATA_NAME, SITE_FOLDER_NAME, TEMP_FOLDER_NAME, TEMPLATE_SITE_ASSET_FOLDER_NAME, @@ -134,6 +135,12 @@ class Site { this.siteConfig = undefined; this.siteConfigPath = siteConfigPath; + /** + * Archived version information + * @type {undefined | SiteConfig} + */ + this.versionData = undefined; + // Site wide variable processor this.variableProcessor = undefined; @@ -652,17 +659,8 @@ class Site { try { await this.readSiteConfig(baseUrl); - this.collectAddressablePages(); - await this.collectBaseUrl(); - this.collectUserDefinedVariablesMap(); - await this.buildAssets(); - await (this.onePagePath ? this.lazyBuildSourceFiles() : this.buildSourceFiles()); - await this.copyCoreWebAsset(); - await this.copyBootstrapTheme(false); - await this.copyFontAwesomeAsset(); - await this.copyOcticonsAsset(); - await this.copyMaterialIconsAsset(); - await this.writeSiteData(); + await this.buildSiteHelper(); + this.calculateBuildTimeForGenerate(startTime, lazyWebsiteGenerationString); if (this.backgroundBuildMode) { this.backgroundBuildNotViewedFiles(); @@ -672,6 +670,23 @@ class Site { } } + /** + * Holds the work for generating a site. + */ + async buildSiteHelper() { + this.collectAddressablePages(); + await this.collectBaseUrl(); + this.collectUserDefinedVariablesMap(); + await this.buildAssets(); + await (this.onePagePath ? this.lazyBuildSourceFiles() : this.buildSourceFiles()); + await this.copyCoreWebAsset(); + await this.copyBootstrapTheme(false); + await this.copyFontAwesomeAsset(); + await this.copyOcticonsAsset(); + await this.copyMaterialIconsAsset(); + await this.writeSiteData(); + } + /** * Helper function for generate(). */ @@ -1440,28 +1455,6 @@ class Site { return fs.copy(themeSrcPath, themeDestPath); } - /** - * Copies over all versioned files from a given folder to be deployed. - * @param {path} versionFolder is the directory the versions are within - */ - async addVersions(versionFolder) { - try { - await this.copyVersionedFiles(versionFolder); - logger.info('Pages copied'); - } catch (error) { - await Site.rejectHandler(error, [this.tempPath, this.outputPath]); - } - } - - /** - * Helper function to copy over previously built versioned files to the site folder - */ - async copyVersionedFiles(versionFolder) { - this.beforeSiteGenerate(); - logger.info('Copying over previous versions...'); - await fs.copy(versionFolder, '_site'); - } - /** * Writes the site data to siteData.json * @param {boolean} verbose Flag to emit logs of the operation @@ -1489,6 +1482,84 @@ class Site { } } + /** + * Archive the current version of the site. + * + * @param {string} versionName the name of the version + * @param {string} archivePath the path to the folder to store the archives in + */ + async archive(versionName, archivePath) { + await this.readSiteConfig(); + + // Save version data + const versionPath = `${archivePath}/${versionName}`; + this.versionData = await this.writeVersionsFile(versionName, versionPath); + // Exclude versioned files from archiving. + const archiveFolders = this.versionData.versions; + archiveFolders.forEach((folder) => { + const filePath = `/${folder.output}/**`; + this.siteConfig.ignore.push(filePath); + }); + + // Used to get accurate intralinks within the archived site: + const archivedBaseUrl = this.siteConfig.baseUrl === '' + ? `/${versionPath}` + : `${this.siteConfig.baseUrl}/${versionPath}`; + this.siteConfig.baseUrl = archivedBaseUrl; + + // Create the .tmp folder for storing intermediate results. + fs.emptydirSync(this.tempPath); + // Clean the output folder; create it if not exist. + fs.emptydirSync(this.outputPath); + + try { + await this.buildSiteHelper(); + } catch (error) { + await Site.rejectHandler(error, [this.tempPath, this.outputPath]); + } + } + + /** + * If the versions.json file exists, update it with a new version. + * Otherwise, create a new versions file to store information about archived versions + * + * @param {boolean} verbose Flag to emit logs of the operation + * @returns Returns the json object of the current versions data. + */ + async writeVersionsFile(versionName, versionPath, verbose = true) { + const versionsPath = path.join(this.rootPath, VERSIONS_DATA_NAME); + const newVersionData = { + version_name: versionName, + build_ver: MARKBIND_VERSION, + output: versionPath, + }; + + try { + if (!fs.pathExistsSync(versionsPath)) { + // Initialize the versions.json file. + fs.outputJSONSync(versionsPath, { versions: [] }, { spaces: 2 }); + } + const versionsJson = fs.readJSONSync(versionsPath); + + // Add in or update this new version in the versions file. + const idx = versionsJson.versions.findIndex(vers => vers.output === newVersionData.output); + if (idx === -1) { + versionsJson.versions.push(newVersionData); + } else { + versionsJson.versions[idx] = newVersionData; + } + fs.writeJsonSync(versionsPath, versionsJson, { spaces: 2 }); + if (verbose) { + logger.info('versions.json file updated'); + } + + return versionsJson; + } catch (error) { + await Site.rejectHandler(error, [this.tempPath, this.outputPath]); + return null; + } + } + deploy(ciTokenVar) { const defaultDeployConfig = { branch: 'gh-pages', From 95298d400d2e7cc10173d117ad4baa09f81b3aa2 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 9 Apr 2022 21:12:18 +0800 Subject: [PATCH 06/35] Add documentation for the CLI command --- docs/userGuide/cliCommands.md | 34 ++++++++++++++++++++++++++++++++++ packages/cli/index.js | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/userGuide/cliCommands.md b/docs/userGuide/cliCommands.md index b8a6455557..e8b49ebea5 100644 --- a/docs/userGuide/cliCommands.md +++ b/docs/userGuide/cliCommands.md @@ -167,6 +167,40 @@ The caveat is that not building all pages during the initial process, or not reb
+### `archive` Command +
+ +**Format:** `markbind archive [options] [versionName] [archivePath]` + +**Alias:** `markbind ar` + +**Description:** Archives a version of the site, which is not affected by changing the current site. + +**Arguments:** +* `[versionName]`
+ The name of the version, and the folder which the generated HTML files and assets will be stored in.
+ {{ icon_example }} `version_1` + +* `[archivePath]`
+ All archived versions are stored in the folder archivePath/[versionName]. The default archivePath is `version`
+ {{ icon_example }} `custom_archive_path` + + + +**Options** :fas-cogs: + +* `-s `, `--site-config `
+ Specify the site config file (default: `site.json`)
+ {{ icon_example }} `-s otherSite.json` + +**{{ icon_examples }}** +* `markbind archive v1` - Stores the site in the directory `version/v1` (from the root) +* `markbind archive version_1 custom_archive_path` - Stores the site in the directory `custom_archive_path/version_1` (from the root) + +
+ +
+ ### `deploy` Command
diff --git a/packages/cli/index.js b/packages/cli/index.js index fedce86aae..a7fe164ed8 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -322,7 +322,7 @@ program .command('archive [versionName] [archivePath]') .alias('ar') .option('-s, --site-config ', 'specify the site config file (default: site.json)') - .description('archive a version of the site, which can continue to be accessed') + .description('archive a version of the site, which is not affected by later changes to the site') .action((versionName, userSpecifiedArchivePath, options) => { if (!versionName) { throw new Error('Please specify a name for the version to be archived.'); From 8eed90cce4b349108211f69f62326e397120a7e5 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 9 Apr 2022 22:00:48 +0800 Subject: [PATCH 07/35] Docs: Write Versioning Documentation --- docs/userGuide/cliCommands.md | 12 +++++-- docs/userGuide/deployingTheSite.md | 2 +- .../userGuide/markBindInTheProjectWorkflow.md | 2 +- docs/userGuide/versioning.md | 32 +++++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 docs/userGuide/versioning.md diff --git a/docs/userGuide/cliCommands.md b/docs/userGuide/cliCommands.md index e8b49ebea5..cc175c46a6 100644 --- a/docs/userGuide/cliCommands.md +++ b/docs/userGuide/cliCommands.md @@ -174,15 +174,23 @@ The caveat is that not building all pages during the initial process, or not reb **Alias:** `markbind ar` -**Description:** Archives a version of the site, which is not affected by changing the current site. +**Description:** Archives a version of the current site, which will not be affected by future changes to the site **Arguments:** + +
+ + +Warning: If the folder at `/` already exists, the contents will be overwritten and your previous files may be lost. Only do so if you need to replace all the archived files with the current site files. + +
+ * `[versionName]`
The name of the version, and the folder which the generated HTML files and assets will be stored in.
{{ icon_example }} `version_1` * `[archivePath]`
- All archived versions are stored in the folder archivePath/[versionName]. The default archivePath is `version`
+ All archived versions are stored in the folder `/`. The default archivePath is `version`
{{ icon_example }} `custom_archive_path` diff --git a/docs/userGuide/deployingTheSite.md b/docs/userGuide/deployingTheSite.md index b7a2af1dd5..3062503b93 100644 --- a/docs/userGuide/deployingTheSite.md +++ b/docs/userGuide/deployingTheSite.md @@ -517,4 +517,4 @@ For more information on Surge, you may refer to [Surge's docs](https://surge.sh/ {% from "njk/common.njk" import previous_next %} -{{ previous_next('themes', 'markBindInTheProjectWorkflow') }} +{{ previous_next('themes', 'versioning') }} diff --git a/docs/userGuide/markBindInTheProjectWorkflow.md b/docs/userGuide/markBindInTheProjectWorkflow.md index d8fc23958f..5782745bbc 100644 --- a/docs/userGuide/markBindInTheProjectWorkflow.md +++ b/docs/userGuide/markBindInTheProjectWorkflow.md @@ -66,4 +66,4 @@ To convert your existing project, follow these steps: {% from "njk/common.njk" import previous_next %} -{{ previous_next('deployingTheSite', '') }} +{{ previous_next('versioning', '') }} diff --git a/docs/userGuide/versioning.md b/docs/userGuide/versioning.md new file mode 100644 index 0000000000..c9a46356e0 --- /dev/null +++ b/docs/userGuide/versioning.md @@ -0,0 +1,32 @@ +{% set title = "Site Versioning" %} +{% set filename = "versioning" %} +{{ title }} + + + title: "User Guide: {{ title }}" + layout: userGuide.md + + + +[_User Guide → {{ title }}_]({{ filename }}.html) + + +# {{ title }} + +
+ +Site versioning is key for documentation use, and websites may want to keep past versions for archival purposes. MarkBind can help you easily archive your site. +
+ +## Archiving with a CLI command + +Markbind allows you to easily save a version of the site you've built to be hosted at the same site with a modified URL with a single CLI command. All intralinks within the archived site will point to the respective archived pages. By default, the archive folder is called `version`, but you may specify your own directory. + +For example, if your site's base url relative to your domain is 'my_site', and you archive a version named 'v1' in the default archive folder, then by navigating to the url `/my_site/version/v1/` you would have accessed the archived version of someFile. + +A `versions.json` file will be created to track the archived sites you have made, and to exclude the archived sites from being re-archived the next time you make a new version. Modify it with caution, as it may result in unnecessary files being included or necessary files being excluded. + + + +{% from "njk/common.njk" import previous_next %} +{{ previous_next('deployingTheSite', 'markBindInTheProjectWorkflow') }} \ No newline at end of file From 8453f7a880f0ca1103a243f3b78afb7c43a1cf46 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 9 Apr 2022 23:30:54 +0800 Subject: [PATCH 08/35] Fix Error logging --- packages/cli/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index a7fe164ed8..5b60b35fe2 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -325,7 +325,7 @@ program .description('archive a version of the site, which is not affected by later changes to the site') .action((versionName, userSpecifiedArchivePath, options) => { if (!versionName) { - throw new Error('Please specify a name for the version to be archived.'); + logger.error('Please specify a name for the archived version.'); } const archivePath = userSpecifiedArchivePath || 'version'; const rootFolder = path.resolve(process.cwd()); From 1ba8c91f1ea74a1759c8573ff7b5749a1737f7cc Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 16 Apr 2022 22:00:24 +0800 Subject: [PATCH 09/35] Revert changes to deploy --- packages/cli/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index 5b60b35fe2..52e2d798a5 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -344,12 +344,11 @@ program .description('deploy the site to the repo\'s Github pages') .option('-c, --ci [githubTokenName]', 'deploy the site in CI Environment [GITHUB_TOKEN]') .option('-s, --site-config ', 'specify the site config file (default: site.json)') - .option('-v, --versions ', 'specify the path where versions are stored') .action((options) => { const rootFolder = path.resolve(process.cwd()); const outputRoot = path.join(rootFolder, '_site'); - const site = new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig); - site.deploy(options.ci) + new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig) + .deploy(options.ci) .then(depUrl => (depUrl !== null ? logger.info( `The website has been deployed at: ${depUrl}`) : logger.info('Deployed!'))) From f113c2281db412c791c3d9f38cdd10f757d3e607 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 16 Apr 2022 22:00:51 +0800 Subject: [PATCH 10/35] Make changes according to Yongliang's suggestions * Documentation updates to versioning + cliCommands pages * Changing of the methods of storing data in versions.json --- docs/userGuide/cliCommands.md | 28 ++++++++++++++++++---------- docs/userGuide/versioning.md | 30 ++++++++++++++++++++++++++---- packages/core/src/Site/index.js | 21 +++++++++++---------- 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/docs/userGuide/cliCommands.md b/docs/userGuide/cliCommands.md index cc175c46a6..e2fdbbe53b 100644 --- a/docs/userGuide/cliCommands.md +++ b/docs/userGuide/cliCommands.md @@ -14,14 +14,15 @@ $ markbind --help Usage: markbind Options: - -V, --version output the version number - -h, --help output usage information + -V, --version output the version number + -h, --help output usage information Commands: - init|i [options] [root] init a markbind website project - serve|s [options] [root] build then serve a website from a directory - build|b [options] [root] [output] build a website - deploy|d [options] deploy the site to the repo's Github pages + init|i [options] [root] init a markbind website project + serve|s [options] [root] build then serve a website from a directory + build|b [options] [root] [output] build a website + archive|ar [options] [versionName] [archivePath] archive the current version of the site + deploy|d [options] deploy the site to the repo's Github pages ```
@@ -174,7 +175,11 @@ The caveat is that not building all pages during the initial process, or not reb **Alias:** `markbind ar` -**Description:** Archives a version of the current site, which will not be affected by future changes to the site +**Description:** Does the following steps: + +1. Builds the current site, ignoring previously archived versions. +1. Updates or creates a `versions.json` file to track the newly archived version. +1. Puts the generated files in a folder of the specified name in the specified place. **Arguments:** @@ -187,7 +192,7 @@ Warning: If the folder at `/` already exists, the cont * `[versionName]`
The name of the version, and the folder which the generated HTML files and assets will be stored in.
- {{ icon_example }} `version_1` + {{ icon_example }} `v1`, `v1.1.1`, `sem1-2022` * `[archivePath]`
All archived versions are stored in the folder `/`. The default archivePath is `version`
@@ -202,8 +207,11 @@ Warning: If the folder at `/` already exists, the cont {{ icon_example }} `-s otherSite.json` **{{ icon_examples }}** -* `markbind archive v1` - Stores the site in the directory `version/v1` (from the root) -* `markbind archive version_1 custom_archive_path` - Stores the site in the directory `custom_archive_path/version_1` (from the root) + +* `markbind archive v1`: Stores the site in the directory `version/v1` (from the root) +* `markbind archive version_1 custom_archive_path`: Stores the site in the directory `./custom_archive_path/version_1` + +%%{{ icon_info }} Related: [User Guide: Site Versioning](versioning.md).%% diff --git a/docs/userGuide/versioning.md b/docs/userGuide/versioning.md index c9a46356e0..accd4c72c4 100644 --- a/docs/userGuide/versioning.md +++ b/docs/userGuide/versioning.md @@ -20,13 +20,35 @@ Site versioning is key for documentation use, and websites may want to keep past ## Archiving with a CLI command -Markbind allows you to easily save a version of the site you've built to be hosted at the same site with a modified URL with a single CLI command. All intralinks within the archived site will point to the respective archived pages. By default, the archive folder is called `version`, but you may specify your own directory. +Markbind allows you to easily save a version of the site you've built to be hosted at the same site with a modified URL with a [single CLI command](cliCommands.md#archive-command). All intralinks within the archived site will point to the respective archived pages. By default, the archive folder is called `version`, but you may specify your own directory. -For example, if your site's base url relative to your domain is 'my_site', and you archive a version named 'v1' in the default archive folder, then by navigating to the url `/my_site/version/v1/` you would have accessed the archived version of someFile. +For example, if your site's base URL relative to your domain is `my_site`, and you archive a version named `v1` in the default archive folder, then by navigating to the URL `/my_site/version/v1/` you would have accessed the archived version of `someFile`. A `versions.json` file will be created to track the archived sites you have made, and to exclude the archived sites from being re-archived the next time you make a new version. Modify it with caution, as it may result in unnecessary files being included or necessary files being excluded. - +```json {heading="Example of a versions.json file"} +{ + "versions": [ + { + "version_name": "v1", + "build_ver": "3.1.1", + "output": "v1" + }, + { + "version_name": "v2", + "build_ver": "3.1.1", + "output": "v2" + }, + { + "version_name": "v3", + "build_ver": "3.1.1", + "output": "v3" + } + ] +} +``` + + {% from "njk/common.njk" import previous_next %} -{{ previous_next('deployingTheSite', 'markBindInTheProjectWorkflow') }} \ No newline at end of file +{{ previous_next('deployingTheSite', 'markBindInTheProjectWorkflow') }} diff --git a/packages/core/src/Site/index.js b/packages/core/src/Site/index.js index a1ec7374c8..877a1cef86 100644 --- a/packages/core/src/Site/index.js +++ b/packages/core/src/Site/index.js @@ -1492,19 +1492,19 @@ class Site { await this.readSiteConfig(); // Save version data - const versionPath = `${archivePath}/${versionName}`; - this.versionData = await this.writeVersionsFile(versionName, versionPath); + this.versionData = await this.writeVersionsFile(versionName, archivePath); // Exclude versioned files from archiving. const archiveFolders = this.versionData.versions; archiveFolders.forEach((folder) => { - const filePath = `/${folder.output}/**`; + const filePath = `/${folder.archivePath}/${folder.versionName}**`; this.siteConfig.ignore.push(filePath); }); // Used to get accurate intralinks within the archived site: + const versionPath = `/${archivePath}/${versionName}`; const archivedBaseUrl = this.siteConfig.baseUrl === '' - ? `/${versionPath}` - : `${this.siteConfig.baseUrl}/${versionPath}`; + ? versionPath + : `${this.siteConfig.baseUrl}${versionPath}`; this.siteConfig.baseUrl = archivedBaseUrl; // Create the .tmp folder for storing intermediate results. @@ -1526,12 +1526,12 @@ class Site { * @param {boolean} verbose Flag to emit logs of the operation * @returns Returns the json object of the current versions data. */ - async writeVersionsFile(versionName, versionPath, verbose = true) { + async writeVersionsFile(versionName, archivePath, verbose = true) { const versionsPath = path.join(this.rootPath, VERSIONS_DATA_NAME); const newVersionData = { - version_name: versionName, - build_ver: MARKBIND_VERSION, - output: versionPath, + versionName, + buildVer: MARKBIND_VERSION, + archivePath, }; try { @@ -1542,7 +1542,8 @@ class Site { const versionsJson = fs.readJSONSync(versionsPath); // Add in or update this new version in the versions file. - const idx = versionsJson.versions.findIndex(vers => vers.output === newVersionData.output); + const idx = versionsJson.versions.findIndex(vers => vers.archivePath === newVersionData.archivePath + && vers.versionName === newVersionData.versionName); if (idx === -1) { versionsJson.versions.push(newVersionData); } else { From 0769bc71a05afc9a1fdbea43ef1e4ae97bc53a12 Mon Sep 17 00:00:00 2001 From: Hannah Chia Date: Sat, 16 Apr 2022 22:02:35 +0800 Subject: [PATCH 11/35] Merge in master branch changes --- .github/ISSUE_TEMPLATE/bug-report.yml | 11 +- .github/ISSUE_TEMPLATE/feature-request.yml | 11 +- .github/workflows/ci.yml | 16 +- docs/_markbind/layouts/devGuide.md | 6 +- docs/_markbind/layouts/userGuide.md | 2 +- docs/_markbind/variables.md | 4 +- docs/devGuide/design/projectStructure.md | 2 +- docs/devGuide/githubActions/markbindAction.md | 50 + docs/devGuide/githubActions/overview.md | 22 + docs/devGuide/workflow.md | 20 +- docs/devGuide/writingComponents.md | 154 ++++ docs/images/bootswatch/zephyr.png | Bin 0 -> 14971 bytes docs/njk/common.njk | 4 +- docs/userGuide/deployingTheSite.md | 21 + docs/userGuide/markBindSyntaxOverview.md | 2 +- docs/userGuide/syntax/badges.md | 58 +- docs/userGuide/syntax/dates.md | 17 +- docs/userGuide/syntax/diagrams.md | 16 +- docs/userGuide/syntax/dropdowns.md | 2 +- docs/userGuide/syntax/embeds.md | 8 +- docs/userGuide/syntax/lists.md | 2 +- docs/userGuide/syntax/modals.md | 6 +- docs/userGuide/syntax/searchBars.md | 8 +- docs/userGuide/themes.md | 3 +- docs/userGuide/tipsAndTricks.md | 10 +- docs/userGuide/tweakingThePageStructure.md | 2 +- docs/userGuide/usingHtmlJavaScriptCss.md | 87 ++ package-lock.json | 230 ++--- .../test_site/_markbind/layouts/default.md | 2 +- .../test_site/expected/bugs/index.html | 3 +- .../expected/bugs/index.page-vue-render.js | 2 +- .../functional/test_site/expected/index.html | 5 +- .../expected/index.page-vue-render.js | 2 +- .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../test_site/expected/sub_site/index.html | 3 +- .../sub_site/index.page-vue-render.js | 2 +- .../sub_site/nested_sub_site/index.html | 3 +- .../nested_sub_site/index.page-vue-render.js | 2 +- .../testNunjucksPathResolving.html | 3 +- ...stNunjucksPathResolving.page-vue-render.js | 2 +- .../sub_site/testNunjucksPathResolving.html | 3 +- ...stNunjucksPathResolving.page-vue-render.js | 2 +- .../expected/testAnchorGeneration.html | 3 +- .../testAnchorGeneration.page-vue-render.js | 2 +- .../expected/testAntiFOUCStyles.html | 3 +- .../testAntiFOUCStyles.page-vue-render.js | 2 +- .../test_site/expected/testCenterText.html | 3 +- .../testCenterText.page-vue-render.js | 2 +- .../test_site/expected/testCodeBlocks.html | 3 +- .../testCodeBlocks.page-vue-render.js | 2 +- .../test_site/expected/testDates.html | 3 +- .../expected/testDates.page-vue-render.js | 2 +- .../expected/testEmptyFrontmatter.html | 3 +- .../testEmptyFrontmatter.page-vue-render.js | 2 +- .../expected/testExternalScripts.html | 3 +- .../testExternalScripts.page-vue-render.js | 2 +- .../functional/test_site/expected/testHr.html | 3 +- .../expected/testHr.page-vue-render.js | 2 +- .../expected/testIncludeBoilerplate.html | 3 +- .../testIncludeBoilerplate.page-vue-render.js | 2 +- .../expected/testIncludeMultipleModals.html | 3 +- ...stIncludeMultipleModals.page-vue-render.js | 2 +- .../expected/testIncludePluginsRendered.html | 3 +- ...tIncludePluginsRendered.page-vue-render.js | 2 +- .../test_site/expected/testLayouts.html | 3 +- .../expected/testLayouts.page-vue-render.js | 2 +- .../expected/testLayoutsOverride.html | 3 +- .../testLayoutsOverride.page-vue-render.js | 2 +- .../test_site/expected/testLinks.html | 5 +- .../expected/testLinks.page-vue-render.js | 4 +- .../test_site/expected/testMath.html | 3 +- .../expected/testMath.page-vue-render.js | 2 +- .../test_site/expected/testModals.html | 3 +- .../expected/testModals.page-vue-render.js | 2 +- .../expected/testNunjucksPathResolving.html | 3 +- ...stNunjucksPathResolving.page-vue-render.js | 2 +- .../test_site/expected/testPageNav.html | 5 +- .../expected/testPageNav.page-vue-render.js | 2 +- .../expected/testPanelMarkdownParsing.html | 3 +- ...estPanelMarkdownParsing.page-vue-render.js | 2 +- .../test_site/expected/testPlantUML.html | 3 +- .../expected/testPlantUML.page-vue-render.js | 2 +- .../expected/testPopoverTrigger.html | 3 +- .../testPopoverTrigger.page-vue-render.js | 2 +- .../test_site/expected/testPopovers.html | 3 +- .../expected/testPopovers.page-vue-render.js | 2 +- .../test_site/expected/testThumbnails.html | 3 +- .../testThumbnails.page-vue-render.js | 2 +- .../expected/testTooltipSpacing.html | 3 +- .../testTooltipSpacing.page-vue-render.js | 2 +- .../test_site/expected/testTree.html | 3 +- .../expected/testTree.page-vue-render.js | 2 +- .../expected/testVariableContainsInclude.html | 3 +- ...VariableContainsInclude.page-vue-render.js | 2 +- .../test_site/expected/test_md_fragment.html | 3 +- .../test_md_fragment.page-vue-render.js | 2 +- .../expected/index.html | 1 - .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../test_basic_convert/expected/Home.html | 3 +- .../expected/Home.page-vue-render.js | 2 +- .../test_basic_convert/expected/Page-1.html | 3 +- .../expected/Page-1.page-vue-render.js | 2 +- .../test_basic_convert/expected/_Footer.html | 3 +- .../expected/_Footer.page-vue-render.js | 2 +- .../test_basic_convert/expected/_Sidebar.html | 3 +- .../expected/_Sidebar.page-vue-render.js | 2 +- .../test_basic_convert/expected/about.html | 3 +- .../expected/about.page-vue-render.js | 2 +- .../expected/contents/topic1.html | 3 +- .../contents/topic1.page-vue-render.js | 2 +- .../expected/contents/topic2.html | 3 +- .../contents/topic2.page-vue-render.js | 2 +- .../expected/contents/topic3a.html | 3 +- .../contents/topic3a.page-vue-render.js | 2 +- .../expected/contents/topic3b.html | 3 +- .../contents/topic3b.page-vue-render.js | 2 +- .../test_basic_convert/expected/index.html | 3 +- .../expected/index.page-vue-render.js | 2 +- .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../expected/Home.html | 3 +- .../expected/Home.page-vue-render.js | 2 +- .../expected/Page-1.html | 3 +- .../expected/Page-1.page-vue-render.js | 2 +- .../expected/README.html | 3 +- .../expected/README.page-vue-render.js | 2 +- .../expected/about.html | 3 +- .../expected/about.page-vue-render.js | 2 +- .../expected/contents/topic1.html | 3 +- .../contents/topic1.page-vue-render.js | 2 +- .../expected/contents/topic2.html | 3 +- .../contents/topic2.page-vue-render.js | 2 +- .../expected/contents/topic3a.html | 3 +- .../contents/topic3a.page-vue-render.js | 2 +- .../expected/contents/topic3b.html | 3 +- .../contents/topic3b.page-vue-render.js | 2 +- .../expected/index.html | 3 +- .../expected/index.page-vue-render.js | 2 +- .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../expected/test_folder/extra_1.html | 3 +- .../test_folder/extra_1.page-vue-render.js | 2 +- .../expected/test_folder/extra_2.html | 3 +- .../test_folder/extra_2.page-vue-render.js | 2 +- .../expected/test_folder/extra_3.html | 3 +- .../test_folder/extra_3.page-vue-render.js | 2 +- .../expected/index.html | 1 - .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../expected/contents/topic1.html | 3 +- .../contents/topic1.page-vue-render.js | 2 +- .../expected/contents/topic2.html | 3 +- .../contents/topic2.page-vue-render.js | 2 +- .../expected/contents/topic3a.html | 3 +- .../contents/topic3a.page-vue-render.js | 2 +- .../expected/contents/topic3b.html | 3 +- .../contents/topic3b.page-vue-render.js | 2 +- .../test_default/expected/index.html | 9 +- .../expected/index.page-vue-render.js | 4 +- .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../test_minimal/expected/index.html | 1 - .../markbind/css/bootstrap-vue.min.css | 4 - .../expected/markbind/css/bootstrap.min.css | 12 +- .../markbind/css/bootstrap.min.css.map | 2 +- .../markbind/js/bootstrap-utility.min.js | 10 +- .../core-web/asset/css/bootstrap-vue.min.css | 4 - packages/core-web/asset/css/bootstrap.min.css | 12 +- .../core-web/asset/css/bootstrap.min.css.map | 2 +- .../asset/js/bootstrap-utility.min.js | 10 +- packages/core-web/package.json | 1 - packages/core-web/src/styles/markbind.css | 9 + packages/core/package.json | 2 +- packages/core/src/Page/page.njk | 3 +- packages/core/src/Site/index.js | 3 +- packages/core/src/Site/siteConvertLayout.njk | 2 +- packages/core/src/html/MdAttributeRenderer.js | 34 +- packages/core/src/html/SiteLinkManager.js | 4 + .../core/src/html/includePanelProcessor.js | 16 +- packages/core/src/html/linkProcessor.js | 19 +- packages/core/src/utils/fsUtil.js | 5 +- .../default/_markbind/layouts/default.md | 2 +- packages/core/template/default/index.md | 4 +- .../test/unit/html/SiteLinkManager.test.js | 20 + .../core/test/unit/html/linkProcessor.test.js | 37 + packages/core/test/unit/utils/data.js | 2 - packages/vue-components/README.md | 15 +- packages/vue-components/package.json | 3 +- packages/vue-components/src/Dropdown.vue | 35 +- packages/vue-components/src/Modal.vue | 3 +- packages/vue-components/src/Navbar.vue | 25 +- packages/vue-components/src/Popover.vue | 71 +- packages/vue-components/src/Searchbar.vue | 19 +- packages/vue-components/src/Submenu.vue | 39 +- packages/vue-components/src/TipBox.vue | 20 +- packages/vue-components/src/Tooltip.vue | 48 +- packages/vue-components/src/Trigger.vue | 62 +- .../src/__tests__/Popover.spec.js | 104 +++ .../src/__tests__/Tooltip.spec.js | 60 ++ .../__snapshots__/Dropdown.spec.js.snap | 21 +- .../__snapshots__/Modal.spec.js.snap | 60 +- .../__snapshots__/Navbar.spec.js.snap | 16 +- .../__snapshots__/Popover.spec.js.snap | 115 +++ .../__snapshots__/Questions.spec.js.snap | 854 ++++++++++-------- .../__tests__/__snapshots__/Quiz.spec.js.snap | 296 +++--- .../__snapshots__/TipBox.spec.js.snap | 12 +- .../__snapshots__/Tooltip.spec.js.snap | 66 ++ packages/vue-components/src/index.js | 11 +- .../vue-components/src/questions/QOption.vue | 45 +- .../vue-components/src/questions/Question.vue | 14 +- 224 files changed, 2129 insertions(+), 1367 deletions(-) create mode 100644 docs/devGuide/githubActions/markbindAction.md create mode 100644 docs/devGuide/githubActions/overview.md create mode 100644 docs/devGuide/writingComponents.md create mode 100644 docs/images/bootswatch/zephyr.png delete mode 100644 packages/cli/test/functional/test_site/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/cli/test/functional/test_site_algolia_plugin/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/cli/test/functional/test_site_convert/test_basic_convert/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/cli/test/functional/test_site_special_tags/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/cli/test/functional/test_site_templates/test_default/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/cli/test/functional/test_site_templates/test_minimal/expected/markbind/css/bootstrap-vue.min.css delete mode 100644 packages/core-web/asset/css/bootstrap-vue.min.css create mode 100644 packages/vue-components/src/__tests__/Popover.spec.js create mode 100644 packages/vue-components/src/__tests__/Tooltip.spec.js create mode 100644 packages/vue-components/src/__tests__/__snapshots__/Popover.spec.js.snap create mode 100644 packages/vue-components/src/__tests__/__snapshots__/Tooltip.spec.js.snap diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 3cbadb0353..24b32ccd06 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -2,13 +2,16 @@ name: Bug Report description: File a bug report labels: ["c.Bug 🐛"] body: -- type: checkboxes +- type: dropdown + id: existing attributes: - label: Is there an existing issue for this? + label: Please confirm that you have searched existing issues in the repo description: Please search to see if an issue already exists for the bug you encountered. options: - - label: I have searched the existing issues - required: true + - 'Yes, I have searched the existing issues' + - 'No' + validations: + required: true - type: input id: related attributes: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 0654d41b28..11466582b6 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -2,13 +2,16 @@ name: Feature request description: Suggest a new idea/feature for MarkBind labels: ["c.Feature 🚀"] body: -- type: checkboxes +- type: dropdown + id: existing attributes: - label: Is there an existing issue for this? + label: Please confirm that you have searched existing issues in the repo description: Please search to see if an issue already exists for the request. options: - - label: I have searched the existing issues - required: true + - 'Yes, I have searched the existing issues' + - 'No' + validations: + required: true - type: input id: related attributes: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2cdee6ea2..6f93870e42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,6 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+' pull_request: - branches: - - master concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -25,6 +23,13 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '12' + - name: Install Graphviz + uses: tlylt/install-graphviz@v1 + - name: Install Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' - run: npm i -g npm@8.3.1 - run: npm run setup - run: npm run test @@ -41,6 +46,13 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '12' + - name: Install Graphviz + uses: tlylt/install-graphviz@v1 + - name: Install Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' - run: npm i -g npm@8.3.1 - run: npm run setup - name: Deploy DG on any commit to master, to markbind.org/devdocs diff --git a/docs/_markbind/layouts/devGuide.md b/docs/_markbind/layouts/devGuide.md index 6412945cdf..7db67eb5b9 100644 --- a/docs/_markbind/layouts/devGuide.md +++ b/docs/_markbind/layouts/devGuide.md @@ -3,7 +3,7 @@