Skip to content

Commit

Permalink
add warning at top of index.md and fix to link updating
Browse files Browse the repository at this point in the history
  • Loading branch information
devlinjunker committed Apr 25, 2020
1 parent aba960c commit 03fe367
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,7 @@
},
{
"kind": "manualIndex",
"content": "\nWelcome to the Manual/Wiki for the Hapi REST Server Template. These files should updated whenever we merge to master, and be in sync between:\n - The README files in the repo,\n - The Github Wiki, and\n - The generated doc site served when running the server\n\n\nWe use a Github Action to accomplish this. The action is executed on merge to the `master` branch and defined inside of the `./.github/workflows/` directory([github](https://github.com/devlinjunker/template.node.hapi/tree/master/.github/workflows)) (along with all other github actions) that calls a script([github](https://github.com/devlinjunker/template.node.hapi/tree/master/scripts/actions)) in our `scripts/actions` directory.\n\nThe script retrieves the following markdown files (defined in `./.esdoc.json`) and copies them to a temporary directory, then uses the [wiki-page-creator-action](https://github.com/marketplace/actions/wiki-page-creator-action) to update the wiki.\n\n### Table of Contents\n\n- [Setup](manual/README.setup.html) - dependencies and how to install and start development (eventually\nproduction?)\n- [Entry Point](manual/README.entry.html) - How we start and setup the server process to handle requests\n- [Controllers](manual/README.controllers.html) - mappings from url endpoints to methods for handling requests\n- [Dataservices](manual/README.dataservices.html) - classes/methods that connect to external services or datastores\n- [Helpers](manual/README.helpers.html) - classes that are used frequently for interacting with other systems/tools\n- [Logging](manual/README.logging.html) - Explains how logs works and how to add/view them as a developer\n- [Git Hooks](manual/README.scripts.html) - Notes about workflow enforcements\n- [Test](manual/README.test.html) - files used to run the unit tests (eventually automated tests)\n\n.\n",
"content": "\n**NOTE: Any manual changes to Github Wiki will be overwritten by push (PR merged) to `master` branch**\n\nWelcome to the Manual/Wiki for the Hapi REST Server Template. These files should updated whenever we merge to master, and be in sync between:\n - The README files in the repo,\n - The Github Wiki, and\n - The generated doc site served when running the server\n\n\nWe use a Github Action to accomplish this. The action is executed on merge to the `master` branch and defined inside of the `./.github/workflows/` directory([github](https://github.com/devlinjunker/template.node.hapi/tree/master/.github/workflows)) (along with all other github actions) that calls a script([github](https://github.com/devlinjunker/template.node.hapi/tree/master/scripts/actions)) in our `scripts/actions` directory.\n\nThe script retrieves the following markdown files (defined in `./.esdoc.json`) and copies them to a temporary directory, then uses the [wiki-page-creator-action](https://github.com/marketplace/actions/wiki-page-creator-action) to update the wiki.\n\n### Table of Contents\n\n- [Setup](manual/README.setup.html) - dependencies and how to install and start development (eventually\nproduction?)\n- [Entry Point](manual/README.entry.html) - How we start and setup the server process to handle requests\n- [Controllers](manual/README.controllers.html) - mappings from url endpoints to methods for handling requests\n- [Dataservices](manual/README.dataservices.html) - classes/methods that connect to external services or datastores\n- [Helpers](manual/README.helpers.html) - classes that are used frequently for interacting with other systems/tools\n- [Logging](manual/README.logging.html) - Explains how logs works and how to add/view them as a developer\n- [Git Hooks](manual/README.scripts.html) - Notes about workflow enforcements\n- [Test](manual/README.test.html) - files used to run the unit tests (eventually automated tests)\n\n.\n",
"longname": "/Users/junkerd/Programming/js/template.hapi.rest/index.md",
"name": "./index.md",
"static": true,
Expand Down
3 changes: 2 additions & 1 deletion docs/manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
</nav>

<div class="content" data-ice="content"><div class="github-markdown">
<div class="manual-user-index" data-ice="manualUserIndex"><p>Welcome to the Manual/Wiki for the Hapi REST Server Template. These files should updated whenever we merge to master, and be in sync between:</p>
<div class="manual-user-index" data-ice="manualUserIndex"><p><strong>NOTE: Any manual changes to Github Wiki will be overwritten by push (PR merged) to <code>master</code> branch</strong></p>
<p>Welcome to the Manual/Wiki for the Hapi REST Server Template. These files should updated whenever we merge to master, and be in sync between:</p>
<ul>
<li>The README files in the repo,</li>
<li>The Github Wiki, and</li>
Expand Down
2 changes: 2 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

**NOTE: Any manual changes to Github Wiki will be overwritten by push (PR merged) to `master` branch**

Welcome to the Manual/Wiki for the Hapi REST Server Template. These files should updated whenever we merge to master, and be in sync between:
- The README files in the repo,
- The Github Wiki, and
Expand Down
10 changes: 6 additions & 4 deletions scripts/actions/collect-wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ const home = esdocSettings['plugins'][0]['option']['manual']['index'];
const homePath = `../.${home}`;
let content = fs.readFileSync(path.resolve(__dirname, homePath)).toString();

// Replace all links in index.md file so they work on github
for (const oldName in map) {
// oldName: "README.controllers.md";
// become: newName
//
// find (manual/README.controllers.html)
// become: newName without `.md` (e.g. "0-setup")
// oldName ex: "README.setup.md";
const newName = map[oldName];
const namePart = oldName.substring(0, oldName.length - 3);

const regexp = new RegExp(`\\(manual\\/${namePart}\\.html\\)`);
content = content.replace(regexp, `(${newName})`);

const newLink = newName.substring(0, newName.length - 3);
content = content.replace(regexp, `(${newLink})`);
}

fs.writeFileSync(path.join(tmpPath, 'Home.md'), content);

0 comments on commit 03fe367

Please sign in to comment.