Pandoc LaTeX Mermaid on GitLab CI

Goal

To provide an open-source alternative to the Docker image escalope/pandoc-mermaid-plantuml, whose Dockerfile isn’t available.

The rationale behind these difficult setup is simple: construct informative Mermaid diagram with intuitive Markdown syntax in an open-source and economic way.

This newly constructed Docker image is entirely on GitLab. No Docker Hub account is needed. For sample usage, consult .gitlab-ci.yml in my test project.

Difficulties

  1. issues raghur/mermaid-filter#51 and #52
  2. issue gitlab-org/gitlab-runner#4566

Useful code/articles

  1. time-machine-project/requests-for-comments@470b0c5 Dockerfile
  2. Reduce Docker Image Sizes Using Alpine
  3. Best practices for building docker images with GitLab CI with the accompanying gist
  4. The code block in the highlighted comment in item 2 of the above section
  5. pandoc installation for Docker
  6. Sample Dockerfile for Alpine Linux in the troubleshooting of Puppeteer
  7. sc250024/docker-mermaid-cli@3c9ddb5 src/puppeteerConfigFile.json
  8. raghur/mermaid-filter project README’s section about Puppeteer config file

Staticman on Framagit

It’s a pity that some GitLab users have removed Staticman from their repo. I saw demand for Staticman from Framagit users. Therefore, after two days of testing, another API instance for Framagit has been created at https://staticman-frama.herokuapp.com. (Edit: typo edited, please see my comment below.)

The default GitLab base URL is set to “https://gitlab.com”. To provide Staticman support for a self-hosted GitLab service, another Staticman API server has to be set up.

I tried applying for OpenShift, but it’s been reported on Reddit that it takes about 10–20 days to get started. Amazon requires verification by credit card. I couldn’t deploy Staticman using Zeit Now’s Node.js server builder. Finally, I turned back to Heroku.

[Read More]

Comparaison of Two Docker Images for Hugo

Having importing the repo for the Hugo theme Introduction from GitHub to GitLab, I added the automatically generated GitLab CI config file and I ran job #135854407.

$ cd exampleSite
$ hugo --themesDir=../.. -d ../public
hugo: /usr/lib/libstdc++.so.6: no version information available (required by hugo)
hugo: /usr/lib/libstdc++.so.6: no version information available (required by hugo)

The build succeeded with the above message. To suppress it, a switch to another CI runner will do. The associated GitLab CI config file was copied from Hugo’s documentation with some customizations for Hugo sample sites

[Read More]

Staticman Lab New Logos

StaticmanLab new logo

StaticmanLab's new logo

GitLab logo recreated from Wikimedia's logo by Darby under CC-BY-SA 4.0 and Staticman logo on GitHub by Erlen Masson under MIT.

The old icon for Staticman Lab was made by GIMP from Staticman’s icon in PNG in the GitHub repo. Recently, I’ve found the SVG version of this icon. To serve customers better, I’ve recreated the logo from this SVG file so that the edges in the logo become sharper.

[Read More]

Interactive Blog on Static Web Host

Vision

  • gain autonomy: freedom is the basis of moral actions. No freedom, no morality.
  • transcend ourselves: change/improve our lives through free thoughts

Goal

Convert our free thoughts into free code.

Free code allows users around the world to run and/or improve them. This would bring real enhancement to our tools.

For example, beautiful math writing used to be a complicated process. A decade ago, this required the installation of a typesetting engine called $\LaTeX$. Thanks to freely available scripts like MathJax and $\KaTeX$, it’s now possible to write math viewable by any modern web browser by writing the content in the middle.

[Read More]

Staticman API Hosting 2018

Step-by-step guide for free-hosting on Heroku

Update: I suggest reading a newer tutorial for setting up your custom API server that works with GitHub Apps. The package maintainers suggest hosting your own API server.

Goal

To host an instance of Staticman v3 server on Heroku.

This post involves server-side setup of the commenting system. If you simply want to have a taste of this system on GitLab, you may try my demo GitLab Page.

I try to address some concerns about this API service in the introduction of this series to keep this page focused on the technical aspects of my customizations against staticman/dev branch.

[Read More]

Config GitLab Repo for Staticman

Update: I suggest reading a newer tutorial.

To keep focused on the technical setup, please refer to the introduction of this series for the reasons of choosing Staticman and GitLab.

Goal

To set up unauthenticated commenting system on GitLab pages.

GitLab Page with Staticman

Demo GitLab Page with Staticman v3

Built on 14/09/2018

This post aims at providing a walkthrough to the GitLab repo setup. If you want to host your own Staticman API instance, you may refer to the next post in this series.

[Read More]

Welcome to static comments

Staticman Powered GitLab Pages

I put some “why” questions here so as to keep focus on the technical setup of the GitLab repo and the optional Staticman API server.

Why static blogs instead of dynamic ones?

  • quicker loading time
  • better reliability (can handle more request)
  • no database needed
  • greater control on content, styles and layout

Why static comments?

  • allow feedback from visitors
  • site owner owns the comment locally (unlike WordPress, Facebook, Disqus, etc)
    • no remote database needed, so no need to worry server errors from third-party commenting services.
    • greater control over the rendering of the comments (allow additional features such as Markdown syntax, and $\KaTeX$ support)
    • more accessible since static comments are incorporated as HTML elements into the post. No JavaScript is required to retrieve the comments, contrary to most third-party commenting services.

Before Staticman’s deployment, another commenting system called Pecosys was already available. However, it’s less convenient to handle visitor’s requests as emails.

[Read More]