Skip to content

Commit

Permalink
Merge branch 'release/5.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher committed Dec 1, 2015
2 parents ed1b3a5 + 440b176 commit 1e80c35
Show file tree
Hide file tree
Showing 17 changed files with 608 additions and 251 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
CHANGELOG-UNRELEASED

# Developer Tools
*.pbxuser
Expand All @@ -16,3 +17,9 @@ profile
*.moved-aside
DerivedData
.idea/


# Binaries
*.dmg
*.exe
*.zip
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# MultiMarkdown Change Log #


## [5.0.1] - 2015-12-01 ##

* IMPORTANT: Fix major error in last Makefile! (Only in build branch for a few minutes)
* ADDED: Improve empty list item detection in ODF output
* CHANGED: Remove unused node creation utilities
* CHANGED: Update documentation
* CHANGED: Use 'const' char * in g_string_new
* CODE: Improve doxygen support in libMultiMarkdown.h
* CODE: Refactor markdown_to_string() to separate parsing input text and writing output text via the intermediate node tree.
* CODE: Use node creation shortcuts for consistency and future flexibility
* FIX: Add 32 bit flag to older MinGW toolchain
* FIX: Add label for 32 bit builds
* FIX: Don't run valgrind tests unless in 'make debug' mode
* FIX: Don't static link when using 'make debug' for valgrind testing
* FIX: Fix memory leaks in transclude_source()
* NOTE: Add developer notes to the README information
* NOTE: Additional doxygen support
* NOTE: Autogenerate changelog since last commit to master
* NOTE: Begin tracking release notes in 'CHANGELOG.md'
* NOTE: Change empty listitem detection logic for ODF output
* NOTE: Change whitespace for easier diffing
* NOTE: Remove redundant developer note in README
* NOTE: Use tab instead of leading spaces in CHANGELOG-UNRELEASED


## [5.0.0] - 2015-11-15 ##

* The source repository for MultiMarkdown has been completely rebuilt:
* Use my [c-template] to provide the basic structure
* Requires the [CMake] build system
* Has the beginnings of documentation within the code to support
[Doxygen]-generated developer documentation
* Other changes since 4.7.1:
* Improvements from Matthias Lohr for the shell scripts
* Additional documentation in code
* Fix issue with whitespace after footnotes in ODF export
* Improve accuracy of recognizing single line code blocks
* Fix memory leaks
* Fix `mmd2pdf` for certain installs of TeX on El Capitan
* Improve POSIX compliance on shell scripts
* Improve accuracy of strong/emph matching
* Make reference label matching case insensitive
* Fix error if no caption was included on table
* Fix edge case slowdown when lots of HTML included
* Fix error when quotes included in explicit link
* Allow tables inside LaTeX footnotes
* Improved window path separator support
* And other improvements/fixes



