Strapdown.js – Instant and elegant Markdown documents
strapdownjs.com
strapdownjs.com
The PolymerElement project's <marked-element> has offered declarative client-side Markdown for years:
<marked-element>
<!-- content is in a script tag so inline HTML isn't instantiated -->
<script type="text/markdown">
# Hello
</script>
</marked-element>
https://www.webcomponents.org/element/PolymerElements/marked...For math, you can do a similar thing with Katex: https://github.com/justinfagnani/katex-elements
<katex-display>c = \pm\sqrt{a^2 + b^2}</katex-display> (1) Prevents outside navigation into named anchors.
(2) Makes the content slow to load.
(3) Suffers from a flash of unstyled content.
You can use chrome to bake out the HTML with a one-liner: chrome mydoc_md.html --headless --dump-dom --virtual-time-budget=1000 > mydoc.html
The resulting HTML is fast to load and just as beautiful.If you can serve static HTML, why not just do that?
I'd definitely call it elegant, though not exactly minimal.
I helped run a fraternity website for a bit. If I could say, hey just download the source from chrome, tweak the bulletin in notepad, and upload it back to the ftp page that would have been great.
It also has the text in readable markdown. If you browse without JS it still works!
Also true of html
How does it, given that all the markdown is inside that
<xmp theme="united" style="display:none;">
block?From my experience any of the trio, Marked[1], Showdown[2] and Markdown-it[3], can be configured to just do it themselves.
As a side note, I built a markdown editor once that works client side and resides inside "real static" html.
Demo for the interested: http://public.docs.xstatic.site.s3-website-us-west-1.amazona...
[1] https://github.com/markedjs/marked
However, in hindsight it sucks... all that documentation is so much harder to read in things like githublab... Those things render .md files just great, however, all these old docs look like html and require JS to render...
Just write pure markdown in .md files... view them w/ tooling, don't build tooling into the file...
Maybe we should add a scripting language so that sites can use any source format they want? Oh wait.
Strapdown-Zeta (a fork) has the ability to load MD files from src and stuff:
https://github.com/chaitin/strapdown-zeta/blob/master/README...
FYI, if you want to src attribute to load markdown files you need to build js files yourself as the js file in the CDN doesn't have the feature for some reason.
I've created an issue for this https://github.com/chaitin/strapdown-zeta/issues/119
I wouldn't put it past the major publishers to have moved beyond A/B testing for an overall headline winner to more segmented optimization based on tying A/B performance to first and third party data they have available on you, and further optimizing their headlines to reflect whatever performed well for traffic like you, rather than just performed best overall for all traffic.
1. https://contently.com/strategist/2015/02/04/how-buzzfeed-r29...
I don't think a belief is paranoid when it's both rational and evidence based.
Based on how Strapdown appears to work, it appears to be the delayed CSS load that causes the problems.
I believe that the problem could be alleviated by adding the CSS link tags to the head of the document, when you're happy with the final product. Looks like you should only need bootstrap and whatever you choose from bootswatch.
Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
* It has been deprecated since HTML3.2 and was not implemented in a consistent way. It was completely removed from the language in HTML5.
* Use the <pre> element or, if semantically adequate, the <code> element instead. Note that you will need to escape the '<' character as '<' to make sure it is not interpreted as markup.
* A monospaced font can also be obtained on any element, by applying an adequate CSS style using monospace as the generic-font value for the font-family property.