Make posters from Markdown files.

Overview

MkPosters

Create posters using Markdown. Supports icons, admonitions, and LaTeX mathematics.

At the moment it is restricted to the specific layout of two-columns-with-banner-at-the-top, as that's what I tend to use. (Pull requests are welcome if you want to make this tool more general.) The poster can be either portrait or landscape.

The library operates by parsing your Markdown into HTML, styling it with CSS, and then opening a webpage that you can export to PDF.

Example

Example poster

The "source code" for this example is here.

Assumptions

Assumes you have:

  • Linux (WSL is fine) or macOS
  • Firefox
  • Python

Compatibility with other operating systems is probably possible by switching out the version of Dart Sass being used internally.
Compatibility with other browsers is unlikely.

You'll need to be relatively familiar with HTML and (S)CSS to make best use of MkPosters.

Installation

pip install mkposters

Usage instructions

  1. Create the appropriate directory structure
foo/
    poster.md
    ...any other assets e.g. images...
  1. Lay out your poster

poster.md should be formatted in three sections, with a literal "--split--" between each section.

...whatever you want in the banner at the top...

--split--

...whatever you want in the left column...

--split--

...whatever you want in the right column...
  1. Build poster

Run from the directory containing foo:

bash> python -m mkposters foo

(The first time you do this MkPosters will attempt to automatically detect system architecture and install the appropriate required build of dart-sass. This was tested working on both an Apple M1 and Ubuntu x86_64 machine.)

  1. View poster

Now open Firefox (not Chrome etc.) and navigate to localhost:8000/poster.html.

What you see will be based on the size of your current browser window and may differ from the PDF version. So next hit Control-P and select "Save to PDF". What you see in the print preview is what you'll actually end up with!

Make all your edits until you're happy with the result. Now let's save the result to PDF.

  1. Save to PDF

