Need node.js for Reveal.js to read external markdown file? - reveal.js

Can Reveal.js read from an external markdown file without requiring node.js? Or will embedded markdown (in the html) work without node.js. In other words, I need to use Apache and can't accommodate node.js.

Related

Markdown + LaTeX + Jekyll (Github Pages) = HTML?

I'm trying to use Github pages to both host my source files (strictly markdown with LaTeX equations) and manage the equation rendering when hosting the actual webpage. If I understand this process correctly, github uses Jekyll to statically generate the website, I guess converting all my .md into .html, so I don't have to.
I've read so many posts at this point indicating that I just have to include some lines in my html to run some javascript to use MathJax. I don't know javascript or html so most of the answers seem unclear to me.
Does anyone have a I need a barebones index.md hosted on github.io that renders MathJax.
I've tried:
Creating files in layouts/default.html
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax#3/es5/tex-mml-chtml.js"></script>
In _config.yml:
usemathjax : true in _config.yml, an
In the __*.md__itself (YAML Front matter):
---
usemathjax : true
---
My website is here with this page showing an html rendered from the markdown automatically via github, the other pages I generated the html locally in VS Code which doesn't scale properly on mobile and not what I want if github can just manage it directly. The source code is here for my repo.

Embed Google docs in GitLab markdown file

I want to embed Google docs - and possibly Google sheets - in a GitLab markdown file.
GitLab's markdown guide lists the following steps to do this:
open your Google document
click File -> Publish to the web
choose Embed
click on Publish and copy the <iframe>
go to your markdown file and wrap the iframe into a <figure> tag with the responsive video_container class like in this example:
<figure class="video_container">
<iframe src="https://docs.google.com/spreadsheets/d/1jAnvYpRmNu8BISIrkYGTLolOTmlCoKLbuHVWzCXJSY4/pubhtml?widget=true&headers=false"></iframe>
</figure>
Unfortunately this does not work for me. Instead of the embedded document I only see whitespace.
this guide or this one are refering to Kramdown which is a Markdown converter used by https://about.gitlab.com:
For about.GitLab.com we use kramdown, which is an advanced Markdown
engine with a lot of interesting features that most of the other
engines don't have, such as inline attribute lists (IALs), which
enable easy styling beyond the standard Markdown options.
This guide was dedicated mainly for building static website by rendering markdown using kramdown (essentially for writing blog post) :
This guide has been made to make it easier for everyone to use
kramdown features and save a lot of time writing content for
about.GitLab.com, including handbook pages, website pages, blog posts
and everything else within the project www-GitLab-com.
Gitlab.com, Gitlab CE and Gitlab EE uses Github Flavored Markdown, an extension of common mark :
In most of GitLab text areas you'll find markdown support. Not all of
them run with kramdown, so the markup will not behave equally
"GitLabwide". For GitLab.com, GitLab CE and GitLab EE text areas, the
markdown engine is currently CommonMarker. Here you can find the
markdown style guide for them.
If you are interesting in rendering Markdown in Gitlab file (eg Readme, etc...), the Markdown guide is https://docs.gitlab.com/ee/user/markdown.html
Embedding Google sheet in GitLab Flavored Markdown is not possible, unless you want to just include a picture of it or if you want to copy/paste the spreadsheet content to markdown format

Mass convert Vue.js templates into Pug format

Is there a way to mass convert existing Vue.js templates (single file components) into Pug (Jade)?
Something similar to the erb2slim gem for rails.
I find Pug much more legible and its impractical to rewrite an existing open source project.
Many thanks.
There are a few Jade converters like Html2Jade as you're just converting the html. It even appears to keep vue directives including shorthand :bind and #on.
The downside is that it's a manual converter so you will have to paste in each component separately.

Packaging an html template, javascript and css to be consumed by multiple platforms

I have a large rails application that I am wanting to split out into smaller applications. The one piece of this application that will be universal to all smaller applications is the mast and footer. I would like to extract the html, javascript and css for the mast and footer into it's own package that each app can load and render.
The main issue I'm running into is that the apps will likely not all be written in rails. Some will be rails, some will be expressjs, some written in Go, and some may end up being written in other languages, so my solution needs to be language agnostic.
My thought is that I can extract the html, css and javascript into it's own git repo, use mustache templates for the html, and then use grunt or a similar build tool to build a gem, a package.json structure and a golang module. Possibly each in it's own git submodule.
I'm curious if there is a more standardized way of doing this. Or if anyone knows of a simpler way of achieving this goal.
Sounds like the technology in common is HTML/JS/CSS.
Wouldn't it be better to export the mast and footer as a self contained JS library, or more precisely, as widgets?
So whatever the application server tech stack would be, you could always generate the HTML in the form of:
<script src="your_widgets.js"></script>
<script>new Footer.render('id_of_dom_element_to_render_to');</script>
By doing so, whether you want the widget library to load the template or you want to embed the template into the widget library or whether you want to simply just construct it using HTMLFragment will not be limited by the server tech choice.

Is it possible to link to an external html sheet?

Is it possible to add an external sheet containing html elements (similar to an external css stylesheet) maybe using the link tag?
The project will have many webpages that have identical elements (for example, a navigation bar) Is there a way I would be able to link to an external file so that I would only have to change one file to spread this change to all of my webpages.
Using just plain HTML, no. Some other options:
You can use a server side scripting language to include files. (Language specific)
Server Side Includes. SSI's are rather limited however.
Templates or Templating Engine (like Smarty). This is the overkill solution to a simple problem, but left here as an option.
Javascript can dynamically generate the content after the page loads.
Depending on your content, sometimes an IFRAME can be used.

Resources