Generate post-it blocks ready-to-print from a markdown file
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
km0 d17115798e contents generator 2 years ago
katamari contents generator 2 years ago
postit contents generator 2 years ago
test contents generator 2 years ago
venv first commit! template and generate! 2 years ago
.DS_Store first commit! template and generate! 2 years ago
.gitignore first commit! template and generate! 2 years ago
README.md first commit! template and generate! 2 years ago
contents.json contents generator 2 years ago
generate_single.py contents generator 2 years ago
results.json contents generator 2 years ago
setup.py contents generator 2 years ago

README.md

POST-IT GENERATOR

TO AUGMENT OUR PRODUCTIVITY HERE IS A SCRIPT THAT
Generate post-it blocks from markdown files.

Install

Clone the repo

git clone https://git.xpub.nl/kamo/postit-gen.git

Move to the cloned folder

cd postit-gen

Create a virtual environment

python3 -m venv venv

and activate it

. venv/bin/activate

Then you can install the repo

pip3 install -e .

How to use

The package offers two scripts: template.py and generate.py.

template.py generate a template folder with a markdown file that can be used as a starting point for formatting the contents.

python3 template.py -f test

Will generate a test folder, with the markdown template for the contents.

The contents.md file has these properties:

  • title, the title of the block
  • folder, the base folder in which the files are
  • page_width, the width of the page for the printing
  • page_height, the height of the page for the printing
  • post_width, the width of the post-it for the printing
  • post_height, the height of the post-it for the printing
  • margin, the margin for the page
  • unit, the measure unit in which the measures are expressed, default is mm
  • background, the color of the post-its. Accept all the format CSS specs accept. Default is white.
  • contents, a list of contents to put in the post-it block. Each entry is a post-it.

All these parameters are formatted in YAML.

After setting all the parameters to match your needs, you can fill the contents. ATM you can insert text and images, in the form of a list.

contents:
    - A flat with no floors
    - Hello, where are you, what can you see from there?
    - type: image
      src: game.png

Usually each entry of the list will be considered as a string. If you want to insert an image you will need to provide a type: image, and a src: <filename>.

In this way:

contents:
    - type: image
      src: <filename>

Once you inserted your contents, you can run the generate.py script, specifying the working folder from which you want to take the contents.

python3 generate.py -f test

It will take the contents inside the test folder and will generate a ready-to-print HTML file, serving it with a simple http-server at http://localhost:8000/test. Opening that link you can preview your post-it blocks. Each entry of the contents list is now a page in the document (in the print mode!)

TODO: link css file in the template to work directly on the preview.