Saving to PDF can be quite finickity, and in general depends on choice of browser etc. (For what it's worth the following is tested using Firefox on Windows 10 with mkposters running on Ubuntu 20.04 on WSL2.)

In the print dialog window we opened above:

  • Destination: "Save to PDF". Do not use "Microsoft Print to PDF".
  • Orientation: (portrait or landscape, as desired)
  • Pages: Custom: 1
  • Paper size: (whatever is desired; current styling works best on paper roughly A4 sized)
  • Margins: None
  • Options: uncheck "Print headers and footers"

Once again, make sure you're using Firefox. Using other browsers (e.g. Chrome) or other PDF exporters (e.g. WeasyPrint) can introduce a variety of issues, such as saving text as images (which are unselectable in the PDF, and appear slightly pixelated), missing parts of the styling, or having faded colours (looking at you, Chrome).

Functionality

MkPosters comes with a few extra pieces of functionality built in.

Icons

Recalling that Markdown can embed HTML, then icons can be embedded via e.g.

<img style="height: 20pt; width: 20pt" src="icons/fontawesome/brands/github.svg">

where the list of available icons is here.

Mathematics

You can use LaTeX-formatted mathematics. This is done via

\\(inline math\\)
\\[display math\\]

Note the double backslash.

Admonitions

Admonitions can be added using the syntax

!!! admonition_type "Your title here"

    Your text here

where admonition_type is any of these types, e.g. info, tip, etc.

HTML

The Markdown format allows you use arbitrary HTML inside of it.

  • The banner section often contains information (titles, authors, logos, URLs etc.) laid out in complicated ways. Directly writing HTML with embedded style attributes is simplest here. See the start of this example.
  • HTML can be (ab)used to modify spacing like so. (Analogous to those little \vspaces you definitely never use in LaTeX documents.) In this example we move the content up by 10 points.
<div style="margin-top: -10pt;">
...your content here...
</div>

Future plans?

It'd be nice to support:

  • Custom per-poster SCSS;
  • Other poster layouts;
  • Handling other paper sizes;
  • Optionally automatically generating the PDF. (Practically speaking probably by automating the Firefox interaction through Selenium.)
  • Reducing package size by not including all of the mkposters/third_party/icons directory by default?

Pull requests welcome! See CONTRIBUTING.md.

Similar tools

These all support some kind of conversion Markdown -> something.

Owner
Patrick Kidger
Maths+ML PhD student at Oxford. Neural ODEs+SDEs+CDEs, time series, rough analysis. (Also ice skating, martial arts and scuba diving!)
Patrick Kidger
A `:github:` role for Sphinx

sphinx-github-role A github role for Sphinx. Usage Basic usage MyST: :caption: index.md See {github}`astrojuanlu/sphinx-github-role#1`. reStructuredT

Juan Luis Cano Rodríguez 4 Nov 22, 2022
This repo contains everything you'll ever need to learn/revise python basics

Python Notes/cheat sheet Simplified notes to get your Python basics right Just compare code and output side by side and feel the rush of enlightenment

Hem 5 Oct 06, 2022
A course-planning, course-map rendering and GPA-calculation web service, designed for the SFU (Simon Fraser University) student.

SFU Course Planner What is the overall goal of the project (i.e. what does it do, or what problem is it solving)? As the title suggests, this project

Ash Peng 1 Oct 21, 2021
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI

SAFRS: Python OpenAPI & JSON:API Framework Overview Installation JSON:API Interface Resource Objects Relationships Methods Custom Methods Class Method

Thomas Pollet 361 Nov 16, 2022
A markdown wiki and dashboarding system for Datasette

datasette-notebook A markdown wiki and dashboarding system for Datasette This is an experimental alpha and everything about it is likely to change. In

Simon Willison 19 Apr 20, 2022
Code for our SIGIR 2022 accepted paper : P3 Ranker: Mitigating the Gaps between Pre-training and Ranking Fine-tuning with Prompt-based Learning and Pre-finetuning

P3 Ranker Implementation for our SIGIR2022 accepted paper: P3 Ranker: Mitigating the Gaps between Pre-training and Ranking Fine-tuning with Prompt-bas

14 Jan 04, 2023
Get link preview of a website.

Preview Link You may have seen a preview of a link with a title, image, domain, and description when you share a link on social media. This preview ha

SREEHARI K.V 8 Jan 08, 2023
A simple malware that tries to explain the logic of computer viruses with Python.

Simple-Virus-With-Python A simple malware that tries to explain the logic of computer viruses with Python. What Is The Virus ? Computer viruses are ma

Xrypt0 6 Nov 18, 2022
204-python-string-21BCA90 created by GitHub Classroom

204-Python This repository is created for subject "204 Programming Skill" Python Programming. This Repository contain list of programs of python progr

VIDYABHARTI TRUST COLLEGE OF BCA 6 Mar 31, 2022
:blue_book: Automatic documentation from sources, for MkDocs.

mkdocstrings Automatic documentation from sources, for MkDocs. Features Python handler features Requirements Installation Quick usage Features Languag

Timothée Mazzucotelli 1.1k Dec 31, 2022
✨ Real-life Data Analysis and Model Training Workshop by Global AI Hub.

🎓 Data Analysis and Model Training Course by Global AI Hub Syllabus: Day 1 What is Data? Multimedia Structured and Unstructured Data Data Types Data

Global AI Hub 71 Oct 28, 2022
An open-source script written in python just for fun

Owersite Owersite is an open-source script written in python just for fun. It do

大きなペニスを持つ少年 7 Sep 21, 2022
Fast, efficient Blowfish cipher implementation in pure Python (3.4+).

blowfish This module implements the Blowfish cipher using only Python (3.4+). Blowfish is a block cipher that can be used for symmetric-key encryption

Jashandeep Sohi 41 Dec 31, 2022
SamrSearch - SamrSearch can get user info and group info with MS-SAMR

SamrSearch SamrSearch can get user info and group info with MS-SAMR.like net use

knight 10 Oct 06, 2022
PyPresent - create slide presentations from notes

PyPresent Create slide presentations from notes Add some formatting to text file

1 Jan 06, 2022
A Collection of Cheatsheets, Books, Questions, and Portfolio For DS/ML Interview Prep

Here are the sections: Data Science Cheatsheets Data Science EBooks Data Science Question Bank Data Science Case Studies Data Science Portfolio Data J

James Le 2.5k Jan 02, 2023
The source code that powers readthedocs.org

Welcome to Read the Docs Purpose Read the Docs hosts documentation for the open source community. It supports Sphinx docs written with reStructuredTex

Read the Docs 7.4k Dec 25, 2022
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.

drf-yasg - Yet another Swagger generator Generate real Swagger/OpenAPI 2.0 specifications from a Django Rest Framework API. Compatible with Django Res

Cristi Vîjdea 3k Dec 31, 2022
Project documentation with Markdown.

MkDocs Project documentation with Markdown. View the MkDocs documentation. Project release notes. Visit the MkDocs wiki for community resources, inclu

MkDocs 15.6k Jan 02, 2023
layout-parser 3.4k Dec 30, 2022