[5.0.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/v5.0
[5.0.1]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/v5.0.1
46 changes: 26 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ cmake_minimum_required (VERSION 2.6)
set (My_Project_Title "MultiMarkdown")
set (My_Project_Description "MultiMarkdown - lightweight markup processor")
set (My_Project_Author "Fletcher T. Penney")
set (My_Project_Revised_Date "2015-11-12")
set (My_Project_Revised_Date "2015-12-01")
set (My_Project_Version_Major 5)
set (My_Project_Version_Minor 0)
set (My_Project_Version_Patch 0)
set (My_Project_Version_Patch 1)

set (My_Project_Version "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}")

Expand Down Expand Up @@ -245,19 +245,22 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Create zip archive
set (CPACK_GENERATOR ZIP)

# Statically link libraries -- might make the binary slightly more
# compatible across Linux distributions, for example
#
# You may wish to disable this.
#

set (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set (BUILD_SHARED_LIBRARIES OFF)
set (CMAKE_EXE_LINKER_FLAGS "-static")

# Some libraries need to be linked on some Linux builds
if (DEFINED TEST)
# target_link_libraries(run_tests m)
else (DEFINE TEST)
# Statically link libraries -- might make the binary slightly more
# compatible across Linux distributions, for example
#
# It will likely cause large numbers of errors on valgrind,
# so use "make debug" for valgrind testing
#
# You may wish to disable this.
#

set (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set (BUILD_SHARED_LIBRARIES OFF)
set (CMAKE_EXE_LINKER_FLAGS "-static")
endif (DEFINED TEST)

endif (WIN32)
Expand Down Expand Up @@ -374,9 +377,9 @@ if (DEFINED ZIP)
endif (DEFINED ZIP)

if (APPLE)
set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-Mac-${ZIP_NAME}${CPACK_PACKAGE_VERSION}")
set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-Mac-${IS_32_BIT}${ZIP_NAME}${CPACK_PACKAGE_VERSION}")
else (APPLE)
set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CMAKE_SYSTEM_NAME}-${ZIP_NAME}${CPACK_PACKAGE_VERSION}")
set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CMAKE_SYSTEM_NAME}-${IS_32_BIT}${ZIP_NAME}${CPACK_PACKAGE_VERSION}")
endif (APPLE)

install (TARGETS multimarkdown
Expand Down Expand Up @@ -452,12 +455,15 @@ ADD_MMD_TEST(critic-highlight "-r -a" CriticMarkup htmlh)


# valgrind memory testing
# Only in 'make debug' mode

find_program ( MEMORYCHECK_COMMAND valgrind)
set ( MEMORYCHECK_COMMAND_OPTIONS --leak-check=full --error-exitcode=1)
if (DEFINED TEST)
find_program ( MEMORYCHECK_COMMAND valgrind)
set ( MEMORYCHECK_COMMAND_OPTIONS --leak-check=full --error-exitcode=1)

file (GLOB TEST_FILES ${PROJECT_SOURCE_DIR}/submodules/MarkdownTest/Tests/*.text ${PROJECT_SOURCE_DIR}/submodules/MarkdownTest/MultiMarkdownTests/*.text)
file (GLOB TEST_FILES ${PROJECT_SOURCE_DIR}/submodules/MarkdownTest/Tests/*.text ${PROJECT_SOURCE_DIR}/submodules/MarkdownTest/MultiMarkdownTests/*.text)

foreach (FORMAT html latex odf beamer memoir opml lyx)
add_test ( NAME valgrind-${FORMAT} COMMAND "${MEMORYCHECK_COMMAND}" ${MEMORYCHECK_COMMAND_OPTIONS} ${PROJECT_BINARY_DIR}/multimarkdown -t ${FORMAT} ${TEST_FILES} )
endforeach()
foreach (FORMAT html latex odf beamer memoir opml lyx)
add_test ( NAME valgrind-${FORMAT} COMMAND "${MEMORYCHECK_COMMAND}" ${MEMORYCHECK_COMMAND_OPTIONS} ${PROJECT_BINARY_DIR}/multimarkdown -t ${FORMAT} ${TEST_FILES} )
endforeach()
endif (DEFINED TEST)
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ windows-32: $(BUILD_DIR) $(GREG)
.PHONY : windows-zip-32
windows-zip-32: $(BUILD_DIR) $(GREG)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/Toolchain-mingw32.cmake -DCMAKE_BUILD_TYPE=Release -DZIP=1 ..
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/Toolchain-MinGW-w64-32bit.cmake -DCMAKE_BUILD_TYPE=Release -DZIP=1 ..

# Build the documentation using doxygen
.PHONY : documentation
Expand All @@ -80,10 +80,14 @@ $(GREG):
$(MAKE) -C submodules/greg

# Create build directory if it doesn't exist
$(BUILD_DIR):
$(BUILD_DIR): CHANGELOG
-mkdir $(BUILD_DIR) 2>/dev/null
-cd $(BUILD_DIR); rm -rf *

# Generate a list of changes since last commit to 'master' branch
.PHONY : CHANGELOG
CHANGELOG:
git log master..develop --format="* %s" | sort | uniq > CHANGELOG-UNRELEASED


# ===============
Expand Down
108 changes: 87 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,37 @@
| ---------- | ------------------------- |
| Title: | MultiMarkdown |
| Author: | Fletcher T. Penney |
| Date: | 2015-11-12 |
| Date: | 2015-12-01 |
| Copyright: | Copyright © 2013-2015 Fletcher T. Penney. |
| Version: | 5.0.0 |
| Version: | 5.0.1 |


## 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.
[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 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 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 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:
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.
Expand Down Expand Up @@ -92,15 +102,19 @@ Binaries for OS X and Windows are available on the github site:

## Compile from Source ##

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

To download the source:

* Obtain the source from the github repository (Download a zipfile of the source won't allow you to configure the submodules -- it's much better to use git):
* 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):
* 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
Expand All @@ -112,35 +126,87 @@ To download the source:
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.
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.
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.
The [MultiMarkdown User's Guide] has complete instructions on how to use
MultiMarkdown.


## Developer's Notes ##
# LyX Support #

The documentation, created by doxygen, has information for developers:
Charles R. Cowan (<https://github.com/crcowan>) added support for conversion
to [LyX](http://www.lyx.org/). 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.

make documentation

You can then view `build/documentation/html/index.html` for some developer's notes. There's not a lot there yet. There is also a LaTeX version created if you want a PDF. Just use latexmk in the latex directory.
# More Information #

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

# LyX Support #

Charles R. Cowan (<https://github.com/crcowan>) added support for conversion to [LyX](http://www.lyx.org/). 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.
# Developer Notes #

Be sure to read the relevant documentation:

# More Information #
* 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.

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

## License ##

Expand Down
2 changes: 1 addition & 1 deletion src/GLibFacade.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int asprintf( char **sptr, char *fmt, ... )
#define kStringBufferStartingSize 1024
#define kStringBufferGrowthMultiplier 2

GString* g_string_new(char *startingString)
GString* g_string_new(const char *startingString)
{
GString* newString = malloc(sizeof(GString));

Expand Down
2 changes: 1 addition & 1 deletion src/GLibFacade.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typedef struct
unsigned long currentStringLength;
} GString;

GString* g_string_new(char *startingString);
GString* g_string_new(const char *startingString);
char* g_string_free(GString* ripString, bool freeCharacterData);

void g_string_append_c(GString* baseString, char appendedCharacter);
Expand Down
Loading

0 comments on commit 1e80c35

Please sign in to comment.