From 850fb843570835833f053a003f3d7f85872a6fb3 Mon Sep 17 00:00:00 2001 From: FreeBirdLjj Date: Sat, 20 Sep 2014 19:33:14 +0800 Subject: [PATCH 01/16] Add inline code support. --- viewer.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/viewer.c b/viewer.c index e31dbcb..f5e43d4 100644 --- a/viewer.c +++ b/viewer.c @@ -363,7 +363,7 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) { void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colors) { int i = 0; // increment char *c; // char pointer for iteration - char *special = "\\*_"; // list of interpreted chars + char *special = "\\*_`"; // list of interpreted chars cstack_t *stack = cstack_init(); if(line->text->text) { @@ -450,6 +450,10 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo case '_': wattroff(window, A_UNDERLINE); break; + // disable inline code + case '`': + wattroff(window, A_REVERSE); + break; } // remove top special char from stack @@ -474,6 +478,10 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo case '_': wattron(window, A_UNDERLINE); break; + // enable inline code + case '`': + wattron(window, A_REVERSE); + break; // do nothing for backslashes } @@ -505,6 +513,10 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo case '_': wattroff(window, A_UNDERLINE); break; + // disable inline code + case '`': + wattroff(window, A_REVERSE); + break; // do nothing for backslashes } } -- 2.20.1 From 331cae2a53c652eaf7c7a7113e15b735e9d9b17e Mon Sep 17 00:00:00 2001 From: FreeBirdLjj Date: Sat, 20 Sep 2014 19:47:27 +0800 Subject: [PATCH 02/16] Add inline code sample. --- sample.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sample.md b/sample.md index fd3a8d8..0c8f51c 100644 --- a/sample.md +++ b/sample.md @@ -52,6 +52,18 @@ second-level ------------ +------------------------------------------------- + +# Supported markdown formatting's + +Inline codes are surrounded with backticks. + +C program begins excuting at the beginning of \`main()\`. + +becomes + +C program begins excuting at the beginning of `main()`. + ------------------------------------------------- # Supported markdown formatting's @@ -161,3 +173,4 @@ open an issue on GitHub: _https://github.com/visit1985/mdp_ + -- 2.20.1 From 6edf0543111ac7f119c0255ae254159d9508f770 Mon Sep 17 00:00:00 2001 From: FreeBirdLjj Date: Sun, 21 Sep 2014 01:27:05 +0800 Subject: [PATCH 03/16] Shorten sample lines. --- sample.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample.md b/sample.md index 0c8f51c..8cea5d6 100644 --- a/sample.md +++ b/sample.md @@ -58,11 +58,11 @@ second-level Inline codes are surrounded with backticks. -C program begins excuting at the beginning of \`main()\`. +C program starts with \`main()\`. becomes -C program begins excuting at the beginning of `main()`. +C program starts with `main()`. ------------------------------------------------- -- 2.20.1 From 18118c25abc51e71df1cdc1ffca75fda1cd92173 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sun, 21 Sep 2014 12:23:35 +0200 Subject: [PATCH 04/16] fixed segv in cstring.c, closes #18 --- cstring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cstring.c b/cstring.c index 3eed860..958062b 100644 --- a/cstring.c +++ b/cstring.c @@ -47,11 +47,12 @@ void cstring_expand(cstring_t *self, char x) { void cstring_expand_arr(cstring_t *self, char *x) { if(self->size + strlen(x) + sizeof(char) > self->alloc) { - self->alloc += (REALLOC_ADD * sizeof(char)); + self->alloc = ((strlen(x) + self->size + 1) * sizeof(char)); self->text = realloc(self->text, self->alloc); } self->text = strcat(self->text, x); self->size = strlen(self->text); + self->text[self->size+1] = '\0'; } void cstring_reset(cstring_t *self) { -- 2.20.1 From cf34c7f44f300adb3ccea39dfcd676adfcd0cd5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sun, 21 Sep 2014 13:21:06 +0200 Subject: [PATCH 05/16] fixed flickering on slides with code blocks, closes #8 --- include/viewer.h | 1 + viewer.c | 42 +++++++++++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/include/viewer.h b/include/viewer.h index 68c7a13..dd786e4 100644 --- a/include/viewer.h +++ b/include/viewer.h @@ -41,6 +41,7 @@ #define CP_BLUE 2 // 123 #define CP_RED 3 // 213 #define CP_YELLOW 4 // 208 +#define CP_BLACK 5 // CP_WHITE with foreground and background swapped #define FADE_DELAY 15000 // micro seconds diff --git a/viewer.c b/viewer.c index f5e43d4..14018da 100644 --- a/viewer.c +++ b/viewer.c @@ -152,10 +152,12 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) { init_pair(CP_WHITE, 232, trans); init_pair(CP_BLUE, 21, trans); init_pair(CP_RED, 196, trans); + init_pair(CP_BLACK, 15, 232); } else { init_pair(CP_WHITE, 255, trans); init_pair(CP_BLUE, 123, trans); init_pair(CP_RED, 213, trans); + init_pair(CP_BLACK, 16, 255); } init_pair(CP_YELLOW, 208, trans); @@ -175,8 +177,10 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) { if(invert) { init_pair(CP_WHITE, 0, trans); + init_pair(CP_BLACK, 7, 0); } else { init_pair(CP_WHITE, 7, trans); + init_pair(CP_BLACK, 0, 7); } init_pair(CP_BLUE, 4, trans); init_pair(CP_RED, 1, trans); @@ -376,7 +380,8 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo offset = CODE_INDENT; // reverse color for code blocks - wattron(window, A_REVERSE); + if(colors) + wattron(window, COLOR_PAIR(CP_BLACK)); // print whole lines mvwprintw(window, @@ -415,10 +420,15 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo if(CHECK_BIT(line->bits, IS_QUOTE)) { while(line->text->text[offset] == '>') { // print a reverse color block - wattron(window, A_REVERSE); - wprintw(window, "%s", " "); - wattroff(window, A_REVERSE); - wprintw(window, "%s", " "); + if(colors) { + wattron(window, COLOR_PAIR(CP_BLACK)); + wprintw(window, "%s", " "); + wattron(window, COLOR_PAIR(CP_WHITE)); + wprintw(window, "%s", " "); + } else { + wprintw(window, "%s", ">"); + } + // find next quote or break offset++; if(line->text->text[offset] == ' ') @@ -450,10 +460,11 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo case '_': wattroff(window, A_UNDERLINE); break; - // disable inline code + // disable inline code case '`': - wattroff(window, A_REVERSE); - break; + if(colors) + wattron(window, COLOR_PAIR(CP_WHITE)); + break; } // remove top special char from stack @@ -480,7 +491,8 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo break; // enable inline code case '`': - wattron(window, A_REVERSE); + if(colors) + wattron(window, COLOR_PAIR(CP_BLACK)); break; // do nothing for backslashes } @@ -515,7 +527,8 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo break; // disable inline code case '`': - wattroff(window, A_REVERSE); + if(colors) + wattron(window, COLOR_PAIR(CP_WHITE)); break; // do nothing for backslashes } @@ -531,7 +544,6 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo if(colors) wattron(window, COLOR_PAIR(CP_WHITE)); wattroff(window, A_UNDERLINE); - wattroff(window, A_REVERSE); } (stack->delete)(stack); @@ -539,7 +551,7 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo void fade_out(WINDOW *window, int trans, int colors, int invert) { int i; // increment - if(colors) { + if(colors && COLORS == 256) { for(i = 22; i >= 0; i--) { // dim color pairs @@ -547,10 +559,12 @@ void fade_out(WINDOW *window, int trans, int colors, int invert) { init_pair(CP_WHITE, white_ramp_invert[i], trans); init_pair(CP_BLUE, blue_ramp_invert[i], trans); init_pair(CP_RED, red_ramp_invert[i], trans); + init_pair(CP_BLACK, 15, white_ramp_invert[i]); } else { init_pair(CP_WHITE, white_ramp[i], trans); init_pair(CP_BLUE, blue_ramp[i], trans); init_pair(CP_RED, red_ramp[i], trans); + init_pair(CP_BLACK, 16, white_ramp[i]); } // refresh window with new color @@ -564,7 +578,7 @@ void fade_out(WINDOW *window, int trans, int colors, int invert) { void fade_in(WINDOW *window, int trans, int colors, int invert) { int i; // increment - if(colors) { + if(colors && COLORS == 256) { for(i = 0; i <= 23; i++) { // brighten color pairs @@ -572,10 +586,12 @@ void fade_in(WINDOW *window, int trans, int colors, int invert) { init_pair(CP_WHITE, white_ramp_invert[i], trans); init_pair(CP_BLUE, blue_ramp_invert[i], trans); init_pair(CP_RED, red_ramp_invert[i], trans); + init_pair(CP_BLACK, 15, white_ramp_invert[i]); } else { init_pair(CP_WHITE, white_ramp[i], trans); init_pair(CP_BLUE, blue_ramp[i], trans); init_pair(CP_RED, red_ramp[i], trans); + init_pair(CP_BLACK, 16, white_ramp[i]); } // refresh window with new color -- 2.20.1 From 0435bbf91540e1ef2ec232fc7aa891b79e366c99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sun, 21 Sep 2014 14:12:29 +0200 Subject: [PATCH 06/16] error handling for freopen() --- mdp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mdp.c b/mdp.c index 3bf1bd2..3d38e3f 100644 --- a/mdp.c +++ b/mdp.c @@ -109,8 +109,13 @@ int main(int argc, char *argv[]) { fclose(input); // replace stdin with current tty if input was a pipe - if(input == stdin) - freopen("/dev/tty", "rw", stdin); + if(input == stdin) { + input = freopen("/dev/tty", "rw", stdin); + if(!input) { + fprintf(stderr, "%s: %s: %s\n", argv[0], "/dev/tty", strerror(errno)); + exit(EXIT_FAILURE); + } + } if(debug > 0) { markdown_debug(deck, debug); -- 2.20.1 From 0c8a90b6cd07fb827135d7911a44c828eceee33b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sun, 21 Sep 2014 17:40:29 +0200 Subject: [PATCH 07/16] added revision to version number --- include/mdp.h | 5 +++-- mdp.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/mdp.h b/include/mdp.h index f57920b..8713623 100644 --- a/include/mdp.h +++ b/include/mdp.h @@ -23,7 +23,8 @@ #include "parser.h" #include "viewer.h" -#define MAJOR_VERSION 0 -#define MINOR_VERSION 90 +#define MDP_VER_MAJOR 0 +#define MDP_VER_MINOR 91 +#define MDP_VER_REVISION 1 #endif // !defined( MDP_H ) diff --git a/mdp.c b/mdp.c index 3d38e3f..4fe4a63 100644 --- a/mdp.c +++ b/mdp.c @@ -39,7 +39,7 @@ void usage() { } void version() { - printf("mdp %d.%d\n", MAJOR_VERSION, MINOR_VERSION); + printf("mdp %d.%d.%d\n", MDP_VER_MAJOR, MDP_VER_MINOR, MDP_VER_REVISION); printf("Copyright (C) 2014 Michael Goehler\n"); printf("License GPLv3+: GNU GPL version 3 or later .\n"); printf("This is free software: you are free to change and redistribute it.\n"); -- 2.20.1 From a62c5d9329631a6dadf328ef622e045efd3f6026 Mon Sep 17 00:00:00 2001 From: Christian Mayer Date: Sun, 21 Sep 2014 18:48:03 +0200 Subject: [PATCH 08/16] Also on Debian. Format fixed. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5a9e7c..75f638e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ mdp needs the ncursesw headers to compile. So make sure you have them installed: -- On Ubuntu you need ```libncursesw5``` and ```libncursesw5-dev``` to be installed. +- On Ubuntu/Debian you need `libncursesw5` and `libncursesw5-dev` to be installed. Now download and install mdp: -- 2.20.1 From 31f91305483a4efa430fe1ce181f62921c77e39f Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Sun, 21 Sep 2014 18:34:33 -0400 Subject: [PATCH 09/16] Makefile: switch out 'rm -f' with '$(RM)' to match previous invocations --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 64ecee4..3c1715e 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ install: mdp install -m 755 mdp $(PREFIX)$(DESTDIR)/mdp uninstall: - rm -f $(PREFIX)$(DESTDIR)/mdp + $(RM) $(PREFIX)$(DESTDIR)/mdp .PHONY: all clean install uninstall -- 2.20.1 From 1137e63ffbb08abc0daea19e32aa37e96afb0770 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 19 Sep 2014 15:01:30 +0900 Subject: [PATCH 10/16] Merge pull request #23 from mattn/win32 Windows porting closes #23 --- Makefile | 18 +++++++++++++----- include/viewer.h | 6 +++++- viewer.c | 1 - 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 3c1715e..f0cf1ec 100644 --- a/Makefile +++ b/Makefile @@ -19,16 +19,24 @@ # CFLAGS = -O3 -Wall -LDFLAGS = -s -LDLIBS = -lncursesw -OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o -DESTDIR ?= /usr/bin ifeq ($(DEBUG),1) -CFLAGS := -Wall -g -O0 +CFLAGS := -O0 -Wall -g LDFLAGS := endif +ifeq (Windows_NT, $(OS)) +CURSES = pdcurses +CFLAGS += -DWIN32=1 +else +CURSES = ncursesw +endif + +LDFLAGS = -s +LDLIBS = -l$(CURSES) +OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o +DESTDIR = /usr/bin + all: mdp mdp: $(OBJECTS) diff --git a/include/viewer.h b/include/viewer.h index dd786e4..b790085 100644 --- a/include/viewer.h +++ b/include/viewer.h @@ -32,7 +32,11 @@ * */ -#include +#if WIN32 == 1 +# include +#else +# include +#endif #include "parser.h" #include "cstack.h" diff --git a/viewer.c b/viewer.c index 14018da..c1a0188 100644 --- a/viewer.c +++ b/viewer.c @@ -22,7 +22,6 @@ */ #include // setlocale -#include #include #include // strchr #include -- 2.20.1 From 3abe61887adc463e2d00c000012d1e2cff15f56f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Mon, 22 Sep 2014 11:14:22 +0200 Subject: [PATCH 11/16] fixed Makefile for cygwin build after #23 --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f0cf1ec..46ed432 100644 --- a/Makefile +++ b/Makefile @@ -25,11 +25,13 @@ CFLAGS := -O0 -Wall -g LDFLAGS := endif +OSTYPE := $(shell uname -o) +CURSES = ncursesw ifeq (Windows_NT, $(OS)) -CURSES = pdcurses +ifneq (Cygwin, $(OSTYPE)) +CURSES := pdcurses CFLAGS += -DWIN32=1 -else -CURSES = ncursesw +endif endif LDFLAGS = -s -- 2.20.1 From 6f9f33a6a5c7d677b4f4464218c01580a391cf08 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sat, 20 Sep 2014 17:22:38 +0200 Subject: [PATCH 12/16] Merge pull request #21 from ungureanuvladvictor/generic_folder_structure Moved all *.c files into src folder and created separate Makefile Updated base Makefile to support src folder closes #21 --- Makefile | 35 ++++++++++++++++--------------- include/{mdp.h => main.h} | 6 +++--- src/Makefile | 40 ++++++++++++++++++++++++++++++++++++ cstack.c => src/cstack.c | 2 +- cstring.c => src/cstring.c | 2 +- mdp.c => src/main.c | 2 +- markdown.c => src/markdown.c | 2 +- parser.c => src/parser.c | 2 +- viewer.c => src/viewer.c | 2 +- 9 files changed, 68 insertions(+), 25 deletions(-) rename include/{mdp.h => main.h} (92%) create mode 100644 src/Makefile rename cstack.c => src/cstack.c (98%) rename cstring.c => src/cstring.c (98%) rename mdp.c => src/main.c (99%) rename markdown.c => src/markdown.c (98%) rename parser.c => src/parser.c (99%) rename viewer.c => src/viewer.c (99%) diff --git a/Makefile b/Makefile index 46ed432..f922b7e 100644 --- a/Makefile +++ b/Makefile @@ -18,40 +18,43 @@ # along with this program. If not, see . # -CFLAGS = -O3 -Wall - -ifeq ($(DEBUG),1) -CFLAGS := -O0 -Wall -g -LDFLAGS := -endif - OSTYPE := $(shell uname -o) CURSES = ncursesw ifeq (Windows_NT, $(OS)) ifneq (Cygwin, $(OSTYPE)) CURSES := pdcurses -CFLAGS += -DWIN32=1 endif endif LDFLAGS = -s LDLIBS = -l$(CURSES) -OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o +SOURCES = $(wildcard src/*.c) +OBJECTS = $(SOURCES:.c=.o) +TARGET = mdp DESTDIR = /usr/bin -all: mdp +ifeq ($(DEBUG),1) +LDFLAGS := +endif + +all: $(TARGET) + +$(TARGET): src + $(CC) $(OBJECTS) $(LDLIBS) $(LDFLAGS) -o $(TARGET) -mdp: $(OBJECTS) +src: + $(MAKE) $(MFLAGS) -C src clean: - $(RM) $(OBJECTS) mdp + $(MAKE) -C src clean + $(RM) $(TARGET) -install: mdp +install: install -d $(PREFIX)$(DESTDIR) - install -m 755 mdp $(PREFIX)$(DESTDIR)/mdp + install -m 755 mdp $(PREFIX)$(DESTDIR)/$(TARGET) uninstall: - $(RM) $(PREFIX)$(DESTDIR)/mdp + $(RM) $(PREFIX)$(DESTDIR)/$(TARGET) -.PHONY: all clean install uninstall +.PHONY: all clean install src uninstall diff --git a/include/mdp.h b/include/main.h similarity index 92% rename from include/mdp.h rename to include/main.h index 8713623..05d05f4 100644 --- a/include/mdp.h +++ b/include/main.h @@ -1,5 +1,5 @@ -#if !defined( MDP_H ) -#define MDP_H +#if !defined( MAIN_H ) +#define MAIN_H /* * mdp -- A command-line based markdown presentation tool. @@ -27,4 +27,4 @@ #define MDP_VER_MINOR 91 #define MDP_VER_REVISION 1 -#endif // !defined( MDP_H ) +#endif // !defined( MAIN_H ) diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..f0783e9 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,40 @@ +# +# 1 # Makefile +# Copyright (C) 2014 Michael Goehler +# +# This file is part of mdp. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +SOURCES = $(wildcard *.c) +OBJECTS = $(SOURCES:.c=.o) + +CFLAGS = -O3 -Wall -I../include +ifeq ($(DEBUG),1) +CFLAGS := -O0 -Wall -g -I../include +endif + +OSTYPE := $(shell uname -o) +ifeq (Windows_NT, $(OS)) +ifneq (Cygwin, $(OSTYPE)) +CFLAGS += -DWIN32=1 +endif +endif + +all: $(OBJECTS) + +clean: + $(RM) $(OBJECTS) + diff --git a/cstack.c b/src/cstack.c similarity index 98% rename from cstack.c rename to src/cstack.c index f56ee2c..aafb95f 100644 --- a/cstack.c +++ b/src/cstack.c @@ -21,7 +21,7 @@ #include // malloc, realloc -#include "include/cstack.h" +#include "cstack.h" cstack_t *cstack_init() { cstack_t *stack = malloc(sizeof(cstack_t)); diff --git a/cstring.c b/src/cstring.c similarity index 98% rename from cstring.c rename to src/cstring.c index 958062b..1939572 100644 --- a/cstring.c +++ b/src/cstring.c @@ -22,7 +22,7 @@ #include // strlen #include // malloc, realloc -#include "include/cstring.h" +#include "cstring.h" cstring_t *cstring_init() { cstring_t *x = malloc(sizeof(cstring_t)); diff --git a/mdp.c b/src/main.c similarity index 99% rename from mdp.c rename to src/main.c index 4fe4a63..c94330a 100644 --- a/mdp.c +++ b/src/main.c @@ -23,7 +23,7 @@ #include #include -#include "include/mdp.h" +#include "main.h" void usage() { fprintf(stderr, "%s", "Usage: mdp [OPTION]... [FILE]\n"); diff --git a/markdown.c b/src/markdown.c similarity index 98% rename from markdown.c rename to src/markdown.c index 45c4940..6e7d15f 100644 --- a/markdown.c +++ b/src/markdown.c @@ -22,7 +22,7 @@ #include #include -#include "include/markdown.h" +#include "markdown.h" line_t *new_line() { line_t *x = malloc(sizeof(line_t)); diff --git a/parser.c b/src/parser.c similarity index 99% rename from parser.c rename to src/parser.c index 1ff125c..0852e80 100644 --- a/parser.c +++ b/src/parser.c @@ -25,7 +25,7 @@ #include #include -#include "include/parser.h" +#include "parser.h" deck_t *markdown_load(FILE *input) { diff --git a/viewer.c b/src/viewer.c similarity index 99% rename from viewer.c rename to src/viewer.c index c1a0188..76dc18c 100644 --- a/viewer.c +++ b/src/viewer.c @@ -26,7 +26,7 @@ #include // strchr #include -#include "include/viewer.h" +#include "viewer.h" // color ramp for fading from black to color static short white_ramp[24] = { 16, 232, 233, 234, 235, 236, -- 2.20.1 From 67524663784b4a47e4b18fe67583f43351edbfde Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Mon, 22 Sep 2014 13:07:55 +0200 Subject: [PATCH 13/16] added contributors + convert to pdf instructions --- AUTHORS | 7 ++++++- sample.md | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 54dc5e1..65f5350 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,7 @@ -Michael Goehler +Author: visit1985 + +Contributors: +Pyrohh +FreeBirdLjj +ungureanuvladvictor diff --git a/sample.md b/sample.md index 8cea5d6..f7a4d54 100644 --- a/sample.md +++ b/sample.md @@ -1,6 +1,6 @@ %title: mdp - Sample Presentation -%author: Michael Göhler -%date: 2014-09-18 +%author: visit1985 +%date: 2014-09-22 mdp === @@ -163,6 +163,22 @@ Use *fg* to resume it. ------------------------------------------------- +# Convert your presentation to PDF + +To publish your presentation later on, you may +want to convert it to PDF. + +This can be achieved by two additional tools: + +- *markdown* to convert to HTML +- *wkhtmltopdf* to convert from HTML to PDF + +After installing them, you can simply type: + + $ markdown sample.md | wkhtmltopdf - sample.pdf + +------------------------------------------------- + ## Last words I hope you like *mdp*. But be aware, that it is -- 2.20.1 From a89c54bed93aebb402cc8cc95efb80c4b023581c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Tue, 23 Sep 2014 21:45:57 +0200 Subject: [PATCH 14/16] only check uname if OS is Windows_NT --- Makefile | 2 +- src/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f922b7e..5801f84 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,9 @@ # along with this program. If not, see . # -OSTYPE := $(shell uname -o) CURSES = ncursesw ifeq (Windows_NT, $(OS)) +OSTYPE := $(shell uname -o) ifneq (Cygwin, $(OSTYPE)) CURSES := pdcurses endif diff --git a/src/Makefile b/src/Makefile index f0783e9..42d5563 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,8 +26,8 @@ ifeq ($(DEBUG),1) CFLAGS := -O0 -Wall -g -I../include endif -OSTYPE := $(shell uname -o) ifeq (Windows_NT, $(OS)) +OSTYPE := $(shell uname -o) ifneq (Cygwin, $(OSTYPE)) CFLAGS += -DWIN32=1 endif -- 2.20.1 From 3055b6d15234fe12f088e33747aae945dbb9896a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Tue, 23 Sep 2014 22:08:14 +0200 Subject: [PATCH 15/16] cygwin setup notes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75f638e..027b59b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ mdp needs the ncursesw headers to compile. So make sure you have them installed: -- On Ubuntu/Debian you need `libncursesw5` and `libncursesw5-dev` to be installed. +- on Ubuntu/Debian you need `libncursesw5` and `libncursesw5-dev` +- on Cygwin you need `libncursesw10` and `libncurses-devel` Now download and install mdp: -- 2.20.1 From 27d774d19aaaea8e6246cda0235360c04ee88688 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Fri, 26 Sep 2014 18:07:02 +0200 Subject: [PATCH 16/16] version bump for #28 --- include/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/main.h b/include/main.h index 05d05f4..0e65cd3 100644 --- a/include/main.h +++ b/include/main.h @@ -25,6 +25,6 @@ #define MDP_VER_MAJOR 0 #define MDP_VER_MINOR 91 -#define MDP_VER_REVISION 1 +#define MDP_VER_REVISION 2 #endif // !defined( MAIN_H ) -- 2.20.1