Skip to content

BlueTot/tatum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tatum

Tatum is a simple, highly customisable CLI markdown note-taking tool. This is an extension of the original tatum, elijah-potter/tatum. I originally developed it for making lecture notes and submitting university assignments using neovim, so this tool may not be for you. Feel free to clone/fork it and add your own extensions.

Features

Templates

Tatum was designed to give control to the user - you can customise almost everything about how your document is previewed, processed, and exported. This is done using templates - preset directories that contain config files located in the ./.tatum directory.

The init command creates the ./.tatum directory along with other files, including two default templates called default and bluetot. default is the original template provided by elijah-potter, and bluetot is my custom template.

tatum init

The command new creates a new template:

tatum new <TEMPLATE_NAME>

Each template contains at minimum these files:

  • page.html
    • Root html file used for previewing and exporting to HTML.
  • style.css
    • Custom stylesheet used for previewing and exporting to HTML.
  • katex-macros.js
    • Custom list of latex macros used for previewing, exporting to HTML, LATEX and PDF.
  • header.tex
    • Custom latex header used for exporting to LATEX and PDF.

Macros

Katex macros are used to define replacements for existing latex commands to make typing easier. For example, you can alias \mathbb{R} to \R. These are specified by the user in the katex-macros.js file.

Visit the official katex documentation to see how to add macros yourself.

Macros are also supported when exporting to LATEX/PDF, but you have to convert the .js file to a .tex file that the conversion engine can understand.

tatum compile-macros <TEMPLATE_PATH>

Either run the compile-macros command, or create the file yourself. Beware that the compile-macros command converts everything to a \newcommand, which may not work if the command is reserved. To resolve this, manually change it to a \renewcommand.

More Export Formats

Often, university assignments need to be exported professionally to a PDF. Thats why Tatum supports exporting to PDF using the pdflatex engine, which produces documents in a professional latex style. Tatum also supports converting to latex using the to-latex command, which gives users more control over the conversion process.

tatum to-pdf <MD_FILE_PATH> -t <TEMPLATE_PATH>

You can style the output LATEX/PDF document using the header.tex file in each template. For example, you can add a fancyhdr that shows your name, student id, and page number at the top of every page - a common university submission requirement.

Lastly, Tatum supports bulk exporting to HTML using the render-all command. It renders all files specified in the ./.tatum/render-list.json file to their specified destinations.

Installation

First, install Tatum:

cargo install --git https://github.com/bluetot/tatum --locked

Next, install pdflatex and its extra packages:

sudo apt install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra

Install pandoc, which is used for file conversion:

sudo apt install pandoc

Initialise the ./.tatum directory:

cd ~
tatum init
tatum compile-macros ./.tatum/bluetot

Lastly, insert the following snippet into your Neovim config:

vim.keymap.set("n", "<leader>o", function ()
   vim.fn.jobstart({
      "tatum", "serve", 
      "--open", vim.fn.expand('%'),
      "-t", vim.fn.expand('~/.tatum/bluetot')
   }, { noremap = true, silent = true })
end)

Alternatively, check out my neovim config here to see how it's done.

About

An extension of elijah-potter/tatum to fit my own needs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •