From 7ee1216b1fe1a0a5f67b8b8049a6397dd35d52d1 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 27 Mar 2017 18:44:53 +1100 Subject: [PATCH] Added inline comments, hooked up markdown-toc to npm start --- public_html/index.html | 1 + public_html/package.json | 3 ++- public_html/rules.md | 4 ++++ public_html/styles/shared.css | 6 ------ public_html/utilities.js | 6 +++++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index aa5013b..4c7d1f4 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -3,6 +3,7 @@ + diff --git a/public_html/package.json b/public_html/package.json index 6e26828..01ea9cd 100644 --- a/public_html/package.json +++ b/public_html/package.json @@ -4,13 +4,14 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "markdown-toc -i rules.md" }, "author": "", "license": "ISC", "dependencies": { "markdown-it": "^8.3.1", "markdown-it-container": "^2.0.0", + "markdown-it-inline-comments": "^1.0.1", "markdown-toc": "^1.1.0" } } diff --git a/public_html/rules.md b/public_html/rules.md index d5565f3..a2b24d5 100644 --- a/public_html/rules.md +++ b/public_html/rules.md @@ -2,6 +2,8 @@ Fight your way across vast expanses, conquer enemy batallions, and survive in th ::: mobileOnly + + - [Basic Rules](#basic-rules) * [Phases of a Turn](#phases-of-a-turn) - [Types of Cards](#types-of-cards) @@ -28,6 +30,8 @@ Fight your way across vast expanses, conquer enemy batallions, and survive in th * [Pilot Idiocy](#pilot-idiocy) * [Duplicate Phase Skipping](#duplicate-phase-skipping) + + ::: Basic Rules diff --git a/public_html/styles/shared.css b/public_html/styles/shared.css index 5925716..f557736 100644 --- a/public_html/styles/shared.css +++ b/public_html/styles/shared.css @@ -59,9 +59,3 @@ footer { content: "\25BC"; } -/* device only features */ -@media screen and (min-width: 768px) { - .mobileOnly { - display: none; - } -} diff --git a/public_html/utilities.js b/public_html/utilities.js index 2aaf5bb..9b6a072 100644 --- a/public_html/utilities.js +++ b/public_html/utilities.js @@ -1,5 +1,9 @@ //global markdown object and configuration var markdown = window.markdownit() + + //allow HTML-style comments + .use(window.markdownitInlineComments) + //configure for semantic-style visibility controls .use(window.markdownitContainer, 'mobileOnly', { validate: function(params) { @@ -8,7 +12,7 @@ var markdown = window.markdownit() render: function (tokens, idx) { if (tokens[idx].nesting === 1) { //opening tag - return '
'; + return '
'; } else { // closing tag return '
';