diff --git a/.gitignore b/.gitignore index 188035b..dd7d68d 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,4 @@ node_modules/ # so i don't accidentally commit something -*.htm \ No newline at end of file +*.htm diff --git a/GNUmakefile b/GNUmakefile index 6e26612..f534db5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -36,4 +36,6 @@ $(COPY_L): %.justcopytobuilddir: %.css mv -f $@ $(subst $(SRC_DIRS),$(BUILD_DIR),./$(dir $@)) %.justcopytobuilddir: - cp -f $< $(BUILD_DIR) \ No newline at end of file + cp -f $< $(BUILD_DIR) + +# end of GNUmakefile diff --git a/LICENSE b/LICENSE index c1550f4..c411f2c 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/compile.js b/compile.js index a4e9106..776bcad 100644 --- a/compile.js +++ b/compile.js @@ -51,6 +51,15 @@ function format(data, name) { } // forceIndent screws with text nodes pretty bad but the alternative is to not allow the full document to be formatted const formatterRules = {"indentChar": "\t", "indentSize": 1, "markup": {"forceAttribute": false, "forceIndent": true}}; + function render() { + return HTMLFormatter(data, formatterRules) + .split("\n") /* split by every newline */ + .join("\n\t\t\t") /* then add padding and convert back into string */ + .replace( /* link text node fix (should really just encase all text with , but whatever) */ + /(\t*)()\n\t*(.*)\n\t*(<\/a>)/g, + "$1 $2$3$4 " + ); + } // probably should bring in a better templating engine but whatever return ( /* eslint-disable indent */ ` @@ -70,7 +79,7 @@ function format(data, name) {
- ${HTMLFormatter(data, formatterRules).split("\n").join("\n\t\t\t")} + ${render()}
` diff --git a/package-lock.json b/package-lock.json index fbb0de7..b9c5635 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "yiki", - "version": "0.0.3", + "version": "0.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "yiki", - "version": "0.0.3", + "version": "0.0.4", "license": "MIT", "dependencies": { "@liquify/prettify": "^0.5.5-beta.1", diff --git a/package.json b/package.json index 2281057..3e2465d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yiki", - "version": "0.0.3", + "version": "0.0.4", "description": "The yellows111 wiki system", "main": "compile.js", "scripts": { diff --git a/yiki.css b/yiki.css index 8a94d95..f497f8a 100644 --- a/yiki.css +++ b/yiki.css @@ -25,7 +25,7 @@ nav { font-family: monospace; } -.header-anchor { +a.header-anchor { color: gray; text-decoration: none; } @@ -53,6 +53,10 @@ a.header-anchor:hover { a:active { text-decoration: underline teal; } + + a.header-anchor:hover { + color: black; + } } @media only print { body { @@ -66,4 +70,7 @@ a.header-anchor:hover { color: black; text-decoration: underline black; } + a.header-anchor { + display: none; + } }