• Stars
    star
    293
  • Rank 141,748 (Top 3 %)
  • Language
    C
  • License
    Other
  • Created about 9 years ago
  • Updated almost 6 years ago

Reviews

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

Repository Details

Reference implementation of MultiMarkdown; replaces MultiMarkdown v4 (deprecated -- see MMD-6 instead)

About

Title: MultiMarkdown
Author: Fletcher T. Penney
Date: 2016-08-05
Copyright: Copyright Β© 2013-2016 Fletcher T. Penney.
Version: 5.4.0

Introduction

Markdown is a simple markup language used to convert plain text into HTML.

MultiMarkdown is a derivative of Markdown that adds new syntax features, such as footnotes, tables, and metadata. Additionally, it offers mechanisms to convert plain text into LaTeX in addition to HTML.

Background

MultiMarkdown started as a Perl script, which was modified from the original Markdown.pl.

MultiMarkdown v3 (aka 'peg-multimarkdown') was based on John MacFarlane's peg-markdown. It used a parsing expression grammar (PEG), and was written in C in order to compile on almost any operating system. Thanks to work by Daniel Jalkut, MMD v3 was built so that it didn't have any external library requirements.

MultiMarkdown v4 was basically a complete rewrite of v3. It used the same basic PEG for parsing (Multi)Markdown text, but otherwise was almost completely rebuilt.

MultiMarkdown v5 is basically the same code as v4, but the project has been restructured:

  • It is built using my c-template project boilerplate -- I welcome suggestions and ideas for improvement about this.
  • It is designed with the CMake build system, rather than just a Makefile

Why switch to CMake?

In early 2014, a user of MMD introduced me to the CMake build system. I looked at it briefly, but didn't do anything with it. Later on, I looked at it more in depth and created a parallel branch after 4.6. This would allow me to experiment with CMake without breaking anything else in the master branch.

CMake isn't perfect by any means, but it does allow for some interesting things:

  • Automatically generate GUI installers for OS X and Windows, as well as zip files for *nix. I have not looked into using CMake to build .deb packages, but that might be possible as well. My old system could generate GUI installers for Windows and OS X, but it was a complex process that required a lot of manual processing. This is much more amenable to automation.
  • An improved organization structure for various tests, including Valgrind testing. The old system was getting rather messy.
  • A templating system that better allows me to synchronize version, and other, information in code, documentation, and READMEs
  • Automatic generation of project files for Xcode, Visual Studio, and alternative build systems beyond make
  • An opportunity to reorganize my code directory hierarchy
  • The option to start adding unit test code to the source. This probably won't happen, as it would be too much work. But it is possible.

The biggest problem is that this means that anyone wishing to compile the source will need to install CMake. This isn't hard, but it is an extra step.

As a temporary measure, you can use the make deprecated command to use a simplified make recipe to compile a binary of MultiMarkdown for the current machine. I don't recommend this approach, but it should work in a pinch until you can upgrade your machine to support cmake.

I welcome feedback on this decision, but please note -- "I don't like it" or "bring back the old way" comments will be ignored. Please send meaningful criticism or suggestions.

Perhaps an approach if others want to contribute will be to do the reverse of what I did before -- create a make branch that includes a modified Makefile designed to be used without CMake?

Additionally, the old Makefile had grown over time to include some tricks that users of various systems required. I have tested the CMake system on OS X, Ubuntu and Debian Linux, and MinGW on Ubuntu. I welcome suggestions for improvements to the CMake configuration.

Download Binary

Binaries for OS X and Windows are available on the github site:

https://github.com/fletcher/MultiMarkdown-5/releases

Compile from Source

To compile MultiMarkdown, you will need to have CMake installed on your machine.

To download the source:

  • Obtain the source from the github repository (Downloading a zipfile of the source won't allow you to configure the submodules -- it's much better to use git):

    git clone https://github.com/fletcher/MultiMarkdown-5.git
    
  • Configure the submodules with two helper scripts (This can be done manually on Windows systems by looking at the source):

    ./link_git_modules
    ./update_git_modules
    
  • Compile, and (optionally) test:

    make
    cd build
    make
    make test
    

Like all versions of MultiMarkdown since v3, there is one test that will fail (now helpfully called markdown-should-fail). The other tests should pass. The valgrind tests will not work on OS X, but should pass if valgrind is installed and used on Linux machines.

If you want to make an installer, after the above, use the cpack command inside the build directory.

For more information, checkout the IMPORTANT file.

Usage

The MultiMarkdown User's Guide has complete instructions on how to use MultiMarkdown.

LyX Support

