├── Dockerfile ├── README.md ├── blog-tex ├── example.tex ├── header.html └── header.xml ├── compile.sh └── docker-compose.yml /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:11 2 | RUN apt-get update && apt-get install -y pandoc 3 | WORKDIR /usr/share/blogtex -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BlOgTeX 2 | A blog that compiles LaTeX documents to HTML and creates an index in reverse-chronological order 3 | 4 | ## Dependencies 5 | - `pandoc` 6 | 7 | ## How To Use 8 | Edit the variables at the top of the script to point to your source `.tex` files, then where you want to output the final compiled blog. Note that the destination directory WILL BE WIPED UPON INVOKING THE SCRIPT. This is for cleanliness purposes. 9 | 10 | You will need to have a `header.html` file in your `$SOURCE` directory. This is so when the script gets run and it gets the title, date, and filename of each file and creates an index, there is actually something doing things like creating a title for the page. Take a look at my example [header.html](blog-tex/header.html) so you can see what is required. 11 | 12 | You will also need a `header.xml` file in your `$SOURCE` directory. This should include everything that makes up the RSS feed aside from the actual contents. Once again, you can take a look at my example [header.xml](blog-tex/header.xml). 13 | 14 | From there, all you need to do is populate the `$SOURCE` directory with `.tex` articles, then run `./compile.sh`. I've included a template file at [example.tex](blog-tex/example.tex). 15 | 16 | ### Formatting .tex files 17 | The only thing to keep in mind is that you need to use `MM/DD/YYYY` format for dates in the `.tex` files. When outputted to the RSS, they turn into `Day, DD Mon YYYY` for compatibility. If you have any issues with this, make an Issue and I'll make some sort of flag to change between formats. 18 | 19 | ## Things That Are Supported 20 | - Links 21 | - **Bold** and *Italic* text 22 | - Images 23 | - Resize using `\includegraphics[height=50px,keepaspectratio]{image}` 24 | You can use either cm or px for the height. You can also use width, but I hate using it and do not recommend it. 25 | - Math 26 | - The math is generated using `latex.codecogs.com` which by default makes all of the math black. You can work around this by importing `\usepackage{xcolor}`, then using the `\color{}` tag (make sure to put a color between those {curly brackets}) to change it to a color that is readable. This was releavnt to me because the background of my blog is black, which made the math impossible to read. 27 | - Also, the reason that the math is done through CodeCogs is because a lot of the rendering of math simply cannot be done with plain HTML (see: fractions, sqrt, etc.) but CodeCogs provides a super quick way to do it that is *automatically handled by the script*, so your math equations will just werk. 28 | - Sections, subsections, etc. 29 | - Code syntax highlighting with `\usepackage{minted}` 30 | 31 | ## To-do 32 | - [x] Fix sorting by date in index 33 | - [x] Add RSS feed functionality 34 | -------------------------------------------------------------------------------- /blog-tex/example.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \import{packages} 3 | 4 | \title{Post Title Goes Here} 5 | \author{Put Author or Subtitle Here} 6 | \date{MM/DD/YYYY} 7 | 8 | \begin{document} 9 | 10 | \maketitle 11 | 12 | Post contents should go here. 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /blog-tex/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Might not always have to do with Linux!
-------------------------------------------------------------------------------- /blog-tex/header.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |/d') 42 | ]]>