Skip to content

Commit

Permalink
Merge branch 'release/5.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher committed Feb 23, 2016
2 parents 8145b86 + dbb943d commit f2a0b9c
Show file tree
Hide file tree
Showing 24 changed files with 298 additions and 51 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# MultiMarkdown Change Log #


## [5.1.0] - 2016-02-22 ##

* ADDED: Add script to build drag and drop apps on OS X
* ADDED: Beginning code for public header file support; ADDED: Beginning configuration for OS X Bundle/Framework targets
* ADDED: Include support for Xcode libraries to be iOS compatible
* CHANGED: Update copyright info for 2016
* CHANGED: Update test suite
* FIXED: Allow ATX Headers inside lists
* FIXED: Allow 'naturally' aligned table cells like MMD 2 allowed
* FIXED: Allow metadata variables inside links (e.g. [[%foo]][bar])
* FIXED: Allow newline inside strong/emph (Fixes #10)
* FIXED: Change handling of version.h file for deprecated make to keep it separate from cmake alternative
* FIXED: Don't delete src/version.h
* FIXED: Fix problem with strong/emph matching incorrectly
* FIXED: Fix regression in list/heading fix that was overeager
* FIXED: Include 'fake' version.h for make deprecate
* FIXED: Include additional standard metadata keys in the list to *not* be included in HTML headers
* FIXED: Remove unneeded install directive; FIXED: Fix public header install prefix (I think)
* FIXED: Update MMD test suite for recent table alignment change
* FIXED: fix 'make deprecate' so that it truly doesn't require cmake
* FIXED: Improve tight vs loose list detection with unusual setext headers
* NOTE: Fixed git clone instructions in documentation
* NOTE: Update test suite


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

* IMPORTANT: Fix major error in last Makefile! (Only in build branch for a few minutes)
Expand Down Expand Up @@ -54,3 +79,4 @@

[5.0.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.0
[5.0.1]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.0.1
[5.1.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.1.0
112 changes: 99 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,106 @@ 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-12-01")
set (My_Project_Revised_Date "2016-02-22")
set (My_Project_Version_Major 5)
set (My_Project_Version_Minor 0)
set (My_Project_Version_Patch 1)
set (My_Project_Version_Minor 1)
set (My_Project_Version_Patch 0)

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

set (My_Project_Copyright_Date "2013-2015")
set (My_Project_Copyright_Date "2013-2016")
set (My_Project_Copyright "Copyright © ${My_Project_Copyright_Date} ${My_Project_Author}.")

project (${My_Project_Title})


# Search for included files here
include_directories(${PROJECT_BINARY_DIR})
include_directories( ${PROJECT_SOURCE_DIR}/src )
include_directories( ${PROJECT_SOURCE_DIR}/test )
include_directories(${PROJECT_BINARY_DIR})

string(TOUPPER ${My_Project_Title} My_Project_Title_Caps )
string(REGEX REPLACE " " "_" My_Project_Title_Caps ${My_Project_Title_Caps} )


# =================
# Macro Definitions
# =================

MACRO(ADD_PUBLIC_HEADER target filename)
# Add filename to public_header_files list, flag it as
# public header for libraries and OS X Frameworks

# This will work for creating one library/framework with public headers
# per project. If you need more than one, you will need to customize
# the workflow as appropriate, since there is only one
# public_header_files list.

SET_TARGET_PROPERTIES(${target} PROPERTIES PUBLIC_HEADER ${filename})

LIST(APPEND public_header_files ${filename})

SET_SOURCE_FILES_PROPERTIES(
${filename}
PROPERTIES
MACOSX_PACKAGE_LOCATION
PUBLIC_HEADER
)

# Set Xcode project to configure public header location to allow
# use when this project is used in another workspace.
# NOTE: You must manually add a "Headers" build phase and add
# the desired public headers to that list for Xcode to use them.
#
# TODO: If anyone knows how to automate that in Cmake, I would be very
# greatful!!

SET_TARGET_PROPERTIES(${target} PROPERTIES
XCODE_ATTRIBUTE_PUBLIC_HEADERS_FOLDER_PATH
"include/$(TARGET_NAME)"
)

SET_TARGET_PROPERTIES(${target} PROPERTIES
XCODE_ATTRIBUTE_PRIVATE_HEADERS_FOLDER_PATH
"$(PUBLIC_HEADERS_FOLDER_PATH)/Private"
)

# Set Xcode target to include settings for OS X and iOS

SET_TARGET_PROPERTIES(${target} PROPERTIES
XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS
"macos iphonesimulator iphoneos"
)

SET_TARGET_PROPERTIES(${target} PROPERTIES
XCODE_ATTRIBUTE_VALID_ARCHITECTURES
"x86_64 i386 armv6 armv7 armv7s arm64"
)

ENDMACRO(ADD_PUBLIC_HEADER)


# The target should be an OS X Bundle with a PList

MACRO(MAKE_TARGET_BUNDLE targetname)

set_target_properties(
${targetname}
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST
${PROJECT_SOURCE_DIR}/templates/plist.in
)

ENDMACRO(MAKE_TARGET_BUNDLE)


MACRO(ADD_LINKED_FRAMEWORK frame)

SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGES} -framework ${frame}")

ENDMACRO(ADD_LINKED_FRAMEWORK)


# ======================
# Process Template Files
# ======================
Expand Down Expand Up @@ -78,11 +156,16 @@ add_custom_command (
set(src_files
)

# primary header files
# Primary header files, also for doxygen documentation
set(header_files
src/libMultiMarkdown.h
)

# Public headers, will be installed in 'include'
# Do not manually add files here, use the ADD_PUBLIC_HEADER() macro
set(public_header_files
)

# Utility source files will not be included in doxygen
set(src_utility_files
src/GLibFacade.c
Expand Down Expand Up @@ -281,6 +364,8 @@ add_library(libMultiMarkdown STATIC
# remove the extra "lib" from "liblibFOO"
SET_TARGET_PROPERTIES(libMultiMarkdown PROPERTIES PREFIX "")

ADD_PUBLIC_HEADER(libMultiMarkdown src/libMultiMarkdown.h)

# Create command-line app
add_executable(multimarkdown
src/multimarkdown.c
Expand All @@ -296,10 +381,6 @@ set_target_properties(multimarkdown PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH
# Link the library to the app
target_link_libraries(multimarkdown libMultiMarkdown)

# Xcode settings for fat binaries
# set_target_properties(libFOO PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
# set_target_properties(main PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")


# ==========================
# Build Installer with CPack
Expand Down Expand Up @@ -342,9 +423,14 @@ install (FILES ${scripts}
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)

install (FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt ${CMAKE_CURRENT_BINARY_DIR}/README.html
DESTINATION notes
)
# install (FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt ${CMAKE_CURRENT_BINARY_DIR}/README.html
# DESTINATION notes
# )

# Use something like this to install public header files (after adding them
# with the ADD_PUBLIC_HEADER() macro)

# install (FILES ${public_header_files} DESTINATION local/include/libMultiMarkdown)

set (CPACK_COMPONENT_SCRIPTS_DISPLAY_NAME "Convenience scripts")
set (CPACK_COMPONENT_SCRIPTS_DESCRIPTION
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ documentation: $(BUILD_DIR) $(GREG)
.PHONY : clean
clean:
rm -rf $(BUILD_DIR)/*
-rm src/version.h

# Ensure greg is compiled
$(GREG):
Expand Down Expand Up @@ -102,14 +103,14 @@ CHANGELOG:
CFLAGS ?= -Wall -g -O3 -include src/GLibFacade.h -include src/version.h -include src/parser.h
PROGRAM = multimarkdown

OBJS = build/multimarkdown.o build/parse_utilities.o build/parser.o build/GLibFacade.o build/writer.o build/text.o build/html.o build/latex.o build/memoir.o build/beamer.o build/lyx.o build/lyxbeamer.o build/opml.o build/odf.o build/critic.o build/rng.o build/rtf.o build/transclude.o build/toc.o
OBJS = build/multimarkdown.o build/parse_utilities.o build/parser.o build/GLibFacade.o build/writer.o build/text.o build/html.o build/latex.o build/memoir.o build/beamer.o build/lyx.o build/lyxbeamer.o build/opml.o build/odf.o build/critic.o build/rng.o build/rtf.o build/transclude.o build/toc.o

build/%.o: src/%.c src/parser.h src/version.h
build/%.o: src/%.c src/parser.h src/version.h $(BUILD_DIR)
$(CC) -c $(CFLAGS) -o $@ $<

src/version.h: $(BUILD_DIR)
cd $(BUILD_DIR); touch README.html; \
cmake -DVERSION_ONLY=1 ..; cd ..; cp build/version.h src/version.h
cp ../tools/version.h ../src/version.h

build/parser.o: src/parser.c src/parser.h
$(CC) -c $(CFLAGS) -o $@ $<
Expand All @@ -122,4 +123,4 @@ deprecated: $(GREG) build/$(PROGRAM)

build/$(PROGRAM): $(OBJS) $(BUILD_DIR) src/version.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS); \
rm src/parser.c; rm src/version.h
rm src/parser.c
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
| ---------- | ------------------------- |
| Title: | MultiMarkdown |
| Author: | Fletcher T. Penney |
| Date: | 2015-12-01 |
| Copyright: | Copyright © 2013-2015 Fletcher T. Penney. |
| Version: | 5.0.1 |
| Date: | 2016-02-22 |
| Copyright: | Copyright © 2013-2016 Fletcher T. Penney. |
| Version: | 5.1.0 |


## Introduction ##
Expand Down
2 changes: 1 addition & 1 deletion src/beamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
beamer.c -- Beamer add-on to LaTeX writer
(c) 2013-2015 Fletcher T. Penney (http://fletcherpenney.net/).
(c) 2013-2016 Fletcher T. Penney (http://fletcherpenney.net/).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License or the MIT
Expand Down
2 changes: 1 addition & 1 deletion src/critic.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<http://criticmarkup.com>
(c) 2013-2015 Fletcher T. Penney (http://fletcherpenney.net/).
(c) 2013-2016 Fletcher T. Penney (http://fletcherpenney.net/).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License or the MIT
Expand Down
32 changes: 31 additions & 1 deletion src/html.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
html.c -- HTML writer
(c) 2013-2015 Fletcher T. Penney (http://fletcherpenney.net/).
(c) 2013-2016 Fletcher T. Penney (http://fletcherpenney.net/).
Derived from peg-multimarkdown, which was forked from peg-markdown,
which is (c) 2008 John MacFarlane (jgm at berkeley dot edu), and
Expand Down Expand Up @@ -46,6 +46,7 @@ void print_html_node(GString *out, node *n, scratch_pad *scratch) {
char *width = NULL;
char *height = NULL;
GString *temp_str;
size_t temp_size;

if (n == NULL)
return;
Expand Down Expand Up @@ -256,6 +257,11 @@ void print_html_node(GString *out, node *n, scratch_pad *scratch) {
} else if (strcmp(n->str, "mmdfooter") == 0) {
} else if (strcmp(n->str, "mmdheader") == 0) {
} else if (strcmp(n->str, "lang") == 0) {
} else if (strcmp(n->str, "transcludebase") == 0) {
} else if (strcmp(n->str, "latexmode") == 0) {
} else if (strcmp(n->str, "latexinput") == 0) {
} else if (strcmp(n->str, "latexfooter") == 0) {
} else if (strcmp(n->str, "bibtex") == 0) {
} else {
g_string_append_printf(out,"\t<meta name=\"%s\" content=\"",n->str);
print_html_node(out,n->children,scratch);
Expand Down Expand Up @@ -776,6 +782,7 @@ void print_html_node(GString *out, node *n, scratch_pad *scratch) {
scratch->cell_type = 0;
scratch->padded = 1;
scratch->table_alignment = NULL;
scratch->header_column = 0;
break;
case TABLESEPARATOR:
scratch->table_alignment = n->str;
Expand Down Expand Up @@ -825,6 +832,10 @@ void print_html_node(GString *out, node *n, scratch_pad *scratch) {
} else {
temp_type = scratch->cell_type;
}

if (scratch->header_column && (scratch->table_column == 0))
temp_type = 'h';

lev = scratch->table_column;
if ( strncmp(&temp[lev],"r",1) == 0) {
g_string_append_printf(out, "\t<t%c style=\"text-align:right;\"", temp_type);
Expand All @@ -834,6 +845,10 @@ void print_html_node(GString *out, node *n, scratch_pad *scratch) {
g_string_append_printf(out, "\t<t%c style=\"text-align:center;\"", temp_type);
} else if ( strncmp(&temp[lev],"C",1) == 0) {
g_string_append_printf(out, "\t<t%c style=\"text-align:center;\"", temp_type);
} else if ( strncmp(&temp[lev],"N",1) == 0) {
g_string_append_printf(out, "\t<t%c", temp_type);
} else if ( strncmp(&temp[lev],"n",1) == 0) {
g_string_append_printf(out, "\t<t%c", temp_type);
} else {
g_string_append_printf(out, "\t<t%c style=\"text-align:left;\"", temp_type);
}
Expand All @@ -843,7 +858,18 @@ void print_html_node(GString *out, node *n, scratch_pad *scratch) {
}
g_string_append_printf(out, ">");
scratch->padded = 2;
temp_size = out->currentStringLength;
print_html_node_tree(out, n->children, scratch);

/* We have an empty leading cell, so first column is shown as headers */
/* Disabled for now while I decide whether this should be reimplemented -- was in v2 */
/* if (scratch->table_column == 0) {
if (temp_size == out->currentStringLength) {
scratch->header_column = 1;
}
}
*/

g_string_append_printf(out, "</t%c>\n", temp_type);
scratch->table_column++;
break;
Expand Down Expand Up @@ -1128,6 +1154,10 @@ void print_col_group(GString *out,scratch_pad *scratch) {
g_string_append_printf(out, "<col style=\"text-align:center;\" class=\"extended\"/>\n");
} else if ( strncmp(&temp[lev],"L",1) == 0) {
g_string_append_printf(out, "<col style=\"text-align:left;\" class=\"extended\"/>\n");
} else if ( strncmp(&temp[lev],"N",1) == 0) {
g_string_append_printf(out, "<col class=\"extended\"/>\n");
} else if ( strncmp(&temp[lev],"n",1) == 0) {
g_string_append_printf(out, "<col/>\n");
} else {
g_string_append_printf(out, "<col style=\"text-align:left;\"/>\n");
}
Expand Down
7 changes: 5 additions & 2 deletions src/latex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
latex.c -- LaTeX writer
(c) 2013-2015 Fletcher T. Penney (http://fletcherpenney.net/).
(c) 2013-2016 Fletcher T. Penney (http://fletcherpenney.net/).
Derived from peg-multimarkdown, which was forked from peg-markdown,
which is (c) 2008 John MacFarlane (jgm at berkeley dot edu), and
Expand Down Expand Up @@ -845,8 +845,11 @@ void print_latex_node(GString *out, node *n, scratch_pad *scratch) {
case TABLESEPARATOR:
temp_str = g_string_new("");
for (i = 0; n->str[i]; i++) {
if (n->str[i] != 'h')
if ((n->str[i] == 'N') || (n->str[i] == 'n')) {
g_string_append_printf(temp_str,"L");
} else if (n->str[i] != 'h') {
g_string_append_printf(temp_str,"%c",toupper(n->str[i]));
}
}
g_string_append_printf(out, "\\begin{tabulary}{\\textwidth}{@{}%s@{}} \\toprule\n", temp_str->str);

Expand Down
2 changes: 1 addition & 1 deletion src/libMultiMarkdown.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/*
Copyright © 2013-2015 Fletcher T. Penney.
Copyright © 2013-2016 Fletcher T. Penney.
The `c-template` project is released under the MIT License.
Expand Down
Loading

0 comments on commit f2a0b9c

Please sign in to comment.