diff --git a/.travis.yml b/.travis.yml index aa49365080..c94dcf0b9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,20 @@ language: node_js node_js: - '8' deploy: - provider: script - script: cd docs && ../index.js build && ../index.js deploy --travis - skip_cleanup: true - on: - repo: MarkBind/markbind - tags: true - condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+ + # deploy on release, to markbind.org + - provider: script + script: cd docs && ../index.js build -s ug-site.json && ../index.js deploy -s ug-site.json --travis + skip_cleanup: true + on: + repo: MarkBind/markbind + tags: true + condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+ + # deploy on any commit to master, to markbind.org/devdocs + - provider: script + script: cd docs && ../index.js build -s dg-site.json && ../index.js deploy -s dg-site.json --travis + skip_cleanup: true + on: + repo: MarkBind/markbind cache: directories: - node_modules diff --git a/docs/_markbind/headers/header.md b/docs/_markbind/headers/header.md index d5f4921b96..b2ab23586e 100644 --- a/docs/_markbind/headers/header.md +++ b/docs/_markbind/headers/header.md @@ -3,10 +3,10 @@
  • HOME
  • -
  • USER GUIDE
  • +
  • USER GUIDE
  • +
  • DEVELOPER GUIDE
  • SHOWCASE
  • ABOUT
  • -
  • DEVELOPER GUIDE
  • :fab-github:
  • diff --git a/docs/dg-site.json b/docs/dg-site.json new file mode 100644 index 0000000000..72cce89f1b --- /dev/null +++ b/docs/dg-site.json @@ -0,0 +1,46 @@ +{ + "baseUrl": "/devdocs", + "titlePrefix": "MarkBind", + "pages": [ + { + "glob": "**/*.mbd" + }, + { + "glob": "*.md" + }, + { + "src": "index.md", + "searchable": "no" + }, + { + "glob": "devGuide/*.md" + } + ], + "headingIndexingLevel": 6, + "ignore": [ + "_markbind", + "_site/*", + "lib/*", + "*.json", + "*.md", + "*.mbd", + "*.mbdf", + "*.njk", + ".git/*", + "*.pptx", + "CNAME" + ], + "plugins" : [ + "filterTags" + ], + "pluginsContext" : { + "filterTags" : { + "tags": ["environment--dg"] + } + }, + "deploy": { + "message": "Dev Site Update.", + "repo": "https://github.com/MarkBind/devdocs.git", + "branch": "gh-pages" + } +} diff --git a/docs/index.md b/docs/index.md index d5518a8759..4f4741fc53 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,6 +4,8 @@ footer: footer.md +
    +

    **MarkBind**

    @@ -166,3 +168,19 @@ Installing MarkBind takes just one command. Creating a new MarkBind site too tak As MarkBind is also optimized for project documentation, it can easily [integrate with the workflow of a software project](userGuide/markBindInTheProjectWorkflow.html). Get Started + +
    + +
    + +## Developer Guide + + + If you are a user, please visit MarkBind.org instead. + + +This is the latest Developer Guide for MarkBind. + +For contributors: please access the Developer Guide [here](devGuide/index.html) + +
    diff --git a/docs/site.json b/docs/site.json index 4d7e5185b3..91ab123fe4 100644 --- a/docs/site.json +++ b/docs/site.json @@ -29,20 +29,16 @@ }, { "glob": "devGuide/*.md" - }, - { - "src": "devGuide/index.md", - "searchable": "no" - }, - { - "src": "devGuide/devGuide.md", - "searchable": "no" - }, - { - "src": "devGuide/maintainerGuide.md", - "searchable": "no" } ], + "plugins" : [ + "filterTags" + ], + "pluginsContext" : { + "filterTags" : { + "tags": ["environment--ug", "environment--dg"] + } + }, "headingIndexingLevel": 6, "ignore": [ "_markbind", @@ -54,11 +50,10 @@ "*.mbdf", "*.njk", ".git/*", - "*.pptx" + "*.pptx", + "CNAME" ], "deploy": { - "message": "Site Update.", - "repo": "https://github.com/MarkBind/markbind.github.io.git", - "branch": "master" + "message": "Site Update." } } diff --git a/docs/ug-site.json b/docs/ug-site.json new file mode 100644 index 0000000000..e239c7673a --- /dev/null +++ b/docs/ug-site.json @@ -0,0 +1,57 @@ +{ + "baseUrl": "", + "titlePrefix": "MarkBind", + "pages": [ + { + "glob": "**/*.mbd" + }, + { + "glob": "*.md" + }, + { + "src": "index.md", + "searchable": "no" + }, + { + "glob": "userGuide/*.md" + }, + { + "src": "userGuide/fullSyntaxReference.md", + "searchable": "no" + }, + { + "src": "userGuide/syntaxCheatSheet.md", + "searchable": "no" + }, + { + "src": "userGuide/readerFacingFeatures.md", + "searchable": "no" + } + ], + "plugins" : [ + "filterTags" + ], + "pluginsContext" : { + "filterTags" : { + "tags": ["environment--ug"] + } + }, + "headingIndexingLevel": 6, + "ignore": [ + "_markbind", + "_site/*", + "lib/*", + "*.json", + "*.md", + "*.mbd", + "*.mbdf", + "*.njk", + ".git/*", + "*.pptx" + ], + "deploy": { + "message": "Site Update.", + "repo": "https://github.com/MarkBind/markbind.github.io.git", + "branch": "master" + } +} diff --git a/docs/userGuide/cliCommands.md b/docs/userGuide/cliCommands.md index ce182a81c5..a055f865a0 100644 --- a/docs/userGuide/cliCommands.md +++ b/docs/userGuide/cliCommands.md @@ -42,6 +42,9 @@ MarkBind Command Line Interface (CLI) can be run in the following ways: * `--baseUrl `
    Override the `baseUrl` property (read from the `site.json`) with the give `` value.
    {{ icon_example }} `--baseUrl staging` +* `-s `, `--site-config `
    + Specify the site config file (default: `site.json`)
    + {{ icon_example }} `-s otherSite.json` **{{ icon_examples }}** * `markbind build` diff --git a/docs/userGuide/deployingTheSite.md b/docs/userGuide/deployingTheSite.md index 25332825d5..3301320258 100644 --- a/docs/userGuide/deployingTheSite.md +++ b/docs/userGuide/deployingTheSite.md @@ -18,7 +18,16 @@ Generic steps for deploying a MarkBind site: 1. Set the [`baseUrl` property of the `site.json` file](siteConfiguration.html#baseUrl) to match the deploy location. 1. (Optional) Use the [`markbind serve` command](cliCommands.html#serve-command) to stage the site locally and confirm the contents are as expected. 1. Use the [`markbind build` command](cliCommands.html#build-command) to generate the site from source files. That command puts the generated site files in a directory named `_site` (you can change the output directory using parameters supplied to the command). -1. Upload the site files to the Web server. The sections below explains how to automate this step for when deploying to some online platforms. +1. Upload the site files to the Web server. The sections below explain how to automate this step if you are deploying to some online platforms. + + +Steps for deploying multiple MarkBind sites: +1. Create multiple `site.json` files. Ensure that the [`baseUrl` property of each `site.json` file](siteConfiguration.html#baseUrl) matches its deploy location. +1. (Optional) Use the [`markbind serve -s ` command](cliCommands.html#serve-command) to stage each site locally and confirm the contents are as expected. +1. For each site: + 1. Use the [`markbind build -s ` command](cliCommands#build-command) to generate the site from source files. + 1. Upload the site files to the Web server. The sections below explain how to automate this step if you are deploying to some online platforms. + ## Deploying to Github Pages diff --git a/index.js b/index.js index 1bdce1b0e0..c73e677f13 100755 --- a/index.js +++ b/index.js @@ -88,7 +88,7 @@ program .action((userSpecifiedRoot, options) => { let rootFolder; try { - rootFolder = cliUtil.findRootFolder(userSpecifiedRoot); + rootFolder = cliUtil.findRootFolder(userSpecifiedRoot, options.siteConfig); } catch (err) { handleError(err); } @@ -189,10 +189,11 @@ program .alias('d') .description('deploy the site to the repo\'s Github pages.') .option('-t, --travis [tokenVar]', 'deploy the site in Travis [GITHUB_TOKEN]') + .option('-s, --site-config ', 'specify the site config file (default: site.json)') .action((options) => { const rootFolder = path.resolve(process.cwd()); const outputRoot = path.join(rootFolder, '_site'); - new Site(rootFolder, outputRoot).deploy(options.travis) + new Site(rootFolder, outputRoot, undefined, undefined, options.siteConfig).deploy(options.travis) .then(() => { logger.info('Deployed!'); }) @@ -205,20 +206,21 @@ program .alias('b') .option('--baseUrl [baseUrl]', 'optional flag which overrides baseUrl in site.json, leave argument empty for empty baseUrl') + .option('-s, --site-config ', 'specify the site config file (default: site.json)') .description('build a website') .action((userSpecifiedRoot, output, options) => { // if --baseUrl contains no arguments (options.baseUrl === true) then set baseUrl to empty string const baseUrl = _.isBoolean(options.baseUrl) ? '' : options.baseUrl; let rootFolder; try { - rootFolder = cliUtil.findRootFolder(userSpecifiedRoot); + rootFolder = cliUtil.findRootFolder(userSpecifiedRoot, options.siteConfig); } catch (err) { handleError(err); } const defaultOutputRoot = path.join(rootFolder, '_site'); const outputFolder = output ? path.resolve(process.cwd(), output) : defaultOutputRoot; printHeader(); - new Site(rootFolder, outputFolder) + new Site(rootFolder, outputFolder, undefined, undefined, options.siteConfig) .generate(baseUrl) .then(() => { logger.info('Build success!');