Charles R. Cowan (https://github.com/crcowan) added support for conversion to LyX. Support for this should be considered to be in alpha/beta, and is not guaranteed. Issues related to LyX can be added to the MultiMarkdown issues page on github, but will need to be answered by Charles. I am happy to include this code in the main MMD repo, but since I don't use LyX I can't support it myself. If this arrangement becomes a problem, then LyX support can be removed and it can be kept as a separate fork.

More Information

To get more information about MultiMarkdown, check out the website or MultiMarkdown User's Guide.

Developer Notes

Be sure to read the relevant documentation:

  • IMPORTANT
  • README.md
  • make documentation and look at build/documentation/html/index.html
  • Relevant portions of the User's Guide

If you wish to submit pull requests, then be sure to work off of the develop branch and configure the pull requests appropriately. I am trying to use the "git flow" workflow described here:

http://nvie.com/posts/a-successful-git-branching-model/

I will not accept pull requests directly into the master branch.

NOTE: Additionally, I am trying to use a consistent convention for commit messages, so that I can quickly generate the framework for Release Notes for new versions of MultiMarkdown. For example:

TAG: Commit message with uppercase first letter and no period at the end

TAG: Commit message one; TAG2: Commit message two

The list of TAGs is in flux, but currently includes:

  • ADDED: New features or functionality
  • CHANGED: Change to the way a feature works
  • CODE: Change the code, but don't change the overall user experience
  • FIX: Fix a bug
  • IMPORTANT: Something major was fixed
  • NOTE: These are mostly changes to the project itself (e.g. Makefile) and have no impact on the user experience

These TAGs are still in flux as I develop the system I am using, but this will allow me to automatically generate most of the Release Notes for each new version. I'll still need to go over them manually, but this gives me a head start! (As an aside, any time you use one of the make commands, the file CHANGELOG-UNRELEASED will be updated to show you new features in the development branch that have not been pulled into master yet.)

By using the TAGs, I can sort the list of messages and group things into categories. By consistently using the semi-colon syntax, I can automatically split commits with multiple notes.

License

The c-template project is released under the MIT License.

MMD 5 is released under the MIT License.

CuTest is released under the zlib/libpng license. See CuTest.c for the text of the license.

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

MultiMarkdown

Expanded perl version of John Gruber's original Markdown --- No longer under active development since MMD 3
Perl
1,065
star
2

MultiMarkdown-6

Lightweight markup processor to produce HTML, LaTeX, and more.
C
616
star
3

MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
C
306
star
4

peg-multimarkdown-latex-support

Default support files for generating LaTeX documents with MMD 3 through MMD 5
TeX
120
star
5

MultiMarkdown-Gallery

A collection of example MMD files demonstrating different features
TeX
118
star
6

MMD-QuickLook

Improved QuickLook generator for MultiMarkdown files (FYI, the closed-source version from http://multimarkdown.com/ is better and also free.)
C
96
star
7

MultiMarkdown-CMS

Package to assist with publishing a web site using MMD and a few perl scripts
Perl
95
star
8

Markdown.ooxsl

Markdown export plugin for OmniOutliner
XSLT
87
star
9

c-template

Boilerplate to set up a c project, include CuTest unit testing, cmake build setup
C
78
star
10

c-sss

Implementation of Shamir's Secret Sharing in C
C
63
star
11

SimplenoteSync

perl routine to sync folder of text files with your notes on Simplenote
Perl
58
star
12

MMD-Support

Various utility files to expand the features of MultiMarkdown 3.0
XML
40
star
13

MultiMarkdown-6-Syntax-Guide

Quick syntax guide for MultiMarkdown v6 -- click the link to the right!
HTML
36
star
14

MMD-Edit

Syntax-highlighting text editor for MultiMarkdown, based on work by Ali Rantakari
Objective-C
33
star
15

MMD-Test-Suite

Set of test documents to verify that MMD 4 is working properly
HTML
28
star
16

MMD-ePub

Now deprecated -- MMD v6 has better (and easier) support for exporting EPUB v3
XSLT
20
star
17

magnum

C implementation of Mustache "logic-less templates" (http://mustache.github.io/)
C
14
star
18

tdp

Convert tabular data (CSV, TSV) into JSON
C
10
star
19

MMD-Users-Guide

Source documents for the MultiMarkdown User's Guide (v2.0 aka Perl version)
8
star
20

MMD-6-QuickLook

macOS QuickLook Generator using MMD v6
C
8
star
21

MultiMarkdown-Composer-Themes

Themes for MultiMarkdown Composer v 3 (They should basically work on v 2 as well.)
8
star
22

html-email-builder

Workflow to build responsive HTML email via MultiMarkdown (and optionally upload to sendinblue.com)
CSS
5
star
23

MMD-Composer-2-Wiki

Wiki to generate User's Guide for MultiMarkdown Composer 2.0
4
star
24

c-boilermaker

Boilerplate C project template using CMake, CuTest and more, to simplify creating new projects. Successor to my older c-template boilerplate.
C
3
star
25

vagrant-mmd-cms

Configuration file for Vagrant to generate virtual server for MultiMarkdown-CMS hosted web site
Shell
3
star
26

MMD-Composer-4-Expansions

Example text expansions for Pro version of MultiMarkdown Composer 4
2
star
27

ios-cmake

Automatically exported from code.google.com/p/ios-cmake
CMake
2
star
28

Composer-5-Support-Files

Themes compatible with MultiMarkdown Composer 5 and nvUltra
CSS
2
star
29

Composer-Localization

String files for localizing the MultiMarkdown Composer application
1
star
30

core-utilities

Central repository for a few core libraries I reuse across many of my projects
C
1
star
31

text-parser-template

Boilerplate text parsing example using re2c lexer and lemon parser.
C
1
star
32

cmake-test-app

Objective-C
1
star
33

FTPLibFuzzer

Configuration files to build a vagrant machine with development tools for fuzz testing my software
C
1
star
34

c-title-case

C implementation of John Gruber's title case Perl script
C
1
star