News for hackers. Stuff that matters.
Re:Show HN: This website is valid JSON by BeefWellington on Wednesday December 09, 2020 @12:50AM (#25355751)
I have created a similar silly hack where you can just write markdown directly:

    # Markdown header

    ## Subheader

    ### Section header

    1. Numbered
    1. List

    - Unordered
    - List


    [//]: # (<html><body></body><script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script><script>var doc = document.children[0].textContent.split('\n'); md = doc.slice(0, doc.length - 1).join("\n"); document.body.innerHTML = marked(md);</script></html><!--)
That last line has varying degrees of invisibility in different markdown viewers I looked at. Obviously there's optimization that could be had here but this is equally hacky IMO and simpler since you can just write MD instead of JSON. You lose a couple of key features though -- templated components for example. However, I imagine you could shoehorn those in without much effort.

This has the advantage that without JS enabled you'll get poorly formatted markdown in the browser.

Re:Show HN: This website is valid JSON by pietroppeter on Wednesday December 09, 2020 @03:45AM (#25356623)