• Stars
    star
    44
  • Rank 634,578 (Top 13 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A markdown parser for converting markdown to LaTeX written in PHP.

markdown-latex

Latest Stable Version Total Downloads Build Status Code Coverage Scrutinizer Quality Score

A markdown parser for converting markdown to LaTeX written in PHP.

Implementation based on cebe/markdown.

Installation

PHP 5.4 or higher is required to use it.

Installation is recommended to be done via composer by adding the following to the require section in your composer.json:

"cebe/markdown-latex": "*"

Run composer update afterwards.

Usage

In your PHP project

To use the parser as is, you just create an instance of a provided flavor class and call the parse()- or parseParagraph()-method:

// default markdown and parse full text
$parser = new \cebe\markdown\latex\Markdown();
$parser->parse($markdown);

// use github
$parser = new \cebe\markdown\latex\GithubMarkdown();
$parser->parse($markdown);

// parse only inline elements (useful for one-line descriptions)
$parser = new \cebe\markdown\latex\GithubMarkdown();
$parser->parseParagraph($markdown);

The command line script

You can use it to render this readme:

bin/markdown-latex README.md > output.tex

Using github flavored markdown:

bin/markdown-latex --flavor=gfm README.md > output.tex

or convert the original markdown description to html using the unix pipe:

curl http://daringfireball.net/projects/markdown/syntax.text | bin/markdown-latex > output.tex

To create a latex document you have to include the generated latex source in a latex document main.tex:

\documentclass[a4paper, 12pt]{article}

% english and utf8
\usepackage[british]{babel}
\usepackage[utf8]{inputenc}

% url support
\usepackage{url}

% make links clickable
\usepackage{hyperref}

% code listings
\usepackage{listings}

% include images
\usepackage{graphicx}

% better tables using tabularx
\usepackage{tabularx}

% support github markdown strikethrough
% http://tex.stackexchange.com/questions/23711/strikethrough-text
\usepackage{ulem}

\begin{document}

	\include{output.tex}

\end{document}

make a PDF with pdflatex main.tex.

More Repositories

1

markdown

A super fast, highly extensible markdown parser for PHP
HTML
994
star
2

php-openapi

Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.
PHP
467
star
3

pdfpc-latex-notes

Latex Package that allows creating a pdfpc compatible notes file directly from your latex presentation \notes.
TeX
144
star
4

js-search

A client side search engine for use on static pages.
PHP
139
star
5

yii2-openapi

REST API application generator for Yii2, openapi 3.0 YAML -> Yii2
PHP
131
star
6

yii2-app-api

OpenAPI Spec to API in 3, 2, 1... done!
PHP
104
star
7

assetfree-yii2

A composer package that allows you to install yii2 without composer-asset-plugin
PHP
50
star
8

yii2-lifecycle-behavior

Define the lifecycle of a model by defining allowed status changes.
PHP
50
star
9

yii2-gravatar

Gravatar Widget for Yii Framework 2
PHP
40
star
10

git-simple-subsplit

A git subtree/subsplit script for quickly creating one-way subsplit of repositories. (use for composer packages)
Shell
20
star
11

indent

A small tool to convert text file indentation
PHP
17
star
12

trace-graph

tool to create a network graph from different traceroutes
PHP
13
star
13

luya-module-sitemap

📇 sitemap.xml module for LUYA CMS
PHP
12
star
14

humhub-deployment

Reliable deployments for Humhub. Install Humhub with modules, themes and custom configuration.
Makefile
10
star
15

color-nick

A simple PHP lib that can color nick names to make them distinguishable in a chat room.
PHP
8
star
16

yii2-vuejs

Vue JS asset for Yii 2
PHP
6
star
17

yii2-psr7-messages

PSR7 HTTP Request and Response classes for yii2
PHP
6
star
18

yii2-oauth-server-example

Example application to demonstrate the implementation of an OAuth-Server with Yii 2
PHP
6
star
19

pulse-php-discover

A PHP implementation of the pulse/syncthing cluster discovery protocol.
PHP
5
star
20

gnucash-php

A library for reading gnucash XML format in PHP
PHP
5
star
21

yii-course-example-code

Example code of my yii 1.1 training course
PHP
5
star
22

yii2-oauth-client-example

Example application to demonstrate the implementation of an OAuth-Client with Yii 2
4
star
23

yii2-loki-log-target

Grafana Loki Log Target for Yii2
PHP
4
star
24

jsonstore

A dead simple json file storage.
PHP
3
star
25

make-php

A simple script to build different PHP versions
Shell
3
star
26

clean-docblox-theme

A Docblox template that offers a clean tidy frontend to your docs.
3
star
27

commonmark-latex

A LaTeX extension for https://github.com/thephpleague/commonmark
3
star
28

yii-base-application

A more sophisticated yii base application to start new projects from
PHP
2
star
29

code-dashboard

code dashboard shows your git commits and lets you comment on code and changes
PHP
2
star
30

yii2-debug-profiler

xhprof/uprofiler based profiling added to yii2 debug toolbar
2
star
31

tex-presentation

Template for starting a new latex beamer presentation.
TeX
1
star
32

yii-app-testrunner-standalone

standalone version of yii app testrunner
PHP
1
star
33

bower-asset

This package is registered on packagist to reserve the namespace for the composer-asset-plugin.
1
star
34

commonmark-smartypants

A smartypants extension for https://github.com/thephpleague/commonmark
1
star
35

yiimap.com

A map to show Yii users in the world and bring them together for meetups.
PHP
1
star
36

npm-asset

This package is registered on packagist to reserve the namespace for the composer-asset-plugin.
1
star
37

smartyml

A Multi-Language plugin for smarty template engine
1
star
38

test-gitrepostub

test repo
1
star
39

yii2-activerecord-benchmark

A benchmark to test yii active record performance for different backends
PHP
1
star
40

github-tracker

advanced github notification and pull request viewer
PHP
1
star
41

website-down

the code used while migrating yiiframework.com to a new server.
PHP
1
star
42

yii-app-testrunner

phpunit unittest runner for yii applications
PHP
1
star
43

yiidoc-test

testing something for yiidoc
1
star
44

demo.cebe.cc

Demo site for my yii extensions and some other stuff that comes out while developing cool applications.
PHP
1
star
45

yii2-statsd

A statsd component for Yii 2 to collect profiling and other metrics
1
star
46

db-state-driver

A tool that saves db state for testing purpose.
PHP
1
star